/*
 * INDIAN ENTERPRISES — premium theme layer.
 * Loaded after erp.css; re-skins the same class names (no markup contract changes).
 */

:root {
    --ink-950: #070b16;
    --ink-900: #0c1324;
    --ink-800: #141d34;
    --ink-700: #1f2a47;
    --gold: #d6a74a;
    --gold-soft: #f3dfae;
    --primary: #4338ca;
    --primary-600: #3730a3;
    --primary-50: #eef2ff;
    --accent: #0ea5e9;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --page: #f4f5fa;
    --surface: #ffffff;
    --surface-soft: #f8f9fc;
    --line: #e7e9f2;
    --text: #0f1729;
    --muted: #6b7390;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -6px rgba(16, 24, 40, .08);
    --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .18);
    --sidebar: var(--ink-900);
    --sidebar-strong: var(--ink-950);
    --sidebar-link: #aab3cf;

    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-primary: #4338ca;
    --bs-primary-rgb: 67, 56, 202;
    --bs-link-color: #4338ca;
    --bs-link-hover-color: #3730a3;
    --bs-link-color-rgb: 67, 56, 202;
    --bs-border-radius: 10px;
}

body {
    font-family: var(--bs-body-font-family);
    background:
        radial-gradient(1200px 400px at 100% -10%, rgba(67, 56, 202, .06), transparent 60%),
        var(--page);
    color: var(--text);
    font-feature-settings: "cv11", "ss01";
}

/* ---------- Buttons & forms ---------- */

.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    letter-spacing: .01em;
    transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-600);
    --bs-btn-hover-border-color: var(--primary-600);
    --bs-btn-active-bg: var(--primary-600);
    --bs-btn-active-border-color: var(--primary-600);
    --bs-btn-disabled-bg: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0));
    box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 6px 14px -4px rgba(67, 56, 202, .45);
}

.btn-outline-primary {
    --bs-btn-color: var(--primary);
    --bs-btn-border-color: #c7cbf5;
    --bs-btn-hover-bg: var(--primary-50);
    --bs-btn-hover-color: var(--primary-600);
    --bs-btn-hover-border-color: #a5acef;
    --bs-btn-active-bg: var(--primary-50);
    --bs-btn-active-color: var(--primary-600);
    --bs-btn-active-border-color: #a5acef;
}

.btn-outline-secondary {
    --bs-btn-color: #3b4460;
    --bs-btn-border-color: var(--line);
    --bs-btn-hover-bg: var(--surface-soft);
    --bs-btn-hover-color: var(--text);
    --bs-btn-hover-border-color: #d5d9e6;
    background: #fff;
}

.btn-dark {
    --bs-btn-bg: var(--ink-900);
    --bs-btn-border-color: var(--ink-900);
    --bs-btn-hover-bg: var(--ink-700);
    --bs-btn-hover-border-color: var(--ink-700);
}

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border-color: #dfe2ec;
    background-color: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control:hover,
.form-select:hover {
    border-color: #c9cddc;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(67, 56, 202, .55);
    box-shadow: 0 0 0 4px rgba(67, 56, 202, .12);
}

