/* =========================================================================
   TNEB Engineers' Sangam Billing — Modern Dashboard Theme
   Combined inspiration: Lector (gradient tiles) + EtSales (sparklines)
                       + Lorem (soft neumorphic feel)
   ========================================================================= */

:root {
    /* Brand — Sangam Green theme (mint/emerald inspired) */
    --primary:        #059669;             /* emerald 600 */
    --primary-dark:   #047857;             /* emerald 700 */
    --primary-light:  #34d399;             /* emerald 400 */
    --secondary:      #f59e0b;             /* amber accent */
    --accent:         #0ea5e9;             /* sky */

    --grad-primary:   linear-gradient(135deg, #059669 0%, #34d399 100%);
    --grad-pink:      linear-gradient(135deg, #ec4899 0%, #f9a8d4 100%);
    --grad-blue:      linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    --grad-cyan:      linear-gradient(135deg, #06b6d4 0%, #67e8f9 100%);
    --grad-orange:    linear-gradient(135deg, #f97316 0%, #fdba74 100%);
    --grad-green:     linear-gradient(135deg, #059669 0%, #6ee7b7 100%);
    --grad-purple:    linear-gradient(135deg, #8b5cf6 0%, #c4b5fd 100%);
    --grad-rose:      linear-gradient(135deg, #f43f5e 0%, #fda4af 100%);
    --grad-emerald:   linear-gradient(135deg, #047857 0%, #10b981 100%);
    --grad-teal:      linear-gradient(135deg, #0f766e 0%, #5eead4 100%);

    /* Status palette */
    --success:        #059669;
    --success-bg:     #d1fae5;
    --success-text:   #065f46;
    --warning:        #d97706;
    --warning-bg:     #fef3c7;
    --warning-text:   #92400e;
    --danger:         #dc2626;
    --danger-bg:      #fee2e2;
    --danger-text:    #991b1b;
    --info:           #0284c7;
    --info-bg:        #e0f2fe;
    --info-text:      #075985;

    /* Neutrals — soft mint-tinted greys for warmth */
    --bg:             #ecf7f1;             /* very soft mint background */
    --surface:        #ffffff;
    --surface-2:      #f0faf4;             /* card-tinted background */
    --border:         #d6ebde;
    --border-strong:  #b8dcc7;

    --text:           #0d2920;             /* deep forest, high contrast on mint */
    --text-soft:      #2d5544;
    --text-mute:      #6c8b7e;

    /* Shadows — green-tinted for cohesion */
    --shadow-xs:      0 1px 2px rgba(5, 90, 60, 0.05);
    --shadow-sm:      0 2px 6px rgba(5, 90, 60, 0.07);
    --shadow:         0 8px 24px rgba(5, 90, 60, 0.10);
    --shadow-lg:      0 18px 48px rgba(5, 90, 60, 0.18);
    --shadow-tile:    0 12px 28px -8px rgba(5, 150, 105, 0.40);

    /* Type */
    --font-body:      'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-tamil:     'Noto Sans Tamil', sans-serif;

    /* Layout */
    --r-1:            6px;
    --r-2:            12px;
    --r-3:            18px;
    --r-pill:         999px;

    --sidebar-w:      252px;
    --topbar-h:       70px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100%; }
img { max-width: 100%; height: auto; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(circle at 0% 0%, rgba(52, 211, 153, 0.08), transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(5, 150, 105, 0.05), transparent 40%);
    background-attachment: fixed;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}
html[lang="ta"] body, [lang="ta"] {
    font-family: var(--font-tamil), var(--font-body);
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4 { font-weight: 700; color: var(--text); margin: 0; letter-spacing: -0.015em; line-height: 1.2; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

/* ========== Layout shell ========== */
.tns-app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

/* ========== Sidebar ========== */
.tns-sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f5fbf7 100%);
    border-right: 1px solid var(--border);
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    z-index: 1020;
    display: flex; flex-direction: column;
    transition: transform 0.25s ease;
}

.tns-sidebar-brand {
    padding: 0.85rem 1.1rem;
    display: flex; align-items: center; gap: 0.75rem;
    height: var(--topbar-h);
    text-decoration: none;
    background:
        linear-gradient(135deg, rgba(5, 150, 105, 0.10) 0%, rgba(52, 211, 153, 0.05) 60%, transparent 100%);
    border-bottom: 1px solid var(--border);
    position: relative;
    transition: background 0.2s;
}
.tns-sidebar-brand:hover {
    background:
        linear-gradient(135deg, rgba(5, 150, 105, 0.16) 0%, rgba(52, 211, 153, 0.08) 60%, transparent 100%);
}
.tns-sidebar-brand::after {
    content: "";
    position: absolute;
    left: 1.1rem; right: 1.1rem; bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 50%, transparent 100%);
    border-radius: 2px;
}

.tns-sidebar-brand .brand-logo-wrap {
    width: 46px; height: 46px;
    flex-shrink: 0;
    border-radius: 12px;
    background: #fff;
    padding: 3px;
    box-shadow:
        0 2px 4px rgba(5, 150, 105, 0.12),
        0 0 0 1px rgba(5, 150, 105, 0.10);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    position: relative;
}
.tns-sidebar-brand .brand-logo-wrap::before {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.7), transparent 60%);
    pointer-events: none;
}
.tns-sidebar-brand .logo-img {
    width: 100%; height: 100%;
    object-fit: contain;
    position: relative; z-index: 1;
}
.tns-sidebar-brand .logo-fallback {
    width: 100%; height: 100%;
    background: var(--grad-primary);
    border-radius: 9px;
    align-items: center; justify-content: center;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
}

.tns-sidebar-brand .brand-text {
    display: flex; flex-direction: column;
    line-height: 1;
}
.tns-sidebar-brand .brand-name {
    font-weight: 800;
    font-size: 1.45rem;
    background: linear-gradient(135deg, #0f172a 0%, #334155 60%, #475569 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.06em;
    line-height: 1;
}
.tns-sidebar-brand .brand-tag {
    font-size: 0.62rem;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-top: 4px;
}

.tns-sidebar-nav {
    padding: 1.25rem 0.75rem;
    flex: 1;
    overflow-y: auto;
}

.tns-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-mute);
    padding: 1rem 0.75rem 0.5rem;
    font-weight: 600;
}

.tns-nav-link {
    display: flex; align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.85rem;
    color: var(--text-soft);
    border-radius: var(--r-2);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 2px;
    transition: all 0.18s;
    text-decoration: none;
    position: relative;
}
.tns-nav-link i {
    width: 20px; text-align: center; font-size: 1rem;
    color: var(--text-mute);
    transition: color 0.18s;
}
.tns-nav-link:hover {
    background: var(--surface-2);
    color: var(--text);
}
.tns-nav-link:hover i { color: var(--primary); }
.tns-nav-link.active {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: var(--shadow-tile);
}
.tns-nav-link.active i { color: #fff; }
.tns-nav-link .nav-badge {
    margin-left: auto;
    background: var(--secondary);
    color: #fff;
    padding: 1px 8px;
    border-radius: var(--r-pill);
    font-size: 0.7rem;
    font-weight: 700;
}
.tns-nav-link.active .nav-badge { background: rgba(255,255,255,0.25); }

/* ========== Top bar ========== */
.tns-topbar {
    grid-column: 2;
    height: var(--topbar-h);
    background: linear-gradient(90deg, #ffffff 0%, #f5fbf7 100%);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 1015;
    backdrop-filter: blur(8px);
}

.tns-topbar-left { display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 0; }
.tns-topbar-right { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

.tns-topbar-title {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tns-topbar-title .short { display: none; }
@media (max-width: 1199px) {
    .tns-topbar-title .full { display: none; }
    .tns-topbar-title .short { display: inline; font-size: 1.1rem; }
}

.tns-topbar .mobile-toggle { display: none; }

.tns-fy-switcher {
    display: flex; align-items: center; gap: 0.6rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-2);
    padding: 0.4rem 0.9rem;
    color: var(--text-soft);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    flex-shrink: 0;
}
.tns-fy-switcher .fy-short { display: none; }
.tns-fy-switcher:hover { border-color: var(--primary); color: var(--primary); background: rgba(5,150,105,0.05); }
.tns-fy-switcher .fy-label {
    color: var(--text-mute);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.tns-fy-switcher .fy-value {
    color: var(--text);
    font-weight: 700;
}

.tns-icon-btn {
    width: 40px; height: 40px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: var(--r-2);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-soft);
    cursor: pointer;
    position: relative;
    transition: all 0.18s;
}
.tns-icon-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.tns-icon-btn .dot {
    position: absolute; top: 8px; right: 8px;
    width: 7px; height: 7px;
    background: var(--secondary);
    border-radius: 50%;
    border: 2px solid var(--surface);
}

.tns-user {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.35rem 0.85rem 0.35rem 0.45rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    cursor: pointer;
    transition: all 0.18s;
}
.tns-user:hover { border-color: var(--primary-light); }
.tns-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--grad-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}
.tns-user-info { line-height: 1.2; }
.tns-user-info .name { font-weight: 600; font-size: 0.85rem; color: var(--text); }
.tns-user-info .role { font-size: 0.7rem; color: var(--text-mute); }

/* ========== Main ========== */
.tns-main {
    grid-column: 2;
    padding: 1.75rem 2rem 4rem;
    background:
        linear-gradient(180deg, rgba(167, 230, 199, 0.18) 0%, transparent 600px),
        var(--bg);
    min-height: calc(100vh - var(--topbar-h));
}

/* ========== Page header ========== */
.tns-page-head {
    display: flex; flex-wrap: wrap;
    justify-content: space-between; align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.tns-page-head a.text-decoration-none {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-pill);
    color: var(--primary-dark) !important;
    font-weight: 600;
    font-size: 0.82rem;
    transition: all 0.15s;
    box-shadow: var(--shadow-xs);
}
.tns-page-head a.text-decoration-none:hover {
    background: var(--grad-primary);
    color: #ffffff !important;
    border-color: transparent;
    transform: translateX(-2px);
    box-shadow: var(--shadow);
}
.tns-page-head a.text-decoration-none i {
    color: inherit;
    font-size: 0.85em;
}
.tns-page-head h1 {
    font-size: 1.6rem;
    margin-bottom: 0.25rem;
}
.tns-page-head .subtitle {
    color: var(--text-mute);
    font-size: 0.9rem;
}

/* ========== Hero greeting ========== */
.tns-hero {
    background: var(--grad-primary);
    border-radius: var(--r-3);
    padding: 1.5rem 1.75rem;
    color: #fff;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-tile);
}
.tns-hero::after {
    content: "";
    position: absolute; right: -60px; top: -60px;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.tns-hero::before {
    content: "";
    position: absolute; right: 60px; bottom: -90px;
    width: 160px; height: 160px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.tns-hero h1 {
    color: #fff;
    font-size: 1.5rem;
    margin: 0 0 0.4rem 0;
    position: relative; z-index: 1;
}
.tns-hero p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
    position: relative; z-index: 1;
}
.tns-hero .role-pill {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    border-radius: var(--r-pill);
    padding: 0.2rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 600;
    margin-right: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========== Stat tile (gradient with sparkline) ========== */
.tns-stat {
    border-radius: var(--r-3);
    padding: 0.95rem 1.1rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: block;
    border: 1px solid transparent;
}
.tns-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.tns-stat-icon {
    width: 36px; height: 36px;
    border-radius: var(--r-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
    margin-bottom: 0.55rem;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(6px);
}

/* Gradient backgrounds + matching text colors per variant */
.tns-stat.is-primary {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #6ee7b7;
}
.tns-stat.is-primary .tns-stat-icon,
.tns-stat.is-primary .tns-stat-label,
.tns-stat.is-primary .tns-stat-value { color: #065f46; }

.tns-stat.is-green {
    background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%);
    border-color: #5eead4;
}
.tns-stat.is-green .tns-stat-icon,
.tns-stat.is-green .tns-stat-label,
.tns-stat.is-green .tns-stat-value { color: #115e59; }

.tns-stat.is-orange {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    border-color: #fdba74;
}
.tns-stat.is-orange .tns-stat-icon,
.tns-stat.is-orange .tns-stat-label,
.tns-stat.is-orange .tns-stat-value { color: #9a3412; }

.tns-stat.is-rose {
    background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%);
    border-color: #fda4af;
}
.tns-stat.is-rose .tns-stat-icon,
.tns-stat.is-rose .tns-stat-label,
.tns-stat.is-rose .tns-stat-value { color: #9f1239; }

.tns-stat.is-pink {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    border-color: #f9a8d4;
}
.tns-stat.is-pink .tns-stat-icon,
.tns-stat.is-pink .tns-stat-label,
.tns-stat.is-pink .tns-stat-value { color: #9d174d; }

.tns-stat.is-blue {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #93c5fd;
}
.tns-stat.is-blue .tns-stat-icon,
.tns-stat.is-blue .tns-stat-label,
.tns-stat.is-blue .tns-stat-value { color: #1e3a8a; }

.tns-stat.is-cyan {
    background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
    border-color: #67e8f9;
}
.tns-stat.is-cyan .tns-stat-icon,
.tns-stat.is-cyan .tns-stat-label,
.tns-stat.is-cyan .tns-stat-value { color: #155e75; }

.tns-stat.is-purple {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-color: #c4b5fd;
}
.tns-stat.is-purple .tns-stat-icon,
.tns-stat.is-purple .tns-stat-label,
.tns-stat.is-purple .tns-stat-value { color: #5b21b6; }

.tns-stat-label {
    font-size: 0.74rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    letter-spacing: 0.01em;
}
.tns-stat-value {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.45rem;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.tns-stat-foot {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.72rem;
}
.tns-stat-trend {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--r-pill);
    font-weight: 600;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
}

.tns-stat-spark {
    height: 26px; width: 70px;
    flex-shrink: 0;
}

/* ========== Card / Panel ========== */
.tns-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-3);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}
.tns-card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin: -1.25rem -1.4rem 1.25rem;
    padding: 0.95rem 1.4rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: var(--r-3) var(--r-3) 0 0;
}
.tns-card-head .tns-card-title {
    color: #065f46;
}
.tns-card-head .tns-card-title small {
    color: #047857;
    opacity: 0.85;
}
.tns-card-head .tns-card-action a {
    color: #065f46;
    font-weight: 700;
}
.tns-card-head .tns-card-action a:hover {
    color: var(--primary-dark);
}
.tns-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}
.tns-card-title small {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-mute);
    margin-top: 0.15rem;
}
.tns-card-action a {
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 600;
}

/* ========== Activity timeline ========== */
.tns-activity {
    display: flex; gap: 0.9rem;
    padding: 0.9rem 0;
    border-bottom: 1px dashed var(--border);
}
.tns-activity:last-child { border-bottom: none; }
.tns-activity-icon {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    flex-shrink: 0;
    font-size: 0.95rem;
    box-shadow: var(--shadow-xs);
}
.tns-activity-body { flex: 1; }
.tns-activity-title { font-weight: 600; font-size: 0.9rem; margin: 0; }
.tns-activity-meta { font-size: 0.78rem; color: var(--text-mute); margin: 2px 0 0 0; }
.tns-activity-time { font-size: 0.74rem; color: var(--text-mute); white-space: nowrap; }

/* ========== Quick action card ========== */
.tns-quick {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-2);
    padding: 1rem 1.1rem;
    display: flex; align-items: center; gap: 0.9rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.18s;
    height: 100%;
}
.tns-quick:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--text);
}
.tns-quick-icon {
    width: 42px; height: 42px;
    border-radius: var(--r-2);
    background: var(--surface-2);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    transition: all 0.18s;
}
.tns-quick:hover .tns-quick-icon {
    background: var(--grad-primary);
    color: #fff;
}
.tns-quick-body strong {
    display: block;
    font-weight: 600;
    font-size: 0.92rem;
}
.tns-quick-body small {
    color: var(--text-mute);
    font-size: 0.78rem;
}

/* ========== Buttons ========== */
.btn {
    border-radius: var(--r-2);
    padding: 0.5rem 1.1rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-width: 1px;
    transition: all 0.15s;
    font-family: inherit;
}
.btn-primary {
    background: var(--grad-primary); border: none; color: #fff;
    box-shadow: var(--shadow-tile);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); color: #fff; }
.btn-outline-primary {
    background: transparent; color: var(--primary); border-color: var(--primary);
}
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-warning:hover { color: #fff; }
.btn-danger  { background: var(--danger); border-color: var(--danger); }
.btn-light, .btn-secondary {
    background: var(--surface-2); color: var(--text); border-color: var(--border);
}
.btn-light:hover, .btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
.btn-lg { padding: 0.7rem 1.4rem; font-size: 1rem; }

/* ========== Tables ========== */
.table {
    background: var(--surface);
    margin-bottom: 0;
    color: var(--text);
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}
.table thead th {
    background: var(--surface-2);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-mute);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1rem;
    font-weight: 700;
}
.table tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 0.88rem;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table-responsive {
    border-radius: var(--r-3); border: 1px solid var(--border);
    overflow: auto;
    background: var(--surface);
}
.table-responsive .table { border: none; }

/* ========== Badges ========== */
.badge {
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    padding: 0.32em 0.65em;
    border-radius: var(--r-pill);
    border: none;
}
.badge.bg-success, .badge.bg-success-subtle { background: var(--success-bg) !important; color: var(--success-text) !important; }
.badge.bg-warning, .badge.bg-warning-subtle { background: var(--warning-bg) !important; color: var(--warning-text) !important; }
.badge.bg-danger,  .badge.bg-danger-subtle  { background: var(--danger-bg) !important; color: var(--danger-text) !important; }
.badge.bg-info,    .badge.bg-info-subtle    { background: var(--info-bg) !important; color: var(--info-text) !important; }
.badge.bg-primary, .badge.bg-primary-subtle { background: rgba(5,150,105,0.12) !important; color: var(--primary) !important; }
.badge.bg-secondary, .badge.bg-light { background: var(--surface-2) !important; color: var(--text-soft) !important; }

/* ========== Forms ========== */
.form-control, .form-select {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-size: 0.9rem;
    border-radius: var(--r-2);
    padding: 0.55rem 0.85rem;
    transition: all 0.15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(5,150,105,0.12);
}
.form-label { font-weight: 500; font-size: 0.85rem; color: var(--text); margin-bottom: 0.3rem; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* ========== Alerts ========== */
.alert {
    border-radius: var(--r-2);
    border: none;
    padding: 0.85rem 1.1rem;
    font-size: 0.9rem;
}
.alert-warning { background: var(--warning-bg); color: var(--warning-text); }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-danger  { background: var(--danger-bg);  color: var(--danger-text); }
.alert-info    { background: var(--info-bg);    color: var(--info-text); }

/* ========== Bootstrap card override ========== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); box-shadow: var(--shadow-sm); }
.card-header { background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 600; }
.dropdown-menu { border-radius: var(--r-2); border-color: var(--border); box-shadow: var(--shadow); padding: 0.4rem; }
.dropdown-item { border-radius: var(--r-1); padding: 0.45rem 0.7rem; }
.dropdown-item:hover { background: var(--surface-2); }
.breadcrumb { font-size: 0.85rem; }
.breadcrumb-item a { color: var(--primary); }

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ========== Mobile ========== */
@media (max-width: 991px) {
    .tns-app { grid-template-columns: 1fr; }
    .tns-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .tns-sidebar.is-open { transform: translateX(0); }
    .tns-topbar, .tns-main { grid-column: 1; max-width: 100vw; }
    .tns-topbar { padding: 0 0.75rem; gap: 0.4rem; }
    .tns-topbar-left { gap: 0.5rem; min-width: 0; }
    .tns-topbar-right { gap: 0.4rem; }
    .tns-topbar .mobile-toggle {
        display: inline-flex;
        width: 38px; height: 38px;
        border: 1px solid var(--border);
        background: var(--surface-2);
        border-radius: var(--r-2);
        align-items: center; justify-content: center;
        color: var(--text);
        flex-shrink: 0;
    }
    .tns-main { padding: 0.85rem; max-width: 100%; overflow-x: hidden; }
    .tns-main > * { max-width: 100%; }
    .tns-fy-switcher { padding: 0.3rem 0.55rem; gap: 0.35rem; font-size: 0.78rem; }
    .tns-fy-switcher .fy-label { display: none; }
    .tns-fy-switcher .fy-full { display: none; }
    .tns-fy-switcher .fy-short { display: inline; }
    .tns-user-info { display: none; }
    .tns-icon-btn { width: 36px; height: 36px; }

    /* Hero — compact on mobile */
    .tns-hero { padding: 1rem 1.1rem; border-radius: var(--r-2); }
    .tns-hero h1 { font-size: 1.15rem; }
    .tns-hero p { font-size: 0.82rem; }

    /* Page header */
    .tns-page-head h1 { font-size: 1.25rem; }
    .tns-page-head { gap: 0.5rem; margin-bottom: 1rem; }

    /* Stat tiles */
    .tns-stat { padding: 0.85rem 1rem; }
    .tns-stat-value { font-size: 1.35rem; }
    .tns-stat-spark { width: 50px; height: 22px; }

    /* Cards */
    .tns-card { padding: 1rem; border-radius: var(--r-2); }
    .tns-card-head { margin: -1rem -1rem 1rem; padding: 0.75rem 1rem; }
    .tns-card-title { font-size: 0.95rem; }

    /* Filter bar */
    .tns-filter-bar { padding: 0.85rem; }
    .tns-search-box { flex-wrap: wrap; padding: 0.4rem; }
    .tns-search-box input { width: 100%; padding: 0.45rem 0.5rem; }
    .tns-search-box .btn { width: 100%; margin-top: 0.4rem; }
    .tns-filter-row { grid-template-columns: 1fr 1fr; }
    .tns-chip-row { gap: 0.4rem; }
    .tns-chip { font-size: 0.78rem; padding: 0.35rem 0.7rem; }

    /* Active filter pills */
    .tns-active-filters { padding: 0.5rem; }
    .tns-active-pill { font-size: 0.74rem; }

    /* Table - allow horizontal scroll only inside the table wrapper */
    .table-responsive { -webkit-overflow-scrolling: touch; }
    .table thead th, .table tbody td { padding: 0.65rem 0.6rem; font-size: 0.82rem; }

    /* Pagination */
    .tns-table-toolbar { flex-direction: column; align-items: stretch; }
    .tns-pager { justify-content: center; }
    .tns-pagination-nav { flex-wrap: wrap; justify-content: center; }
    .tns-page-btn { min-width: 32px; height: 32px; padding: 0 0.5rem; font-size: 0.8rem; }

    /* Brand area */
    .tns-sidebar-brand { padding: 0.7rem 1rem; }
    .tns-sidebar-brand .brand-logo-wrap { width: 40px; height: 40px; }
    .tns-sidebar-brand .brand-name { font-size: 1.2rem; }
    .tns-sidebar-brand .brand-tag { font-size: 0.55rem; }

    /* Topbar title - already collapses to short */
    .tns-topbar-title { font-size: 0.85rem; letter-spacing: 0.04em; }

    /* Reconciliation tiles */
    .tns-recon-value { font-size: 1.4rem; }
    .tns-recon-tile { padding: 0.85rem 0.95rem; }

    /* Forms */
    .row.g-3 { --bs-gutter-x: 0.5rem; }
}

@media (max-width: 575px) {
    .tns-filter-row { grid-template-columns: 1fr; }
    .tns-page-head { flex-direction: column; align-items: flex-start; }
    .tns-page-head .btn { width: 100%; }

    /* FY switcher: tighter on tiny phones */
    .tns-fy-switcher { padding: 0.28rem 0.5rem; gap: 0.3rem; font-size: 0.72rem; }
    .tns-fy-switcher .fy-icon { font-size: 0.78rem; }
    .tns-fy-switcher .fy-chevron { display: none; }
    /* Topbar title takes priority — hide it instead */
    .tns-topbar-title { display: none; }
    /* Tighter topbar gaps */
    .tns-topbar { padding: 0 0.5rem; gap: 0.3rem; }
    .tns-topbar-right { gap: 0.3rem; }
    .tns-icon-btn { width: 34px; height: 34px; font-size: 0.85rem; }
    .tns-user { padding: 3px 0.4rem 3px 3px; }
    .tns-user-avatar { width: 28px; height: 28px; font-size: 0.78rem; }
}

/* ========== Login (guest) ========== */
.tns-auth {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--grad-primary);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}
.tns-auth::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 15% 25%, rgba(255,255,255,0.16), transparent 35%),
        radial-gradient(circle at 85% 75%, rgba(236,72,153,0.32), transparent 40%);
}
.tns-auth-card {
    background: var(--surface);
    border-radius: var(--r-3);
    padding: 2.5rem 2.25rem;
    width: 100%; max-width: 420px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}
.tns-auth-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}
.tns-auth-logo .logo {
    width: 60px; height: 60px;
    background: var(--grad-primary);
    border-radius: 16px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-tile);
}
.tns-auth-logo h2 { font-size: 1.25rem; margin: 0; }
.tns-auth-logo .meta { font-size: 0.8rem; color: var(--text-mute); margin-top: 0.3rem; }
.tns-auth .lang-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
}
.tns-auth .lang-switch a { color: var(--text-mute); margin: 0 0.4rem; }
.tns-auth .lang-switch a.active { color: var(--primary); font-weight: 600; }

/* ========== Helpers ========== */
.text-mute { color: var(--text-mute); }
.text-soft { color: var(--text-soft); }
.bg-surface { background: var(--surface); }
.shadow-soft { box-shadow: var(--shadow-sm); }
.rounded-tns { border-radius: var(--r-3); }

.tns-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-mute);
}
.tns-empty i { font-size: 2.5rem; opacity: 0.5; margin-bottom: 0.5rem; }

/* ========== Filter bar (search + dropdowns + chips) ========== */
.tns-filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-3);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.tns-search-box {
    display: flex; align-items: center;
    gap: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    padding: 0.25rem 0.25rem 0.25rem 1rem;
    transition: all 0.15s;
    margin-bottom: 1rem;
}
.tns-search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(5,150,105,0.10);
    background: var(--surface);
}
.tns-search-box > i {
    color: var(--text-mute);
    font-size: 0.95rem;
    margin-right: 0.65rem;
}
.tns-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    padding: 0.55rem 0;
    font-size: 0.95rem;
    color: var(--text);
    min-width: 0;
}
.tns-search-box input::placeholder { color: var(--text-mute); }
.tns-search-box .btn {
    border-radius: var(--r-pill);
    padding: 0.5rem 1.4rem;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.tns-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.tns-filter-field { display: flex; flex-direction: column; gap: 0.3rem; }
.tns-filter-field label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-mute);
    margin: 0;
}
.tns-filter-field .form-select {
    border-radius: var(--r-2);
    border-color: var(--border-strong);
    background-color: var(--surface);
    font-weight: 500;
}

