/* ============================================================
   OpsLink — Shared Application Styles
   Loaded globally via index.html. View-specific <style> blocks
   in each view file only need to add overrides.
   ============================================================ */

/* --- Typography ------------------------------------------- */
h2 {
    margin: 0 0 0.75rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

/* --- Page Header Row (title + right-side action) ---------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.page-header h2 { margin: 0; border: none; padding: 0; }
.page-subtitle { font-size: 0.82rem; color: #aaa; }

/* --- Filter Bar ------------------------------------------- */
.filters {
    display: flex;
    gap: 8px;
    margin-bottom: 0.75rem;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
}
.filters label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}
.filters input,
.filters select {
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid #d0d5dd;
    font-size: 0.85rem;
    font-family: inherit;
    color: #333;
    background: white;
}
.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: #888;
}
.filters .sep {
    color: #ccc;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* --- Buttons ---------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
    transition: filter 0.15s;
    line-height: 1.4;
}
.btn:hover { filter: brightness(0.88); }
.btn-dark    { background: #2c3e50; color: white; }
.btn-muted   { background: #6c757d; color: white; }
.btn-success { background: #28a745; color: white; }
.btn-danger  { background: #dc3545; color: white; }
.btn-outline {
    background: transparent;
    border: 1px solid #d0d5dd;
    color: #555;
}
.btn-outline:hover { background: #f4f6f8; filter: none; }

/* --- Table Wrapper ---------------------------------------- */
.table-wrap {
    flex: 1;
    overflow: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

/* --- Shared Table Base ------------------------------------ */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
    padding: 5px 12px;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}
th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.8rem;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 0 #e0e0e0;
}
th.num, td.num { text-align: right; }
tr:hover { background: #f8f9fa; }

/* --- Tree Table Rows (P&L, Balance Sheet) ---------------- */
tr.row-parent { background: #f4f6f8; cursor: pointer; }
tr.row-parent:hover { background: #edf0f3; }
tr.row-parent td { font-weight: 600; }
tr.row-child:hover { background: #fafbfc; }
tr.row-section-total td {
    font-weight: 700;
    background: #edf2f8;
    border-top: 1px solid #c5d6ea;
    color: #2c3e50;
}
tr.row-grand-total td {
    font-weight: 700;
    background: #2c3e50;
    color: white;
    border-top: 2px solid #1a252f;
}
.expand-icon {
    display: inline-block;
    width: 14px;
    text-align: center;
    color: #bbb;
    font-style: normal;
    margin-right: 4px;
    font-size: 0.7rem;
}

/* --- Amount Colors --------------------------------------- */
.amount-positive { color: #28a745; }
.amount-negative { color: #dc3545; }
.amount-zero     { color: #ccc; }

/* --- Summary Bar ----------------------------------------- */
.summary-bar {
    display: flex;
    gap: 28px;
    padding: 10px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #eee;
    margin-bottom: 0.75rem;
}
.summary-bar .item { display: flex; flex-direction: column; gap: 3px; }
.summary-bar .item .lbl {
    color: #aaa;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.summary-bar .item .val {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2c3e50;
}

/* --- Empty State ----------------------------------------- */
.status-msg {
    text-align: center;
    padding: 48px 20px;
    color: #bbb;
    font-size: 0.88rem;
}

/* --- Badges ---------------------------------------------- */
.badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 500;
    background: #e9ecef;
    color: #555;
}

/* --- Active Members Table Expansion Styling --- */
tr.expanded-row {
    background-color: #f1f3f9 !important;
    border-left: 4px solid #4e73df;
}
tr.expanded-row td {
    color: #2e59d9;
    font-weight: 600;
}
tr.expanded-row i.fa-caret-down {
    color: #4e73df !important;
}

tr.child-row {
    background-color: #f8f9fc;
}
tr.child-row > td {
    padding: 10px 20px !important;
}

/* Inner table styling */
tr.child-row table.table-sm {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 0;
    overflow: hidden; /* For border radius */
}
tr.child-row table.table-sm thead th {
    background-color: #eaecf4;
    color: #6e707e;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e3e6f0;
    padding: 8px 15px;
}
tr.child-row table.table-sm tbody td {
    padding: 8px 15px;
    border-bottom: 1px solid #f2f4f6;
    color: #5a5c69;
}
tr.child-row table.table-sm tbody tr:last-child td {
    border-bottom: none;
}
tr.child-row table.table-sm tbody tr:hover {
    background-color: #fdfdfe;
}

