/* ==========================================================================
   RBS Nidhi admin panel. Loaded after Bootstrap 3.4.1 (grid, modals, dropdowns, tabs and the
   DataTables integration still come from Bootstrap); everything visual lives here.
   Accent colours are the website's (assets/css/rbs.css): magenta #93278f → violet #673f98.
   ========================================================================== */

@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --brand: #93278f;
    --brand-2: #673f98;
    --brand-dark: #7a1f77;
    --brand-soft: #f6edf7;
    --brand-ring: rgba(147, 39, 143, .16);
    --grad-brand: linear-gradient(135deg, #a72fa1 0%, #93278f 38%, #673f98 100%);
    --ink: #160a22;
    --text: #1d1326;
    --muted: #6c6278;
    --faint: #968ca3;
    --bg: #f7f5fa;
    --surface: #fff;
    --surface-2: #faf8fc;
    --hover: #f5f1f8;
    --line: rgba(29, 19, 38, .08);
    --line-strong: rgba(29, 19, 38, .15);
    --success: #1f9d6b;
    --success-soft: #e6f5ee;
    --success-ink: #126a47;
    --warning: #c27c0e;
    --warning-soft: #fcf1de;
    --warning-ink: #8a5600;
    --danger: #d0384a;
    --danger-soft: #fcebed;
    --danger-ink: #a51f30;
    --info: #2654e0;
    --info-soft: #e9effd;
    --info-ink: #1b3fae;
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(22, 10, 34, .04), 0 1px 3px rgba(22, 10, 34, .04);
    --shadow-md: 0 12px 32px -14px rgba(22, 10, 34, .2);
    --shadow-lg: 0 30px 70px -30px rgba(22, 10, 34, .45);
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --sidebar-w: 264px;
    --topbar-h: 68px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- base */
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: var(--font); color: var(--text); letter-spacing: -.01em; }
a { color: var(--brand); }
a:hover, a:focus { color: var(--brand-dark); }
::selection { background: rgba(147, 39, 143, .18); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
a:focus, button:focus, .btn:focus, .btn:active:focus { outline: none; }
a:focus-visible, button:focus-visible, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
code { color: var(--brand-dark); background: var(--brand-soft); border-radius: 6px; }
.text-muted { color: var(--muted); }
.ico { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 2000; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--ink); color: #fff; font-weight: 600; }
.skip-link:focus { top: 12px; color: #fff; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--hover); }
.icon-btn .ico { width: 20px; height: 20px; }

/* ---------- layout: sidebar + top bar + content */
.sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1030;
    display: flex; flex-direction: column;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--line);
}
.sidebar__brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 76px; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand:hover, .brand:focus { color: var(--text); text-decoration: none; }
.brand img { width: auto; height: 44px; }
.brand__text { display: grid; line-height: 1.2; padding-left: 12px; border-left: 1px solid var(--line-strong); }
.brand__text strong { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.brand__text small { font-size: 12px; font-weight: 500; color: var(--muted); }
.sidebar__close { display: none; }
.sidebar__nav { flex: 1; overflow-y: auto; padding: 4px 14px 20px; }
.nav-group { margin: 18px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.menu a {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--muted); font-weight: 600; font-size: 14px;
    text-decoration: none;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.menu a:hover, .menu a:focus { background: var(--hover); color: var(--text); text-decoration: none; }
.menu .active a { background: var(--brand-soft); color: var(--brand); }
.menu .active a::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad-brand); }
.sidebar__foot { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.sidebar__foot .ico { width: 16px; height: 16px; color: var(--success); }
.nav-backdrop { display: none; }

.app-main { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: 16px;
    height: var(--topbar-h);
    padding: 0 32px;
    background: rgba(247, 245, 250, .86);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
}
.topbar__menu { display: none; }
.topbar__title { flex: 1; min-width: 0; margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__right { display: flex; align-items: center; gap: 12px; }
.topbar__date { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.topbar__date .ico { width: 16px; height: 16px; }
.usermenu__btn { display: flex; align-items: center; gap: 10px; height: 44px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); text-align: left; cursor: pointer; }
.usermenu__btn:hover, .open > .usermenu__btn { background: var(--hover); }
.avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--grad-brand); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.usermenu__who { display: grid; line-height: 1.25; }
.usermenu__who strong { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.usermenu__who small { font-size: 11.5px; color: var(--muted); }
.usermenu__caret { width: 16px; height: 16px; color: var(--faint); }
.usermenu .dropdown-menu { min-width: 240px; margin-top: 8px; }
.usermenu .dropdown-header { display: grid; padding: 8px 12px 10px; font-size: 12px; color: var(--muted); white-space: normal; word-break: break-all; }
.usermenu .dropdown-header strong { font-size: 14px; color: var(--text); word-break: normal; }
.content { padding: 28px 32px 48px; }

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s var(--ease), box-shadow .25s; }
    .nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    .sidebar__close { display: inline-flex; }
    .nav-backdrop { position: fixed; inset: 0; z-index: 1025; background: rgba(22, 10, 34, .42); }
    .nav-open .nav-backdrop { display: block; }
    .nav-open { overflow: hidden; }
    .app-main { margin-left: 0; }
    .topbar__menu { display: inline-flex; }
}
@media (max-width: 767px) {
    .topbar { gap: 10px; padding: 0 16px; }
    .topbar__title { font-size: 17px; }
    .topbar__date, .usermenu__who, .usermenu__caret { display: none; }
    .usermenu__btn { padding: 4px; }
    .content { padding: 18px 16px 40px; }
    .form-control { font-size: 16px; } /* no zoom-in on iOS */
}

