/* -------------------------------------------------------------------------- */
/* Brand palette                                                              */
/* -------------------------------------------------------------------------- */

:root {
    /* Outer background (brand teal) */
    --aux-bg: #e9c46a;

    /* Neutral surfaces inside the app window */
    --aux-surface-main:     #e9c46a;  /* big draggable window */
    --aux-surface-elevated: #081320;  /* inner panels */
    --aux-surface-soft:     #111827;  /* columns, tables, notes */
    --aux-surface-header:   #040a12;  /* window header + admin bar */

    /* Text */
    --aux-text:       #f9fafb;
    --aux-text-muted: #9ca3af;

    /* Brand accents */
    --aux-orange:  #f6a361;
    --aux-yellow:  #efc86b;
    --aux-teal:    #2aa091;

    /* Borders / misc */
    --aux-border-subtle: #1f2933;
    --aux-danger:        #b91c1c;

    /* Architectural background lines */
    --aux-rail-line: rgba(0, 0, 0, 0.18);
}

/* -------------------------------------------------------------------------- */
/* Global / layout                                                            */
/* -------------------------------------------------------------------------- */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: var(--aux-bg);  /* teal only out here */
    color: var(--aux-text);
    padding-bottom: 1.5rem;
    position: relative;
    overflow-x: hidden;
}

/* Logged-in “desktop shell” – window is fixed, flex centering isn’t needed */
body.desktop-shell {
    display: block;
    align-items: stretch;
    justify-content: flex-start;
    background: var(--aux-surface-main);  /* use dark app bg, not teal */
}

/* page-level spacing utilities */
.mt-05  { margin-top: 0.5rem; }
.mt-075 { margin-top: 0.75rem; }
.mt-1   { margin-top: 1rem; }

/* -------------------------------------------------------------------------- */
/* Generic cards (used on non-desktop pages like login, detail, etc.)        */
/* -------------------------------------------------------------------------- */

.card {
    width: 100%;
    max-width: 1100px;              /* unified width across pages */
    background: var(--aux-surface-elevated);
    border-radius: 1.5rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
    padding: 2.5rem 2rem;
    margin-top: 1.25rem;
}

/* Login stays intentionally narrow */
.login-card {
    max-width: 420px;
}
/* Full-screen software layout for board page */

.board-page {
    padding: 1.25rem 1.75rem 2rem;
    background: var(--aux-surface-main);
    min-height: calc(100vh - 48px);   /* under the admin bar */
}

/* Board header spans full width inside the page */
.board-header {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* -------------------------------------------------------------------------- */
/* Desktop shell + app window                                                 */
/* -------------------------------------------------------------------------- */

.app-window {
    position: fixed;
    top: 48px;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1200px, calc(100% - 96px)); /* 48px side gutters */
    background: var(--aux-surface-main);   /* dark navy, not teal */
    border-radius: 1rem;
    border: 1px solid var(--aux-border-subtle);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 20;
}

.app-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.75rem;
    background: var(--aux-surface-header);
    border-bottom: 1px solid var(--aux-border-subtle);
    cursor: move;
    font-size: 0.85rem;
}

.app-window-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.app-window-title-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--aux-teal);
}

.app-window-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.app-window-btn {
    border: 1px solid transparent;
    background: var(--aux-surface-main);
    color: var(--aux-text-muted);
    border-radius: 999px;
    padding: 0.15rem 0.45rem;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
}

.app-window-btn:hover {
    border-color: #374151;
    background: #111827;
    color: var(--aux-text);
}

.app-window-body {
    flex: 1;
    overflow: auto;
    padding: 1.5rem 1.75rem 1.75rem;
}

/* Fullscreen state toggled by JS */
.app-window.is-fullscreen {
    top: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    transform: none;
    border-radius: 0;
}

/* inner content layout inside window */
.app-main {
    width: 100%;
    max-width: 1100px;  /* matches .card width */
    margin: 0 auto;
}

.app-panel {
    background: var(--aux-surface-elevated);
    border-radius: 1.5rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
    padding: 2.5rem 2rem;
}

/* During drag, avoid text-selection flicker */
body.is-dragging-window {
    user-select: none;
}

/* -------------------------------------------------------------------------- */
/* Typography / basic elements                                                */
/* -------------------------------------------------------------------------- */