.form-label {
    font-weight: 600;
    font-size: 13px;
    color: #3b4460;
    margin-bottom: 6px;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.badge {
    font-weight: 600;
    border-radius: 999px;
    padding: .38em .7em;
}

.alert {
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.alert-info {
    background: var(--primary-50);
    color: #312e81;
    border-left: 4px solid var(--primary);
}

/* ---------- Sidebar ---------- */

.app-shell {
    grid-template-columns: 276px minmax(0, 1fr);
}

.sidebar {
    display: flex;
    flex-direction: column;
    padding: 18px 14px 14px;
    background:
        radial-gradient(420px 220px at 0% 0%, rgba(214, 167, 74, .12), transparent 60%),
        linear-gradient(180deg, var(--ink-900) 0%, var(--ink-950) 100%);
    border-right: 1px solid rgba(255, 255, 255, .04);
    scrollbar-color: rgba(255, 255, 255, .15) transparent;
}

.brand {
    padding: 4px 6px 18px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brand-link {
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #f3dfae 0%, #d6a74a 55%, #a87a26 100%);
    color: var(--ink-950);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .02em;
    box-shadow: 0 8px 20px -6px rgba(214, 167, 74, .6), inset 0 1px 0 rgba(255, 255, 255, .5);
}

.brand-text {
    display: grid;
    min-width: 0;
    line-height: 1.15;
}

.brand-text strong {
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: .04em;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-text small {
    font-size: 11px;
    font-weight: 500;
    color: var(--gold-soft);
    opacity: .8;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.sidebar .nav {
    flex: 1;
    gap: 2px;
}

.nav-section-label {
    margin: 16px 10px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #5d6788;
}

.nav-section-label:first-child {
    margin-top: 8px;
}

.sidebar .nav-link {
    position: relative;
    gap: 12px;
    padding: 9px 12px;
    min-height: 40px;
    border-radius: 10px;
    color: var(--sidebar-link);
    font-weight: 500;
    font-size: 13.5px;
    transition: background-color .15s ease, color .15s ease;
}

.sidebar .nav-link i {
    width: 18px;
    font-size: 14px;
    color: #6f7a9c;
    transition: color .15s ease;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .05);
    color: #fff;
}

.sidebar .nav-link:hover i {
    color: #c9d0e6;
}

.sidebar .nav-link.active {
    background: linear-gradient(90deg, rgba(214, 167, 74, .16) 0%, rgba(214, 167, 74, .04) 100%);
    color: #fff;
    font-weight: 600;
}

.sidebar .nav-link.active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--gold);
    box-shadow: 0 0 12px rgba(214, 167, 74, .7);
}

.sidebar .nav-link.active i {
    color: var(--gold);
}

.sidebar-user-panel {
    margin-top: 14px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
}

.sidebar-user-link {
    gap: 10px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .08);
}

.sidebar-user-meta {
    display: grid;
    min-width: 0;
    line-height: 1.2;
}

.sidebar-user-meta span {
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-meta small {
    color: #7b86a8;
    font-size: 11.5px;
    font-weight: 500;
}

.sidebar-user-panel .icon-btn {
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .08);
    color: #c9d0e6;
}

.sidebar-user-panel .icon-btn:hover {
    background: rgba(220, 38, 38, .18);
    border-color: rgba(220, 38, 38, .35);
    color: #fff;
}

/* ---------- Top navbar ---------- */

.main {
    padding: 24px 28px;
}

.desktop-navbar {
    margin: -24px -28px 26px;
    padding: 12px 28px;
    background: rgba(255, 255, 255, .78);
    border-bottom: 1px solid rgba(231, 233, 242, .9);
    box-shadow: 0 1px 0 rgba(16, 24, 40, .02);
    backdrop-filter: saturate(160%) blur(16px);
}

.navbar-company-icon {
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5, #3730a3);
    box-shadow: 0 8px 18px -6px rgba(67, 56, 202, .55);
}

.navbar-company strong {
    letter-spacing: .02em;
}

.desktop-action-link {
    border-radius: 999px;
    border-color: var(--line);
    background: #fff;
    color: #3b4460;
    font-weight: 600;
    font-size: 13px;
    padding: 0 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    transition: all .15s ease;
}

.desktop-action-link i {
    color: var(--primary);
}

.desktop-action-link:hover {
    border-color: #c7cbf5;
    background: var(--primary-50);
    color: var(--primary-600);
    transform: translateY(-1px);
}

.financial-year-form .form-select {
    border-radius: 999px;
    font-weight: 700;
    background-color: var(--surface-soft);
}

.navbar-tools .btn {
    border-radius: 999px;
}

.profile-button {
    padding-left: 5px;
}

.profile-button .user-avatar {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
    font-size: 11px;
    box-shadow: none;
}

/* ---------- Page header ---------- */

.topbar {
    align-items: flex-end;
    margin-bottom: 22px;
}

.topbar-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--primary);
}

.topbar-eyebrow::before {
    content: "";
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--gold);
}

.topbar h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.topbar p {
    margin-top: 4px;
    font-size: 14px;
}