/* ---------- Bootstrap components */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600; font-size: 14px; line-height: 1.4;
    transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), color .15s var(--ease);
}
.btn .ico { width: 16px; height: 16px; }
.btn-xs { padding: 3px 9px; border-radius: 7px; font-size: 12px; gap: 4px; }
.btn-sm { padding: 6px 12px; border-radius: 8px; font-size: 13px; }
.btn-lg { padding: 12px 20px; border-radius: 12px; font-size: 15px; }
.btn-block { display: flex; width: 100%; }
.btn-primary, .btn-primary:focus { border: 0; color: #fff; background: var(--grad-brand); box-shadow: 0 6px 16px -8px rgba(147, 39, 143, .7), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn-primary:hover, .btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary, .btn-primary:active:hover, .btn-primary:active:focus {
    color: #fff; background: linear-gradient(135deg, #95268f 0%, #7d1f79 40%, #573283 100%); box-shadow: 0 10px 22px -10px rgba(147, 39, 143, .8);
}
.btn-primary.disabled, .btn-primary[disabled], .btn-primary[disabled]:hover { background: var(--grad-brand); opacity: .6; }
.btn-xs.btn-primary { box-shadow: none; }
.btn-default { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
.btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active { border-color: var(--line-strong); background: var(--hover); color: var(--text); }
.btn-success, .btn-danger, .btn-warning, .btn-info { border: 1px solid transparent; }
.btn-success, .btn-success:focus { background: var(--success-soft); color: var(--success-ink); }
.btn-success:hover, .btn-success:active, .btn-success:active:hover { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger, .btn-danger:focus { background: var(--danger-soft); color: var(--danger-ink); }
.btn-danger:hover, .btn-danger:active, .btn-danger:active:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-warning, .btn-warning:focus { background: var(--warning-soft); color: var(--warning-ink); }
.btn-warning:hover, .btn-warning:active, .btn-warning:active:hover { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-info, .btn-info:focus { background: var(--info-soft); color: var(--info-ink); }
.btn-info:hover, .btn-info:active, .btn-info:active:hover { background: var(--info); border-color: var(--info); color: #fff; }
.btn-link { color: var(--brand); font-weight: 600; }
.btn-link:hover, .btn-link:focus { color: var(--brand-dark); }

label { margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.form-group { margin-bottom: 16px; }
.form-control {
    height: 42px;
    padding: 9px 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background-color: var(--surface);
    color: var(--text);
    font-size: 14px;
    box-shadow: none;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.form-control::placeholder { color: var(--faint); }
.form-control:hover { border-color: rgba(29, 19, 38, .25); }
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
textarea.form-control { height: auto; }
select.form-control {
    padding-right: 36px;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c6278' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
select.form-control[multiple] { padding-right: 13px; background-image: none; }
.input-sm, select.input-sm { height: 32px; padding: 4px 10px; border-radius: 8px; font-size: 13px; }
select.input-sm { padding-right: 30px; background-position: right 8px center; }
.help-block { color: var(--muted); font-size: 12.5px; }
.form-control[readonly], .form-control[disabled] { background-color: var(--surface-2); }
.checkbox label, .radio label { font-weight: 500; }

.panel { margin-bottom: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-default > .panel-heading, .panel-heading {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: transparent; color: var(--text); font-weight: 700;
}
.panel-body { padding: 20px; }
.panel-body > .row:first-child { margin-bottom: 6px; }

.table { margin-bottom: 0; color: var(--text); }
.table > thead > tr > th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line-strong);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    white-space: nowrap;
}
.table > tbody > tr > td, .table > tbody > tr > th, .table > tfoot > tr > td { padding: 12px; border-top: 1px solid var(--line); vertical-align: top; }
.table-bordered, .table-bordered > thead > tr > th, .table-bordered > tbody > tr > td, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > td { border-left: 0; border-right: 0; }
.table-bordered { border: 0; }
.table-bordered > thead > tr > th, .table-bordered > thead > tr > td { border-bottom-width: 1px; }
.table-striped > tbody > tr:nth-of-type(odd) { background: transparent; }
.table-hover > tbody > tr:hover { background: var(--surface-2); }
.table-responsive { border: 0; }

.label {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px; font-weight: 700; line-height: 1.5; letter-spacing: .01em;
    vertical-align: middle;
}
.label-success { background: var(--success-soft); color: var(--success-ink); }
.label-warning { background: var(--warning-soft); color: var(--warning-ink); }
.label-danger { background: var(--danger-soft); color: var(--danger-ink); }
.label-info { background: var(--info-soft); color: var(--info-ink); }
.label-primary { background: var(--brand-soft); color: var(--brand-dark); }
.label-default { background: #efedf2; color: var(--muted); }

.alert { border: 0; border-radius: var(--radius); }
.alert-warning { background: var(--warning-soft); color: var(--warning-ink); }
.alert-danger { background: var(--danger-soft); color: var(--danger-ink); }
.alert-success { background: var(--success-soft); color: var(--success-ink); }
.alert-info { background: var(--info-soft); color: var(--info-ink); }

.modal-backdrop.in { opacity: .45; }
.modal-backdrop { background: var(--ink); }
.modal-content { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-body { padding: 20px 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--line); }
.close { width: 32px; height: 32px; margin: -4px -6px 0 0; border-radius: 8px; color: var(--muted); font-size: 24px; font-weight: 400; line-height: 1; text-shadow: none; opacity: 1; }
.close:hover, .close:focus { background: var(--hover); color: var(--text); opacity: 1; }

.nav-tabs { border-bottom: 1px solid var(--line); }
.nav-tabs > li { margin-bottom: -1px; }
.nav-tabs > li > a { margin-right: 4px; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); font-weight: 600; }
.nav-tabs > li > a:hover { border-color: transparent; background: transparent; color: var(--text); }
.nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus { border: 0; border-bottom: 2px solid var(--brand); background: transparent; color: var(--brand); }
.tab-content { padding-top: 18px; }

.dropdown-menu { padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); font-size: 14px; }
.dropdown-menu > li > a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); font-weight: 500; }
.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus { background: var(--hover); color: var(--text); }
.dropdown-menu > li > a .ico, .logout-form .ico { width: 16px; height: 16px; color: var(--muted); }
.dropdown-menu .divider { margin: 6px 0; background: var(--line); }
.logout-form { margin: 0; }
.logout-form .btn-link { display: flex; justify-content: flex-start; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--danger-ink); font-weight: 500; text-align: left; }
.logout-form .btn-link:hover { background: var(--danger-soft); color: var(--danger-ink); text-decoration: none; }
.logout-form .btn-link .ico { color: currentColor; }
.pagination { margin: 0; }
.pagination > li > a, .pagination > li > span { margin: 0 2px; padding: 6px 11px; border: 0; border-radius: 8px !important; color: var(--text); font-weight: 600; }
.pagination > li > a:hover, .pagination > li > a:focus { background: var(--hover); color: var(--text); }
.pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus { background: var(--grad-brand); color: #fff; }
.pagination > .disabled > a, .pagination > .disabled > a:hover { background: transparent; color: var(--faint); }

/* ---------- DataTables */
.dataTables_wrapper { margin-top: 8px; }
.dataTables_wrapper .row { margin-bottom: 12px; }
.dataTables_wrapper .row:last-child { margin-top: 16px; margin-bottom: 0; }
.dataTables_wrapper .dataTables_length label, .dataTables_wrapper .dataTables_filter label { font-weight: 500; color: var(--muted); }
.dataTables_wrapper .dataTables_length select { width: auto; margin: 0 6px; padding-right: 30px; }
.dataTables_wrapper .dataTables_filter input { width: 240px; margin-left: 8px; }
.dataTables_wrapper .dataTables_info { padding-top: 6px; color: var(--muted); font-size: 13px; }
table.dataTable { border-collapse: collapse !important; margin-top: 8px !important; margin-bottom: 8px !important; }
table.dataTable thead .sorting::after, table.dataTable thead .sorting_asc::after, table.dataTable thead .sorting_desc::after { color: var(--faint); }
table.dataTable td.dataTables_empty { padding: 40px 12px; color: var(--muted); text-align: center; }
table.dataTable > tbody > tr.child ul.dtr-details > li { border-bottom-color: var(--line); }
table.dataTable > tbody > tr.child span.dtr-title { color: var(--muted); font-weight: 600; }
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before, table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before { color: var(--brand); }
.dt-buttons.btn-group { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.dt-buttons.btn-group > .btn { float: none; margin: 0 !important; border-radius: 8px !important; padding: 6px 12px; font-size: 13px; }
div.dt-button-collection .dt-button.active::after { color: var(--brand); }
@media (max-width: 767px) {
    .dataTables_wrapper .dataTables_filter input { width: 100%; margin: 6px 0 0; }
    .dataTables_wrapper .dataTables_filter label { display: block; width: 100%; }
}

/* the thin loading bar shown above a grid while it loads */
.preloader { display: none; }
.linear-activity { position: relative; height: 3px; margin: 14px 0 4px; overflow: hidden; border-radius: 3px; background: var(--brand-soft); }
.indeterminate { position: relative; width: 100%; height: 100%; }
.indeterminate::before, .indeterminate::after { content: ""; position: absolute; height: 100%; border-radius: 3px; background: var(--grad-brand); }
.indeterminate::before { animation: bar-first 1.5s infinite ease-out; }
.indeterminate::after { animation: bar-second 1.5s infinite ease-in; }
@keyframes bar-first { 0% { left: -100%; width: 100%; } 100% { left: 100%; width: 10%; } }
@keyframes bar-second { 0% { left: -150%; width: 100%; } 100% { left: 100%; width: 10%; } }

/* ---------- plugins: toasts, confirm boxes, date range picker */
.jq-toast-wrap .jq-toast-single { padding: 12px 16px 12px 50px; border-radius: 12px; font-family: var(--font); font-size: 14px; line-height: 1.45; box-shadow: var(--shadow-md); background-position: 16px center; }
.jconfirm, .jconfirm .jconfirm-box { font-family: var(--font); }
.jconfirm .jconfirm-box { border-radius: var(--radius-lg) !important; }
.jconfirm .jconfirm-box div.jconfirm-title-c { font-size: 18px; font-weight: 700; }
.jconfirm .jconfirm-box .jconfirm-buttons button { border-radius: 8px; font-weight: 600; text-transform: none; }
.jconfirm pre { font-size: 18px; text-align: center; user-select: all; border-radius: var(--radius-sm); background: var(--surface-2); border-color: var(--line); }
.daterange-box { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.daterange-box span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daterangepicker { font-family: var(--font); border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.daterangepicker .ranges li.active, .daterangepicker td.active, .daterangepicker td.active:hover { background-color: var(--brand); }
.daterangepicker .ranges li { border-radius: 6px; }
.daterangepicker .drp-buttons .btn { display: inline-block; }

/* small helpers used by the grids */
.btn-toggle { background: none; border: 0; padding: 0 4px; vertical-align: middle; cursor: pointer; }
.btn-toggle:focus-visible { outline: 2px solid var(--brand); }
.btn-toggle .fa-toggle-on { color: var(--success); }
.btn-toggle .fa-toggle-off { color: var(--faint); }

/* ---------- dashboard */
.dash { display: grid; gap: 24px; }
.dash-hello { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.dash-hello h2 { margin: 0 0 4px; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.dash-hello p { margin: 0; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi {
    position: relative; overflow: hidden;
    display: grid; align-content: start; gap: 6px;
    padding: 20px;
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    background: var(--surface); box-shadow: var(--shadow-sm);
    color: var(--text); text-decoration: none;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}
.kpi:hover, .kpi:focus { border-color: rgba(147, 39, 143, .3); box-shadow: var(--shadow-md); color: var(--text); text-decoration: none; transform: translateY(-2px); }
.kpi__icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 10px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.kpi__icon .ico { width: 20px; height: 20px; }
.kpi__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi__value { font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -.025em; }
.kpi__note { display: inline-flex; align-items: center; gap: 4px; justify-self: start; padding: 3px 9px; border-radius: 999px; background: #f1eef4; color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi__note .ico { width: 12px; height: 12px; stroke-width: 2.5; }
.kpi__note--up { background: var(--success-soft); color: var(--success-ink); }
.kpi__note--warn { background: var(--warning-soft); color: var(--warning-ink); }
.kpi--feature { border-color: transparent; background: var(--grad-brand); color: #fff; box-shadow: 0 16px 36px -18px rgba(147, 39, 143, .75); }
.kpi--feature::after { content: ""; position: absolute; right: -60px; top: -70px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0)); pointer-events: none; }
.kpi--feature:hover, .kpi--feature:focus { border-color: transparent; color: #fff; box-shadow: 0 20px 40px -18px rgba(147, 39, 143, .85); }
.kpi--feature .kpi__icon { background: rgba(255, 255, 255, .16); color: #fff; }
.kpi--feature .kpi__label { color: rgba(255, 255, 255, .82); }
.kpi--feature .kpi__note, .kpi--feature .kpi__note--up { background: rgba(255, 255, 255, .16); color: #fff; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.card { display: flex; flex-direction: column; gap: 18px; min-width: 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card__head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.card__head p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.card__figure { display: grid; text-align: right; line-height: 1.2; }
.card__figure strong { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.card__figure span { font-size: 12px; color: var(--muted); }
.card__link { display: inline-flex; align-items: center; gap: 4px; margin-top: auto; font-size: 13px; font-weight: 600; }
.card__link .ico { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.card__link:hover { text-decoration: none; }
.card__link:hover .ico { transform: translateX(3px); }
.card__split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card__split a { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--text); text-decoration: none; transition: background .15s var(--ease); }
.card__split a:hover { background: var(--hover); }
.card__split span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.card__split strong { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.card__split small { font-size: 12px; color: var(--muted); }

/* column chart: one column per day, today in the accent colour */
.chart { display: grid; gap: 8px; padding-top: 10px; }
.chart__plot { position: relative; height: 210px; margin-left: 30px; }
.chart__grid span { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.chart__grid span:last-child { border-top-color: var(--line-strong); }
.chart__grid em { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 11px; font-style: normal; line-height: 16px; color: var(--faint); font-variant-numeric: tabular-nums; }
.chart__cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.chart__col { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; border-radius: 8px 8px 0 0; outline: none; }
.chart__col:hover, .chart__col:focus-visible { background: linear-gradient(to top, rgba(147, 39, 143, .07), rgba(147, 39, 143, 0)); }
.chart__col:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-ring); }
.chart__bar { width: min(24px, 62%); height: var(--h); border-radius: 4px 4px 0 0; background: #d9bddd; transition: background .15s var(--ease); }
.chart__col:hover .chart__bar, .chart__col:focus-visible .chart__bar { background: #c294c8; }
.chart__col.is-today .chart__bar { background: var(--grad-brand); }
.chart__cap { margin-bottom: 4px; font-size: 12px; font-weight: 700; line-height: 1; color: var(--text); }
.chart__tip {
    position: absolute; left: 50%; bottom: calc(var(--h) + 26px); z-index: 2;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--ink); color: rgba(255, 255, 255, .78);
    font-size: 12px; line-height: 1.4; white-space: nowrap;
    transform: translateX(-50%);
    opacity: 0; pointer-events: none;
    transition: opacity .12s var(--ease);
}
.chart__tip strong { color: #fff; }
.chart__col:not(.is-today) .chart__tip { bottom: calc(var(--h) + 8px); }
.chart__col:nth-child(-n+2) .chart__tip { left: 0; transform: none; }
.chart__col:nth-last-child(-n+2) .chart__tip { left: auto; right: 0; transform: none; }
.chart__col:hover .chart__tip, .chart__col:focus .chart__tip { opacity: 1; }
.chart__empty { position: absolute; inset: 0 0 30% 0; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: 13px; pointer-events: none; }
.chart__axis { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); margin: 0 0 0 30px; padding: 0; list-style: none; color: var(--muted); font-size: 11px; text-align: center; white-space: nowrap; }

.stat-list { display: grid; margin: 0; padding: 0; list-style: none; }
.stat-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.stat-list li:first-child { padding-top: 0; }
.stat-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.stat-list strong { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.stat-list__label { display: grid; flex: 1; min-width: 0; font-weight: 600; line-height: 1.35; }
.stat-list__label small { font-size: 12px; font-weight: 500; color: var(--muted); }
/* Prime / Crown share of active members (Prime royal blue, Crown gold: the cards' own colours) */
.share { display: grid; gap: 10px; }
.share__bar { display: flex; gap: 2px; height: 10px; overflow: hidden; border-radius: 5px; background: #efedf2; }
.share__seg { min-width: 3px; }

.share__seg--prime, .share__key--prime { background: #2654e0; }
.share__seg--crown, .share__key--crown { background: #b8862b; }
.share__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.share__legend li { display: flex; align-items: center; gap: 7px; }
.share__legend strong { color: var(--text); }
.share__key { width: 10px; height: 10px; border-radius: 3px; }
.callout { display: flex; align-items: center; gap: 12px; margin-top: auto; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--text); text-decoration: none; }
.callout > .ico:first-child { box-sizing: content-box; padding: 7px; border-radius: 9px; background: var(--success-soft); color: var(--success-ink); }
.callout > span { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.callout strong { font-size: 13.5px; }
.callout small { font-size: 12px; color: var(--muted); }
.callout > .ico:last-child:not(:first-child) { width: 16px; height: 16px; color: var(--warning-ink); }
.callout--warn { background: var(--warning-soft); }
.callout--warn > .ico:first-child { background: rgba(255, 255, 255, .7); color: var(--warning-ink); }
a.callout--warn:hover, a.callout--warn:focus { background: #f9e7c6; color: var(--text); text-decoration: none; }
/* a tiny membership card, in the cards' own royal blues */
.mini-card { position: relative; flex: none; width: 42px; height: 30px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 4px 10px -6px rgba(11, 22, 71, .8); }
.mini-card::after { content: ""; position: absolute; left: 6px; top: 9px; width: 9px; height: 7px; border-radius: 2px; }
.mini-card--prime { background: radial-gradient(110% 70% at 100% 0%, #2c55d6 0%, #15307f 55%, #0b1647 100%); }
.mini-card--prime::after { background: linear-gradient(135deg, #ffffff 0%, #ddd9ea 50%, #aea8c3 100%); }
.mini-card--crown { background: radial-gradient(110% 70% at 100% 0%, #1a3488 0%, #0c1a4c 55%, #060b26 100%); }
.mini-card--crown::after { background: linear-gradient(135deg, #f7e4a6 0%, #d6b25e 45%, #a47a2c 100%); }

.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.trio__item { display: grid; gap: 2px; padding: 16px; border-radius: 14px; background: var(--surface-2); color: var(--text); text-decoration: none; transition: background .15s var(--ease); }
a.trio__item:hover, a.trio__item:focus { background: var(--hover); color: var(--text); text-decoration: none; }
.trio__icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 8px; border-radius: 10px; background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.trio__item strong { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.trio__item > span:last-child { font-size: 13px; color: var(--muted); }

.shortcuts { display: grid; gap: 2px; margin: -6px -10px; padding: 0; list-style: none; }
.shortcuts a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px; color: var(--text); font-weight: 600; text-decoration: none; }
.shortcuts a:hover, .shortcuts a:focus { background: var(--hover); color: var(--text); text-decoration: none; }
.shortcuts a > .ico:first-child { box-sizing: content-box; padding: 7px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.shortcuts a > span { flex: 1; min-width: 0; }
.shortcuts a > .ico:last-child { width: 16px; height: 16px; color: var(--faint); }

@media (max-width: 1199px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 575px) {
    .kpis { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .kpi { grid-template-columns: 42px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; padding: 16px; }
    .kpi__icon { grid-row: 1 / span 3; margin: 0; }
    .kpi__label, .kpi__value, .kpi__note { grid-column: 2; }
    .kpi__value { font-size: 24px; }
    .dash-hello h2 { font-size: 20px; }
    .chart__plot { height: 170px; }
    .trio { grid-template-columns: minmax(0, 1fr); }
    .trio__item { grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
    .trio__icon { margin: 0; }
    .trio__item strong { order: 3; }
}

/* ---------- signed-out pages: login and first-time setup */
.auth-page { background: var(--surface); }
.auth { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; }
.auth__brand {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
    padding: 48px 56px;
    color: rgba(255, 255, 255, .8);
    background:
        radial-gradient(110% 70% at 0% 0%, rgba(103, 63, 152, .55) 0%, rgba(103, 63, 152, 0) 60%),
        radial-gradient(90% 70% at 100% 100%, rgba(147, 39, 143, .6) 0%, rgba(147, 39, 143, 0) 62%),
        var(--ink);
}
.auth__watermark { position: absolute; right: -90px; bottom: -70px; width: 520px; max-width: none; opacity: .06; pointer-events: none; }
.auth__logo { position: relative; width: 94px; height: auto; }
.auth__pitch { position: relative; max-width: 460px; }
.auth__eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; color: #e6c9f1; font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.auth__eyebrow::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #e48bdf, #c3a4f3); }
.auth__pitch h2 { margin: 0 0 30px; color: #fff; font-size: 34px; font-weight: 700; line-height: 1.18; letter-spacing: -.01em; }
.auth__points { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; font-size: 15px; }
.auth__points li { display: flex; align-items: center; gap: 14px; }
.auth__points .ico { box-sizing: content-box; padding: 9px; border-radius: 11px; background: rgba(255, 255, 255, .08); color: #e6c9f1; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.auth__legal { position: relative; margin: 0; color: rgba(255, 255, 255, .5); font-size: 13px; }
.auth__main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth__card { width: min(400px, 100%); }
[data-page="setup"] .auth__card { width: min(560px, 100%); }
.auth__logo-sm { display: none; width: auto; height: 56px; margin-bottom: 28px; }
.auth__title { margin: 0 0 6px; font-size: 28px; font-weight: 700; letter-spacing: -.01em; }
.auth__lead { margin: 0 0 28px; color: var(--muted); font-size: 15px; }
.auth .form-control { height: 46px; border-radius: 12px; }
.auth .btn-lg { height: 48px; margin-top: 8px; }
.input-icon { position: relative; }
.input-icon > .ico { position: absolute; left: 14px; top: 50%; color: var(--faint); transform: translateY(-50%); pointer-events: none; transition: color .15s var(--ease); }
.input-icon:focus-within > .ico { color: var(--brand); }
.input-icon .form-control { padding-left: 42px; padding-right: 46px; }
.reveal { position: absolute; right: 6px; top: 50%; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--faint); transform: translateY(-50%); cursor: pointer; }
.reveal:hover { background: var(--hover); color: var(--text); }
.reveal__hide, .reveal[aria-pressed="true"] .reveal__show { display: none; }
.reveal[aria-pressed="true"] .reveal__hide { display: block; }
.auth__note { display: flex; align-items: flex-start; gap: 10px; margin: 28px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.auth__note .ico { width: 16px; height: 16px; margin-top: 2px; color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }

@media (max-width: 991px) {
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth__brand { display: none; }
    .auth-page { background: var(--bg); }
    .auth__main { align-items: flex-start; padding: 56px 16px; }
    .auth__card { padding: 32px 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-md); }
    .auth__logo-sm { display: block; }
}
@media (max-width: 575px) {
    .auth__main { padding: 24px 16px; }
    .auth__card { padding: 28px 20px; }
    .auth__title { font-size: 24px; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; }
}

/* ---------- Bootstrap input groups (unit beside a field: ₹, %, months …) */
.input-group-addon { min-width: 38px; border-color: var(--line-strong); background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600; }
.input-group .form-control:first-child, .input-group-addon:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .form-control:last-child, .input-group-addon:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group-sm > .form-control, .input-group-sm > .input-group-addon { height: 34px; padding: 5px 10px; font-size: 13px; }
.input-group-sm > .form-control:first-child, .input-group-sm > .input-group-addon:first-child { border-radius: 8px 0 0 8px; }
.input-group-sm > .form-control:last-child, .input-group-sm > .input-group-addon:last-child { border-radius: 0 8px 8px 0; }
.input-group .form-control:focus { z-index: 3; }
.form-control[disabled] { cursor: not-allowed; color: var(--faint); }
.icon-btn--sm { width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.icon-btn--sm .ico { width: 16px; height: 16px; }
.icon-btn--sm:hover { border-color: transparent; background: var(--danger-soft); color: var(--danger-ink); }
.icon-btn:disabled, .icon-btn:disabled:hover { opacity: .35; cursor: not-allowed; background: var(--surface); color: var(--muted); }

/* ---------- membership plan editor (/plan) */
.plan { display: grid; gap: 18px; }
.plan-status { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.plan-status__icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--grad-brand); color: #fff; }
.plan-status__icon .ico { width: 20px; height: 20px; }
.plan-status__text { display: grid; flex: 1; min-width: 240px; line-height: 1.45; }
.plan-status__text strong { font-size: 15px; }
.plan-status__text small { font-size: 13px; color: var(--muted); }
.plan-uses { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.plan-uses li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.plan-uses .ico { width: 14px; height: 14px; color: var(--brand); }
.plan-count { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 11.5px; line-height: 18px; text-align: center; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; align-items: start; }
.plan-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.plan-fields--narrow { max-width: 440px; grid-template-columns: minmax(0, 1fr); }
.plan .panel-heading { justify-content: space-between; }
.plan-summary { font-size: 13px; font-weight: 600; color: var(--muted); }
.plan-rows, .plan-tiers { margin-bottom: 14px; }
.plan-rows > tbody > tr > td, .plan-tiers > tbody > tr > td, .plan-tiers > tbody > tr > th { vertical-align: middle; }
.plan-rows .input-group { width: 200px; }
.plan-rows td > .form-control { width: 160px; }
.plan-n { width: 56px; font-weight: 700; color: var(--muted); }
.plan-sofar { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.plan-tiers > tbody > tr > th[scope="row"] { padding-right: 18px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.plan-tiers .input-group { min-width: 140px; }
.plan-bar { position: sticky; bottom: 12px; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: var(--shadow-md); }
.plan-bar__state { flex: 1; font-weight: 600; color: var(--muted); }
.plan-bar__state.is-dirty { color: var(--warning-ink); }
.plan-bar__state.is-dirty::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--warning); vertical-align: 1px; }
.plan-changes { max-height: 320px; overflow-y: auto; margin: 0 0 18px; padding: 10px 14px 10px 32px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; }
.plan-changes li { padding: 3px 0; }
.plan-empty { margin: 0; padding: 12px 0; }
@media (max-width: 1199px) {
    .plan-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
    .plan-fields { grid-template-columns: minmax(0, 1fr); }
    .plan-bar { flex-wrap: wrap; }
    .plan-bar__state { flex-basis: 100%; }
    .plan-bar .btn { flex: 1; }
}