h1 {
    margin: 0 0 1.25rem;
    font-size: 1.6rem;
}

label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

input,
select,
textarea {
    font-family: inherit;
}

input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid #1f2937;
    background: #020617;
    color: var(--aux-text);
    font-size: 0.95rem;
}

input:focus {
    outline: none;
    border-color: var(--aux-teal);
    box-shadow: 0 0 0 1px rgba(42, 160, 145, 0.45);
}

.field-sm { max-width: 200px; }
.field-md { max-width: 260px; }
.field-lg { max-width: 280px; }
.field-xl { max-width: 340px; }

.field {
    margin-bottom: 0.9rem;
}

/* Buttons */

button {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 0.9rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, var(--aux-teal), var(--aux-yellow));
    color: #021013;
}

.error {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #fca5a5;
}

.hint {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--aux-text-muted);
}

/* -------------------------------------------------------------------------- */
/* Top bar / navigation                                                       */
/* -------------------------------------------------------------------------- */

.admin-bar {
    width: 100%;
    background: var(--aux-surface-header); /* not teal */
    border-bottom: 1px solid var(--aux-border-subtle);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    padding: 0.35rem 1.25rem;
    z-index: 40;
}

.admin-bar .top-bar {
    max-width: 1100px;
    margin: 0 auto;
    margin-bottom: 0;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.top-bar a {
    color: var(--aux-text-muted);
    text-decoration: none;
}

.top-bar a:hover {
    text-decoration: underline;
    color: var(--aux-orange);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.top-nav {
    display: flex;
    align-items: center;
}

.top-nav-list {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-nav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.top-nav-item-logout {
    margin-left: 0.5rem;
}

.top-nav-link {
    color: var(--aux-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.top-nav-link:hover {
    color: var(--aux-text);
    border-color: #374151;
    background: #111827;
}

.top-nav-link.active {
    border-color: var(--aux-teal);
    background: #053039;
    color: #e5e7eb;
}

.top-nav-link-logout {
    color: var(--aux-orange);
}

.top-nav-link-logout:hover {
    border-color: var(--aux-orange);
}

/* submenu caret button */
.top-nav-caret {
    border: 1px solid transparent;
    background: transparent;
    color: var(--aux-text-muted);
    cursor: pointer;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    font-size: 0.7rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-nav-caret:hover {
    color: var(--aux-text);
    border-color: #374151;
    background: #111827;
}

.top-nav-item.has-submenu.submenu-open > .top-nav-caret {
    transform: rotate(180deg);
}

/* submenu container */
.top-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    padding: 0.25rem 0.25rem 0.3rem;
    background: #020617;
    border-radius: 0.6rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    min-width: 150px;
    list-style: none;
    display: none;
    flex-direction: column;
    gap: 0.1rem;
    z-index: 20;
}

.top-submenu-item {
    width: 100%;
}

.top-submenu-link {
    display: block;
    width: 100%;
    padding: 0.3rem 0.6rem;
    border-radius: 0.45rem;
    font-size: 0.8rem;
    color: #d1d5db;
    text-decoration: none;
    white-space: nowrap;
}

.top-submenu-link:hover {
    background: #111827;
    color: var(--aux-text);
}

.top-submenu-link.active {
    background: #022c22;
    color: var(--aux-text);
    border: 1px solid var(--aux-teal);
}

.top-nav-item.has-submenu:hover > .top-submenu {
    display: flex;
}

.top-nav-item.has-submenu.submenu-open > .top-submenu {
    display: flex;
}

.contact-back-link {
    display: inline-block;
    font-size: 0.85rem;
    color: #60a5fa;
    text-decoration: none;
    margin-bottom: 0.75rem;
}

.contact-back-link:hover {
    text-decoration: underline;
    color: #93c5fd;
}

/* -------------------------------------------------------------------------- */
/* Quote / hero layout (login/home)                                          */
/* -------------------------------------------------------------------------- */

.quote-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 2rem;
}

.quote-layout img {
    width: 100%;
    border-radius: 1.25rem;
    display: block;
    object-fit: cover;
    max-height: 380px;
}

.quote {
    font-size: clamp(1.4rem, 2vw + 0.7rem, 1.9rem);
    line-height: 1.4;
    font-weight: 600;
}

.quote mark {
    background: none;
    padding: 0;
    border-radius: 0;
}

.attribution {
    margin-top: 1.25rem;
    font-size: 0.92rem;
    color: var(--aux-text-muted);
}

.attribution strong {
    color: var(--aux-text);
}

.subcopy {
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: #6b7280;
}

/* -------------------------------------------------------------------------- */
/* Kanban board                                                               */
/* -------------------------------------------------------------------------- */

.board-header {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.board-header > form {
    margin-right: 1rem;
}

.board-header select {
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #1f2937;
    background: #020617;
    color: var(--aux-text);
}

.kanban-board {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    /* no extra scrolling – page handles it */
}

.kanban-column {
    background: var(--aux-surface-soft);
    border-radius: 1rem;
    flex: 1 1 0;          /* equal-width columns */
    min-width: 0;
    display: flex;
    flex-direction: column;
    /* no max-height – let columns grow */
}

.kanban-column-header {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #1f2937;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.kanban-column-title {
    font-weight: 600;
}

.kanban-column-count {
    background: #111827;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    color: var(--aux-text-muted);
}

.kanban-column-body {
    padding: 0.5rem;
    overflow-y: visible;  /* kill inner scrollbars */
    flex: 1;
}

.kanban-column-drop-target {
    outline: 2px dashed var(--aux-teal);
    outline-offset: -4px;
}

.kanban-card {
    background: #0b1220;                 /* slightly more neutral than #142732 */
    border-radius: 0.75rem;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.5rem;
    cursor: grab;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.kanban-card-dragging {
    opacity: 0.6;
}

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.kanban-card-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.kanban-card-id {
    font-size: 0.7rem;
    color: var(--aux-text-muted);
    margin-bottom: 0.15rem;
}

.kanban-card-meta {
    margin-top: 0.35rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.kanban-card-link {
    color: var(--aux-text);
    text-decoration: none;
}

.kanban-card-link:hover {
    text-decoration: underline;
}

.kanban-column-over-limit {
    background: rgba(189, 6, 6, 0.863); /* subtle red wash */
}

/* badges */

.badge {
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: #111827;
    color: var(--aux-text);
    font-size: 0.75rem;
    line-height: 1.1;
}

.badge-priority-low {
    background: #1f2937;
    color: #9ca3af;
    border: 1px solid #374151;
}
.badge-priority-medium {
    background: var(--aux-teal);   /* main teal lives here */
    color: #021013;
    border: none;
}
.badge-priority-high {
    background: var(--aux-orange);
    color: #111827;
    border: none;
}
.badge-priority-critical {
    background: var(--aux-danger);
    color: #fef2f2;
    border: none;
}

.badge-owner {
    background: #4b5563;
}

/* kanban owner / due */

.kanban-owner-stack {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
}

.kanban-owner-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    background: #1f2937;
    color: var(--aux-text);
}

.kanban-due-circle {
    min-width: 22px;
    height: 22px;
    padding: 0 0.2rem;          /* lets 2-digit numbers breathe */
    border-radius: 0.3rem;      /* rounded square, not circle */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    background: #111827;
    color: var(--aux-text-muted);
    border: 1px solid #374151;
}

.kanban-due-soon {
    background: var(--aux-yellow);
    color: #111827;
    border-color: transparent;
}

.kanban-due-overdue {
    background: var(--aux-danger);
    color: #fef2f2;
    border-color: transparent;
}

/* -------------------------------------------------------------------------- */
/* Forms / textareas                                                          */
/* -------------------------------------------------------------------------- */

.form-card h1 {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.form-group textarea,
.note-form textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid #1f2937;
    background: #020617;
    color: var(--aux-text);
    font-size: 0.95rem;
    resize: vertical;
}

.form-group textarea:focus,
.note-form textarea:focus {
    outline: none;
    border-color: var(--aux-teal);
    box-shadow: 0 0 0 1px rgba(42, 160, 145, 0.45);
}

/* compact buttons */

.btn-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    border: 1px solid var(--aux-teal);
    background: #053039;
    color: #e5e7eb;
    text-decoration: none;
    cursor: pointer;
    width: auto;
}

.btn-small:hover {
    background: #0a4b55;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
    width: auto;
}

.btn-primary   { background: var(--aux-teal); color: #021013; }
.btn-secondary { background: #636f7b;        color: #ffffff; }
.btn-danger    { background: #b91c1c;        color: #ffffff; }

/* -------------------------------------------------------------------------- */
/* Work item detail + contact detail                                          */
/* -------------------------------------------------------------------------- */

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.item-title-block {
    max-width: 70%;
}

.item-id {
    font-size: 0.8rem;
    color: var(--aux-text-muted);
    margin-bottom: 0.15rem;
}

.item-title {
    margin: 0;
    font-size: 1.4rem;
}

.item-title input {
    font-size: 1.3rem;
    font-weight: 600;
}

.item-meta {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.item-meta-row {
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.item-meta-row .meta-label {
    color: var(--aux-text-muted);
    margin-right: 0.2rem;
    font-size: 0.85rem;
}

.item-section {
    margin-top: 1.5rem;
}

.item-section h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.item-description {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* notes */

.item-notes h2 {
    margin-bottom: 0.5rem;
}

.notes-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.note {
    background: #020617;
    border-radius: 0.75rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
}

.note-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--aux-text-muted);
    margin-bottom: 0.35rem;
}

.note-author {
    font-weight: 600;
}

.note-body {
    white-space: pre-wrap;
}

.notes-empty {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* ownership */

.item-owner {
    margin-top: 1.5rem;
}

.item-owner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.item-owner-header h2 {
    margin: 0;
}

.owner-display-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.owner-display-name {
    font-weight: 500;
}

.owner-form {
    display: none;
    margin-top: 0.3rem;
}

.owner-form.visible {
    display: flex;
}

.owner-form-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.owner-form-row select {
    flex: 1;
}

/* compact buttons on detail pages */

.item-card button {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.9rem;
    margin-top: 0.25rem;
}

.item-card .note-form button,
.item-card .owner-form button {
    margin-top: 0.5rem;
}

/* history */

.item-history {
    margin-top: 1.5rem;
}

.item-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.3rem;
}

.item-history-header h2 {
    margin: 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8rem;
    max-height: 11.5rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.history-entry {
    color: var(--aux-text-muted);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.history-message {
    font-weight: 500;
}

.history-meta {
    margin-left: 0.25rem;
    color: #6b7280;
    font-weight: 400;
}

/* interactions */

.interaction-row,
.interaction-updates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.interaction-updates {
    margin-top: 0.75rem;
}

/* tags */

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #111827;
    color: var(--aux-text);
}

.tag-pill input[type="checkbox"] {
    margin: 0;
}

/* -------------------------------------------------------------------------- */
/* Scope toggle / dependencies                                                */
/* -------------------------------------------------------------------------- */

.scope-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.scope-pill {
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--aux-text-muted);
    text-decoration: none;
    line-height: 1.3;
}

.scope-pill:hover {
    border-color: #374151;
    background: #0b1120;
    color: var(--aux-text);
}

.scope-pill.active {
    border-color: var(--aux-teal);
    background: #053039;
    color: #e5e7eb;
}

.item-deps {
    margin-top: 1.5rem;
}

.deps-list {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.deps-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.deps-link {
    color: var(--aux-text);
    text-decoration: none;
}

.deps-link:hover {
    text-decoration: underline;
}

.deps-status {
    font-size: 0.8rem;
    color: var(--aux-text-muted);
}

.deps-remove-form {
    margin-left: auto;
}

.deps-remove-btn {
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    padding: 0 0.3rem;
    font-size: 1rem;
    line-height: 1;
}

.deps-remove-btn:hover {
    color: #fca5a5;
}

.deps-add-form {
    margin-top: 0.5rem;
}

.deps-add-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.deps-add-row input[type="number"] {
    max-width: 120px;
}

.deps-subheading {
    margin: 0.5rem 0 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--aux-text-muted);
}

/* -------------------------------------------------------------------------- */
/* Cap table                                                                  */
/* -------------------------------------------------------------------------- */

.cap-table-header {
    margin-bottom: 1rem;
}

.cap-table-title {
    margin: 0;
    font-size: 1.4rem;
}

.cap-table-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--aux-text-muted);
}

.cap-table-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    background: var(--aux-surface-soft);
    border-radius: 0.9rem;
    overflow: hidden;
}

.cap-table-table thead {
    background: var(--aux-surface-header);
}

.cap-table-table th,
.cap-table-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #1f2937;
    vertical-align: middle;
}

.cap-table-table th {
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.cap-table-table tr:last-child td {
    border-bottom: none;
}

.cap-table-table input[type="text"],
.cap-table-table input[type="number"],
.cap-table-table textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.35rem 0.45rem;
    font-size: 0.8rem;
}

.cap-table-table textarea {
    min-height: 40px;
    resize: vertical;
}

.cap-table-actions {
    white-space: nowrap;
}

.row-form {
    margin: 0;
}

.cap-table-totals {
    margin-top: 0.85rem;
    font-size: 0.9rem;
}

.cap-table-totals strong {
    font-weight: 600;
}

/* -------------------------------------------------------------------------- */
/* Responsive tweaks                                                          */
/* -------------------------------------------------------------------------- */

@media (max-width: 720px) {
    .card,
    .app-panel {
        padding: 1.75rem 1.3rem;
    }

    .quote-layout {
        grid-template-columns: 1fr;
    }

    .kanban-board {
        flex-wrap: nowrap;
    }

    .app-window {
        top: 32px;
        bottom: 24px;
        width: calc(100% - 32px);
        transform: translateX(-50%);
    }
}

@media (max-width: 900px) {
    .kanban-board {
        overflow-x: auto;
    }

    .kanban-column {
        flex: 0 0 240px;
        min-width: 220px;
        max-width: 280px;
    }
}

/* -------------------------------------------------------------------------- */
/* Architectural side rails (background hatch lines)                          */
/* -------------------------------------------------------------------------- */

body::before,
body::after {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    width: 110px;
    pointer-events: none;
    z-index: 0;
    background-image: repeating-linear-gradient(
        135deg,
        var(--aux-rail-line) 0px,
        var(--aux-rail-line) 1px,
        transparent 1px,
        transparent 12px
    );
}

body::before { left: 0; }
body::after  { right: 0; }

/* No architectural rails on full app screens */
body.desktop-shell::before,
body.desktop-shell::after {
    display: none;
}

/* Make sure core UI sits above rails */
.card,
.admin-bar,
.board-card,
.form-card,
.item-card,
.cap-table-card,
.app-window {
    position: relative;
    z-index: 1;
}
/* Finance page: use centered card instead of full-width */
.card.cap-table-card.finance-page {
    width: 100%;
    max-width: 1100px;      /* same clamp as generic .card */
    margin: 1.25rem auto 0; /* center horizontally */
    border-radius: 1.5rem;  /* optional: make it look like a card again */
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
}
/* Finance modal centering */
#finance-modal-backdrop {
    position: fixed;
    inset: 0;                 /* top/right/bottom/left: 0 */
    display: flex;
    align-items: center;      /* vertical center */
    justify-content: center;  /* horizontal center */
    z-index: 2000;            /* above cards/admin bar */
    background: rgba(0, 0, 0, 0.45); /* dim background */
}

#finance-modal-backdrop .modal {
    margin: 0;                /* kill any bottom margin that pushes it down */
    max-width: 700px;
    width: 90%;
}
.finance-table .finance-parent-row {
    background: #050b14;       /* slightly lighter than body */
    font-weight: 600;
}

.finance-table .finance-leaf-row {
    font-size: 0.9rem;
    color: #cbd5f5;
}

.finance-category-name {
    cursor: pointer;
}

.finance-table .finance-parent-row .finance-category-name::before {
    content: '▾';
    display: inline-block;
    margin-right: 0.35rem;
    opacity: 0.6;
    font-size: 0.75rem;
}

/* numeric column */
.finance-category-total {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.finance-total-positive { color: #4ade80; }  /* green-ish */
.finance-total-negative { color: #f97373; }  /* red-ish */
.finance-total-zero     { color: #64748b; }

.finance-category-row[data-depth="1"] .finance-category-name { padding-left: 1.25rem; }
.finance-category-row[data-depth="2"] .finance-category-name { padding-left: 2.0rem; }
/* etc */