.tns-chip-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--border);
}
.tns-chip-label {
    font-size: 0.78rem;
    color: var(--text-mute);
    font-weight: 600;
    margin-right: 0.25rem;
}
.tns-chip {
    display: inline-flex; align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-soft);
    cursor: pointer;
    transition: all 0.15s;
    margin: 0;
}
.tns-chip input { display: none; }
.tns-chip i { font-size: 0.85rem; color: var(--text-mute); }
.tns-chip:hover {
    border-color: var(--primary-light);
    color: var(--text);
}
.tns-chip.active {
    background: rgba(5,150,105,0.10);
    border-color: var(--primary);
    color: var(--primary-dark);
    font-weight: 600;
}
.tns-chip.active i { color: var(--primary); }

.tns-chip-clear {
    display: inline-flex; align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    background: transparent;
    color: var(--danger-text);
    border-radius: var(--r-pill);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}
.tns-chip-clear:hover {
    background: var(--danger-bg);
    color: var(--danger-text);
}

/* ========== Settings category jump chips ========== */
.tns-cat-chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-2);
    color: var(--text-soft);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}
.tns-cat-chip i { color: var(--primary); font-size: 0.95rem; }
.tns-cat-chip .badge {
    background: var(--surface);
    color: var(--text-mute);
    border: 1px solid var(--border);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
}
.tns-cat-chip:hover {
    background: var(--surface);
    border-color: var(--primary);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ========== LM number cell with verification indicator ========== */
.lm-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--r-pill);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.lm-cell .lm-num { font-variant-numeric: tabular-nums; }
.lm-cell.is-verified {
    background: rgba(5, 150, 105, 0.10);
    color: #047857;
    border-color: rgba(5, 150, 105, 0.20);
}
.lm-cell.is-verified i { color: #10b981; font-size: 0.85rem; }
.lm-cell.is-verified:hover {
    background: rgba(5, 150, 105, 0.18);
    color: #065f46;
}
.lm-cell.is-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.30);
}
.lm-cell.is-pending i { color: #d97706; font-size: 0.85rem; }
.lm-cell.is-pending:hover {
    background: rgba(245, 158, 11, 0.20);
    color: #78350f;
}

/* ========== Role badges (matching theme + contrast per role) ========== */
.tns-role-badge {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: var(--r-pill);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}
.tns-role-admin             { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #991b1b; border-color: #fca5a5; }
.tns-role-president         { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #5b21b6; border-color: #c4b5fd; }
.tns-role-general_secretary { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1e3a8a; border-color: #93c5fd; }
.tns-role-general_treasurer { background: linear-gradient(135deg, #cffafe, #a5f3fc); color: #155e75; border-color: #67e8f9; }
.tns-role-kbf_secretary     { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; border-color: #fcd34d; }
.tns-role-kbf_treasurer     { background: linear-gradient(135deg, #ffedd5, #fed7aa); color: #9a3412; border-color: #fdba74; }
.tns-role-branch_secretary  { background: linear-gradient(135deg, #ccfbf1, #99f6e4); color: #115e59; border-color: #5eead4; }
.tns-role-branch_treasurer  { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #065f46; border-color: #6ee7b7; }

/* ========== Compact top toolbar (info + mini pager) ========== */
.tns-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
}
.tns-table-info {
    font-size: 0.88rem;
}
.tns-table-info strong { color: var(--text); font-weight: 700; }

.tns-pager {
    display: inline-flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    padding: 3px;
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}
.tns-pager-btn {
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center; justify-content: center;
    color: var(--text-soft);
    text-decoration: none;
    border-radius: var(--r-pill);
    font-size: 0.78rem;
    transition: all 0.15s;
}
.tns-pager-btn:hover {
    background: var(--surface-2);
    color: var(--primary);
}
.tns-pager-btn.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}
.tns-pager-state {
    padding: 0 0.85rem;
    font-size: 0.82rem;
    color: var(--text-soft);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    margin: 0 0.2rem;
    height: 24px;
    display: inline-flex;
    align-items: center;
}
.tns-pager-state strong { color: var(--text); font-weight: 700; }

/* ========== Bottom rich pagination ========== */
.tns-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 0.5rem 0.25rem 0;
}
.tns-pagination-info {
    font-size: 0.85rem;
    color: var(--text-mute);
}
.tns-pagination-info strong { color: var(--text); font-weight: 700; }

.tns-pagination-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-2);
    padding: 4px;
    box-shadow: var(--shadow-xs);
}
.tns-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 0.7rem;
    display: inline-flex;
    align-items: center; justify-content: center;
    color: var(--text-soft);
    text-decoration: none;
    border-radius: var(--r-1);
    font-size: 0.85rem;
    font-weight: 600;
    gap: 0.4rem;
    transition: all 0.15s;
}
.tns-page-btn:hover {
    background: var(--surface-2);
    color: var(--primary);
}
.tns-page-btn.is-active {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: var(--shadow-tile);
}
.tns-page-btn.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}
.tns-page-ellipsis {
    color: var(--text-mute);
    padding: 0 0.3rem;
    font-weight: 600;
}

@media (max-width: 600px) {
    .tns-pager-state { display: none; }
    .tns-pagination { justify-content: center; }
    .tns-pagination-info { width: 100%; text-align: center; }
}

/* ========== Active filter pills (shown above results) ========== */
.tns-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    background: rgba(5, 150, 105, 0.06);
    border: 1px dashed var(--primary-light);
    border-radius: var(--r-2);
}
.tns-active-label {
    font-size: 0.82rem;
    color: var(--text-soft);
    font-weight: 600;
}
.tns-active-pill {
    display: inline-flex; align-items: center; gap: 0.45rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-pill);
    padding: 0.25rem 0.4rem 0.25rem 0.8rem;
    font-size: 0.78rem;
}
.tns-active-pill strong { font-weight: 700; }
.tns-active-pill a {
    width: 20px; height: 20px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-2);
    border-radius: 50%;
    color: var(--text-mute);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: all 0.15s;
}
.tns-active-pill a:hover {
    background: var(--danger);
    color: #fff;
}

/* ========== Roster bar (clickable inline strip — amber contrast on green theme) ========== */
.tns-roster-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-around;
    gap: 0.5rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fef3c7 100%);
    border: 1px solid #fbbf24;
    border-left: 4px solid #d97706;
    border-radius: var(--r-2);
    padding: 0.85rem 1.5rem;
    box-shadow: 0 2px 10px rgba(217, 119, 6, 0.18);
    position: relative;
}
.tns-roster-bar .tns-roster-item {
    flex: 1;
    justify-content: center;
}
.tns-roster-bar::before {
    content: "MEMBERSHIP";
    position: absolute;
    top: -8px;
    left: 14px;
    background: #d97706;
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    padding: 1px 8px;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(217, 119, 6, 0.30);
}
.tns-roster-bar .tns-roster-item i { color: #92400e; }
.tns-roster-bar .tns-roster-item .lbl { color: #78350f; }
.tns-roster-bar .tns-roster-item .val { color: #451a03; }
.tns-roster-bar .tns-roster-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    padding: 0.25rem 0.6rem;
    border-radius: var(--r-1);
    transition: all 0.15s;
}
.tns-roster-bar .tns-roster-item:hover {
    background: rgba(255, 255, 255, 0.75);
    color: #451a03;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.20);
}
.tns-roster-bar .tns-roster-item i {
    color: var(--primary);
    font-size: 0.95rem;
}
.tns-roster-bar .tns-roster-item .lbl {
    font-size: 0.82rem;
    color: var(--text-soft);
    font-weight: 500;
}
.tns-roster-bar .tns-roster-item .val {
    font-weight: 800;
    font-size: 1rem;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.tns-roster-bar .divider {
    width: 1px;
    height: 26px;
    background: rgba(217, 119, 6, 0.30);
    margin: 0 0.4rem;
}
@media (max-width: 575px) {
    .tns-roster-bar { flex-direction: column; align-items: stretch; gap: 0.3rem; }
    .tns-roster-bar .divider { display: none; }
    .tns-roster-bar .tns-roster-item { justify-content: space-between; }
}

/* ========== Receipt ID display (large prominent receipt number) ========== */
.tns-receipt-id {
    display: inline-block;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    border-radius: var(--r-2);
    padding: 0.6rem 1rem;
    box-shadow: var(--shadow-sm);
}
.tns-receipt-id .rid-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #047857;
    margin-bottom: 0.15rem;
}
.tns-receipt-id .rid-value {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    color: #065f46;
    letter-spacing: 0.04em;
    line-height: 1;
}
@media (max-width: 575px) {
    .tns-receipt-id .rid-value { font-size: 1.15rem; word-break: break-all; }
}

/* ========== Reconciliation summary tiles (gradient backgrounds, clickable) ========== */
.tns-recon-tile {
    border-radius: var(--r-3);
    padding: 1.1rem 1.25rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    text-decoration: none;
    display: block;
    cursor: pointer;
}
.tns-recon-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.tns-recon-tile.is-active {
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.30), var(--shadow);
    transform: translateY(-2px);
}
.tns-recon-icon {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(4px);
}
.tns-recon-label {
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}
.tns-recon-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

/* Color variants */
.tns-recon-tile.is-warn {
    background: linear-gradient(135deg, #fef9c3 0%, #fde68a 100%);
    border-color: #fcd34d;
}
.tns-recon-tile.is-warn .tns-recon-label,
.tns-recon-tile.is-warn .tns-recon-value { color: #92400e; }
.tns-recon-tile.is-warn .tns-recon-icon { color: #b45309; }

.tns-recon-tile.is-rose {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #fca5a5;
}
.tns-recon-tile.is-rose .tns-recon-label,
.tns-recon-tile.is-rose .tns-recon-value { color: #991b1b; }
.tns-recon-tile.is-rose .tns-recon-icon { color: #b91c1c; }

.tns-recon-tile.is-good {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #6ee7b7;
}
.tns-recon-tile.is-good .tns-recon-label,
.tns-recon-tile.is-good .tns-recon-value { color: #065f46; }
.tns-recon-tile.is-good .tns-recon-icon { color: #047857; }

.tns-recon-tile.is-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #93c5fd;
}
.tns-recon-tile.is-info .tns-recon-label,
.tns-recon-tile.is-info .tns-recon-value { color: #1e3a8a; }
.tns-recon-tile.is-info .tns-recon-icon { color: #1d4ed8; }