.topbar-date {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.topbar-date i {
    color: var(--gold);
}

/* ---------- Panels, cards, tables ---------- */

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.panel-header {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.01em;
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.panel-toolbar h5,
.panel-header h5,
.panel-header h6 {
    font-weight: 700;
    letter-spacing: -.01em;
}

.metric-grid {
    gap: 16px;
}

.metric-card {
    position: relative;
    overflow: hidden;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas:
        "icon label"
        "icon value";
    column-gap: 14px;
    row-gap: 2px;
    align-items: center;
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.metric-card::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--tone-bg, var(--primary-50));
    opacity: .55;
    pointer-events: none;
}

.metric-card i {
    grid-area: icon;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    font-size: 18px;
    color: var(--tone, var(--primary));
    background: var(--tone-bg, var(--primary-50));
}

.metric-card span {
    grid-area: label;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .02em;
}

.metric-card strong {
    grid-area: value;
    position: relative;
    z-index: 1;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.metric-card:nth-child(8n+1) { --tone: #4338ca; --tone-bg: #eef2ff; }
.metric-card:nth-child(8n+2) { --tone: #0284c7; --tone-bg: #e0f2fe; }
.metric-card:nth-child(8n+3) { --tone: #7c3aed; --tone-bg: #f3e8ff; }
.metric-card:nth-child(8n+4) { --tone: #e11d48; --tone-bg: #ffe4e6; }
.metric-card:nth-child(8n+5) { --tone: #059669; --tone-bg: #d1fae5; }
.metric-card:nth-child(8n+6) { --tone: #b7791f; --tone-bg: #fdf3dc; }
.metric-card:nth-child(8n+7) { --tone: #d97706; --tone-bg: #fef3c7; }
.metric-card:nth-child(8n+8) { --tone: #475569; --tone-bg: #e2e8f0; }

.table {
    --bs-table-hover-bg: #f7f8fd;
    --bs-table-striped-bg: #fafbfe;
}

.table > :not(caption) > * > * {
    padding: .7rem .75rem;
    border-bottom-color: #eef0f6;
}

.table thead th,
.table th {
    background: var(--surface-soft);
    color: #58617f;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.table-sm > :not(caption) > * > * {
    padding: .55rem .5rem;
}

.table td {
    font-variant-numeric: tabular-nums;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border-radius: 999px;
    padding-left: 14px;
}

.page-link {
    border-radius: 8px !important;
    border-color: var(--line);
    color: #3b4460;
    font-weight: 600;
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

.modal-content {
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
}

.modal-header,
.modal-footer {
    background: #fff;
    border-color: var(--line);
}

.modal-header {
    padding: 18px 22px;
}

.modal-backdrop.show {
    opacity: .45;
    backdrop-filter: blur(2px);
}

/* ---------- Footer ---------- */

.app-footer {
    margin-top: auto;
    padding-top: 28px;
    border-top: 1px solid var(--line);
    margin-top: 32px;
}

.footer-brand strong {
    letter-spacing: .04em;
}

.footer-links a {
    color: #58617f;
    font-weight: 600;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-meta i {
    color: var(--success);
}

/* ---------- Auth ---------- */

.auth-body {
    background:
        radial-gradient(600px 400px at 15% 10%, rgba(214, 167, 74, .18), transparent 60%),
        radial-gradient(700px 500px at 90% 90%, rgba(67, 56, 202, .35), transparent 60%),
        linear-gradient(135deg, var(--ink-900) 0%, var(--ink-950) 100%);
}

.auth-shell {
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .55);
}

.auth-showcase {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: 40px;
    color: #fff;
    background:
        radial-gradient(420px 260px at 0% 0%, rgba(214, 167, 74, .28), transparent 60%),
        radial-gradient(420px 320px at 100% 100%, rgba(99, 102, 241, .45), transparent 60%),
        var(--ink-900);
}

.auth-showcase .brand-mark {
    width: 52px;
    height: 52px;
    font-size: 18px;
    border-radius: 14px;
}

.auth-showcase h2 {
    margin: 18px 0 10px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.auth-showcase p {
    margin: 0;
    color: #aab3cf;
    font-size: 14.5px;
}

.auth-feature-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #d5daea;
    font-size: 13.5px;
    font-weight: 500;
}

.auth-feature-list i {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, .07);
    color: var(--gold);
}

.auth-form-side {
    padding: 44px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-side h1 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.auth-form-side .auth-lead {
    margin: 0 0 26px;
    color: var(--muted);
}

.auth-form-side .form-control {
    min-height: 46px;
}

.auth-form-side .btn-primary {
    min-height: 46px;
}

.input-icon {
    position: relative;
}

.input-icon > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa2bd;
    pointer-events: none;
}

.input-icon > .form-control {
    padding-left: 40px;
}

.auth-panel {
    border-radius: 20px;
    border: 0;
    padding: 32px;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .55);
}

.auth-brand {
    font-weight: 800;
    letter-spacing: -.01em;
}

/* ---------- Mobile ---------- */

@media (max-width: 992px) {
    .main {
        padding: 16px;
    }

    .mobile-appbar {
        background: rgba(255, 255, 255, .85);
        backdrop-filter: saturate(160%) blur(16px);
    }

    .mobile-brand {
        font-weight: 800;
        letter-spacing: .04em;
    }

    .mobile-brand .brand-mark {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
        font-size: 11px;
        border-radius: 9px;
    }

    .sidebar .nav-link.active::before {
        left: -14px;
    }

    .bottom-nav {
        background: rgba(255, 255, 255, .92);
        backdrop-filter: saturate(160%) blur(16px);
    }

    .bottom-nav-link.active,
    .bottom-nav-link:hover {
        color: var(--primary);
        background: transparent;
    }

    .bottom-nav-link.active i {
        background: linear-gradient(135deg, #4f46e5, #3730a3);
        border-radius: 12px;
        box-shadow: 0 8px 18px -6px rgba(67, 56, 202, .6);
    }

    .topbar-date {
        display: none;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-showcase {
        padding: 28px;
        gap: 18px;
    }

    .auth-feature-list {
        display: none;
    }
}

@media (max-width: 576px) {
    .panel {
        padding: 14px;
        border-radius: 12px;
    }

    .topbar h1 {
        font-size: 21px;
    }

    .metric-card {
        grid-template-columns: 40px minmax(0, 1fr);
        grid-template-areas:
            "icon label"
            "icon value";
    }

    .metric-card strong {
        grid-column: auto;
        font-size: 19px;
    }

    .metric-card i {
        width: 40px;
        height: 40px;
    }

    .auth-body {
        padding: 0;
    }

    .auth-shell {
        border-radius: 0;
        min-height: 100dvh;
    }

    .auth-form-side {
        padding: 28px 22px;
    }
}

@media print {
    body {
        background: #fff;
    }

    .panel,
    .metric-card {
        box-shadow: none;
    }
}
