:root {
    --teal: #0D9488;
    --teal-dark: #0F766E;
    --teal-soft: #E6F6F4;
    --navy: #0B1B2B;
    --ink: #0F172A;
    --muted: #64748B;
    --line: #E2E8F0;
    --bg: #F4F7FA;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--bg);
    --bs-primary: var(--teal);
    --bs-primary-rgb: 13, 148, 136;
    --bs-link-color: var(--teal-dark);
    --bs-link-color-rgb: 15, 118, 110;
    --bs-link-hover-color: var(--teal);
    --bs-border-color: var(--line);
    --bs-border-radius: .6rem;
}

body { font-size: .925rem; -webkit-font-smoothing: antialiased; }
.text-teal { color: var(--teal-dark) !important; }

/* Buttons & inputs */
.btn { font-weight: 500; border-radius: .55rem; }
.btn-primary { --bs-btn-bg: var(--teal); --bs-btn-border-color: var(--teal); --bs-btn-hover-bg: var(--teal-dark); --bs-btn-hover-border-color: var(--teal-dark); --bs-btn-active-bg: #115E59; --bs-btn-active-border-color: #115E59; --bs-btn-disabled-bg: var(--teal); --bs-btn-disabled-border-color: var(--teal); }
.btn-light { --bs-btn-bg: #fff; --bs-btn-hover-bg: #F1F5F9; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); border: 0; border-radius: .5rem; background: transparent; }
.btn-icon:hover { background: #F1F5F9; color: var(--ink); }
.form-control, .form-select, .input-group-text { border-color: #D7DEE7; border-radius: .55rem; }
.form-control:focus, .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 .2rem rgba(13, 148, 136, .15); }
.form-label { font-weight: 500; font-size: .85rem; margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--teal); border-color: var(--teal); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(13, 148, 136, .15); border-color: var(--teal); }
.toggle-switch { width: 2.6em !important; height: 1.35em; cursor: pointer; }
.form-switch .toggle-switch:not(:checked) { background-color: #FEE2E2; border-color: #FCA5A5; }

/* Layout */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 250px; background: linear-gradient(180deg, #0B2533 0%, var(--navy) 100%); display: flex; flex-direction: column; z-index: 1040; transition: transform .2s; }
.sidebar-brand { display: flex; gap: .75rem; align-items: center; padding: 1.4rem 1.25rem; }
.sidebar-muted { color: #7FA0B0; }
.sidebar-nav { padding: .5rem .75rem; flex: 1; }
.sidebar-nav a { display: flex; align-items: center; gap: .7rem; color: #B7CAD4; text-decoration: none; padding: .62rem .85rem; border-radius: .55rem; margin-bottom: .2rem; font-weight: 500; }
.sidebar-nav a i { font-size: 1.05rem; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-nav a.active { background: rgba(20, 184, 166, .16); color: #5EEAD4; }
.sidebar-foot { padding: 1rem 1.25rem; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-icon { color: #B7CAD4; font-size: 1.15rem; }
.sidebar-icon:hover { color: #fff; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
.brand-mark { width: 54px; height: 54px; border-radius: 15px; background: linear-gradient(135deg, #14B8A6, var(--teal-dark)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; box-shadow: 0 8px 20px rgba(13, 148, 136, .3); }
.brand-mark.sm { width: 38px; height: 38px; border-radius: 11px; font-size: 1.05rem; box-shadow: none; }
.main { margin-left: 250px; min-height: 100vh; }
.topbar { display: flex; align-items: center; padding: 1.25rem 2rem; background: rgba(244, 247, 250, .85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 1020; }
.content { padding: 0 2rem 2rem; }
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    .main { margin-left: 0; }
    .topbar, .content { padding-left: 1rem; padding-right: 1rem; }
    #topActions .btn { padding: .35rem .6rem; font-size: .85rem; }
}

/* Cards */
.card { border: 1px solid var(--line); border-radius: .9rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.stat-card { display: flex; gap: .9rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: .9rem; padding: 1rem 1.1rem; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s, border-color .15s; height: 100%; }
.stat-card:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, .07); transform: translateY(-1px); border-color: #CBD5E1; color: inherit; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.stat-icon.teal { background: var(--teal-soft); color: var(--teal-dark); }
.stat-icon.amber { background: #FEF3C7; color: #B45309; }
.stat-icon.orange { background: #FFEDD5; color: #C2410C; }
.stat-icon.red { background: #FEE2E2; color: #B91C1C; }
.stat-icon.slate { background: #F1F5F9; color: #475569; }
.stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .8rem; }

.expiring-list { display: flex; flex-direction: column; }
.expiring-item { display: flex; justify-content: space-between; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.expiring-item:last-child { border-bottom: 0; }
.empty-mini { text-align: center; color: var(--muted); padding: 2.5rem 0; }
.empty-mini i { font-size: 1.8rem; display: block; margin-bottom: .4rem; color: #CBD5E1; }
.empty-state { text-align: center; padding: 3.5rem 1rem; }
.empty-icon { width: 70px; height: 70px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-dark); font-size: 1.8rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }

/* Filter tabs */
.filter-tabs { background: #F1F5F9; border-radius: .6rem; padding: 3px; flex-wrap: wrap; }
.filter-tabs .btn { border: 0; border-radius: .5rem !important; color: var(--muted); font-size: .85rem; padding: .35rem .8rem; }
.filter-tabs .btn span { background: #E2E8F0; color: #475569; border-radius: 99px; padding: 0 .45rem; font-size: .72rem; margin-left: .25rem; }
.filter-tabs .btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }
.filter-tabs .btn.active span { background: var(--teal-soft); color: var(--teal-dark); }

/* Table */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { border-color: #EEF2F6; padding-top: .7rem; padding-bottom: .7rem; }
.table tbody tr:hover td { background: #FAFCFD; }
.license-key { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; color: var(--ink); background: #F1F5F9; padding: .2rem .45rem; border-radius: .35rem; font-size: .8rem; white-space: nowrap; }
div.dt-container .dt-search input { border-radius: .55rem; min-width: 240px; }
div.dt-container .dt-length select { border-radius: .55rem; }
div.dt-container .pagination .page-link { border-radius: .45rem; margin: 0 2px; border: 0; color: var(--ink); }
div.dt-container .pagination .active .page-link { background: var(--teal); color: #fff; }
.dropdown-menu { border-color: var(--line); border-radius: .7rem; padding: .35rem; font-size: .88rem; }
.dropdown-item { border-radius: .45rem; padding: .45rem .7rem; }

/* Badges */
.badge-soft { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; padding: .28rem .6rem; border-radius: 99px; white-space: nowrap; }
.badge-soft.success { background: #DCFCE7; color: #15803D; }
.badge-soft.warning { background: #FEF3C7; color: #B45309; }
.badge-soft.danger { background: #FEE2E2; color: #B91C1C; }
.badge-soft.info { background: #E0F2FE; color: #0369A1; }
.badge-soft.muted { background: #F1F5F9; color: #475569; }

/* Modal */
.modal-content { border: 0; border-radius: 1rem; box-shadow: 0 25px 60px rgba(15, 23, 42, .25); }
.modal-header, .modal-footer { border-color: var(--line); padding: 1.1rem 1.5rem; }
.modal-body { padding: 1.3rem 1.5rem; }
.quick-dates { display: flex; gap: .35rem; flex-wrap: wrap; }
.quick-dates .btn { background: #F1F5F9; color: #334155; font-size: .78rem; padding: .2rem .6rem; border-radius: 99px; }
.quick-dates .btn:hover { background: var(--teal-soft); color: var(--teal-dark); }

/* Login / installer */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: radial-gradient(circle at 15% 10%, #CCFBF1 0, transparent 40%), radial-gradient(circle at 85% 90%, #DBEAFE 0, transparent 40%), var(--bg); }
.auth-wrap { width: 100%; max-width: 440px; }
.auth-card { border-radius: 1.2rem; box-shadow: 0 20px 50px rgba(15, 23, 42, .08); }
.step-title { font-weight: 700; margin-bottom: .5rem; display: flex; align-items: center; gap: .6rem; }
.step-title span { width: 26px; height: 26px; border-radius: 50%; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.success-tick { width: 64px; height: 64px; border-radius: 50%; background: #DCFCE7; color: #15803D; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.cred-box { background: #F8FAFC; border: 1px solid var(--line); border-radius: .8rem; padding: 1rem 1.2rem; }

/* SweetAlert */
.swal2-popup { border-radius: 1rem !important; font-family: inherit !important; }
.swal2-styled.swal2-confirm { background: var(--teal) !important; border-radius: .55rem !important; }
.swal2-styled.swal2-cancel { border-radius: .55rem !important; }
.key-result { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; font-weight: 600; background: #F1F5F9; border-radius: .6rem; padding: .8rem; letter-spacing: .03em; user-select: all; }
