:root {
    --ink: #122033;
    --muted: #66758a;
    --line: #dbe3ee;
    --panel: #ffffff;
    --soft: #f4f7fb;
    --primary: #1549d0;
    --primary-dark: #0c36a6;
    --navy: #0d2145;
    --success: #087a55;
    --danger: #b42318;
    --shadow: 0 28px 80px rgba(17, 35, 64, .12);
    --radius: 22px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--soft); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .95fr) minmax(520px, 1.05fr); background: #fff; }
.brand-panel { position: relative; overflow: hidden; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; padding: clamp(34px, 5vw, 72px); color: #fff; background: linear-gradient(145deg, #081832 0%, #0e2b60 58%, #174ec1 140%); }
.brand-panel::before { content: ""; position: absolute; width: 620px; height: 620px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; right: -360px; top: 18%; box-shadow: 0 0 0 90px rgba(255,255,255,.03), 0 0 0 180px rgba(255,255,255,.025); }
.brand-panel::after { content: ""; position: absolute; width: 250px; height: 250px; border-radius: 54px; left: -110px; bottom: 12%; background: linear-gradient(135deg, rgba(63,125,255,.28), rgba(255,255,255,.03)); transform: rotate(32deg); }
.brand-top, .brand-copy, .brand-footer { position: relative; z-index: 1; }
.brand-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand-logo { max-width: 160px; max-height: 74px; object-fit: contain; filter: brightness(0) invert(1); }
.product-pill { padding: 8px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .06em; background: rgba(255,255,255,.06); }
.brand-copy { max-width: 620px; padding: 64px 0; }
.eyebrow, .kicker { margin: 0 0 12px; font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.eyebrow { color: #8eb4ff; }
.brand-copy h1 { max-width: 600px; margin: 0; font-size: clamp(42px, 5.4vw, 74px); line-height: .98; letter-spacing: -.045em; }
.brand-copy p:last-child { max-width: 570px; margin: 28px 0 0; color: #cad7eb; font-size: 17px; line-height: 1.7; }
.brand-footer { display: flex; align-items: center; gap: 10px; color: #cbd7e9; font-size: 13px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 5px rgba(74,222,128,.12); }

.form-panel { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 46px clamp(28px, 7vw, 110px); background: #fff; }
.form-wrap { width: 100%; max-width: 510px; margin: auto; }
.auth-heading { margin-bottom: 30px; }
.auth-heading .kicker, .base-card .kicker { color: var(--primary); }
.auth-heading h2 { margin: 0; font-size: clamp(34px, 4vw, 48px); letter-spacing: -.035em; line-height: 1.08; }
.auth-heading p { margin: 14px 0 0; color: var(--muted); font-size: 15.5px; line-height: 1.65; }
.auth-form { display: grid; gap: 20px; }
.field { display: grid; gap: 9px; font-size: 13.5px; font-weight: 750; }
.label-row { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.label-row a { font-size: 13px; font-weight: 700; }
.field input { width: 100%; height: 55px; border: 1px solid var(--line); border-radius: 13px; padding: 0 15px; color: var(--ink); background: #fff; outline: none; box-shadow: 0 1px 2px rgba(18,32,51,.02); transition: border-color .18s ease, box-shadow .18s ease; }
.field input:focus { border-color: #6f94f0; box-shadow: 0 0 0 4px rgba(21,73,208,.10); }
.field input::placeholder { color: #9aa7b7; font-weight: 500; }
.password-wrap { display: block; position: relative; }
.password-wrap input { padding-right: 76px; }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--primary); font-size: 12.5px; font-weight: 800; cursor: pointer; padding: 9px 8px; }
.btn { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 13px; padding: 0 22px; font-weight: 800; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { color: #fff; background: var(--primary); box-shadow: 0 12px 26px rgba(21,73,208,.20); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { color: var(--ink); background: #edf2f8; }
.btn-block { width: 100%; margin-top: 2px; }
.btn-small { min-height: 38px; padding: 0 15px; font-size: 12.5px; }
.alert { margin: -5px 0 22px; padding: 13px 15px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; }
.alert-error { color: #8c1d18; background: #fff0ef; border: 1px solid #ffd0cd; }
.alert-success { color: #066648; background: #ecfbf5; border: 1px solid #bcebd9; }
.security-note { display: flex; gap: 13px; margin-top: 28px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #f9fbfd; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.security-note strong { color: var(--ink); }
.shield { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 10px; background: #e7efff; color: var(--primary); font-weight: 900; }
.auth-footer { margin: 38px auto 0; color: #99a5b5; font-size: 12px; }
.back-link { display: inline-block; margin-bottom: 30px; color: var(--muted); font-size: 13px; font-weight: 700; }
.otp-input { height: 72px !important; text-align: center; font-size: 30px !important; letter-spacing: .42em; font-weight: 800; padding-left: calc(15px + .42em) !important; }
.resend-form { margin-top: 22px; text-align: center; }
.link-button { border: 0; padding: 8px; background: transparent; color: var(--primary); cursor: pointer; font-weight: 800; }
.link-button:disabled { color: #9aa7b7; cursor: not-allowed; }

.app-base-body { min-height: 100vh; background: #f3f6fb; }
.app-topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 5vw, 70px); background: #fff; border-bottom: 1px solid var(--line); }
.app-logo { width: 120px; max-height: 55px; object-fit: contain; }
.app-user { display: flex; align-items: center; gap: 18px; font-size: 13px; font-weight: 750; }
.app-base-main { width: min(1120px, calc(100% - 40px)); margin: 70px auto; }
.base-card { padding: clamp(28px, 5vw, 56px); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.base-card h1 { margin: 0; font-size: clamp(34px, 5vw, 56px); letter-spacing: -.04em; }
.base-card > p { max-width: 760px; color: var(--muted); line-height: 1.65; }
.base-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 34px; }
.base-grid > div { padding: 20px; border-radius: 14px; background: var(--soft); }
.base-grid strong, .base-grid span { display: block; }
.base-grid strong { font-size: 17px; }
.base-grid span { margin-top: 6px; color: var(--muted); font-size: 12px; }

@media (max-width: 980px) {
    .auth-shell { grid-template-columns: 1fr; }
    .brand-panel { min-height: 320px; padding: 34px 28px; }
    .brand-copy { padding: 38px 0 16px; }
    .brand-copy h1 { font-size: 42px; max-width: 680px; }
    .brand-copy p:last-child { margin-top: 16px; }
    .brand-footer { display: none; }
    .form-panel { min-height: auto; padding: 52px 26px; }
    .base-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .brand-panel { min-height: 260px; }
    .brand-copy h1 { font-size: 34px; }
    .brand-copy p:last-child { display: none; }
    .product-pill { display: none; }
    .form-panel { padding: 42px 20px; }
    .auth-heading h2 { font-size: 34px; }
    .base-grid { grid-template-columns: 1fr; }
    .app-user > span { display: none; }
}

/* V2 system administration */
.brand-link { display: inline-flex; align-items: center; }
.app-nav { display: flex; align-items: center; gap: 6px; margin: 0 auto 0 34px; }
.app-nav a { padding: 9px 11px; border-radius: 9px; color: var(--muted); font-size: 13px; font-weight: 750; }
.app-nav a:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.app-alert { margin: 0 0 20px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.page-heading h1 { margin: 0; font-size: clamp(34px, 4.5vw, 54px); line-height: 1; letter-spacing: -.04em; }
.page-heading p { max-width: 760px; margin: 13px 0 0; color: var(--muted); line-height: 1.6; }
.page-heading .kicker { color: var(--primary); }
.metric-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 24px; }
.metric-grid article { min-height: 116px; display: flex; flex-direction: column; justify-content: space-between; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.metric-grid strong { font-size: 30px; letter-spacing: -.04em; }
.metric-grid span { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.admin-card { padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 12px 36px rgba(17,35,64,.05); }
.section-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 22px; }
.section-heading p { margin: 7px 0 0; color: var(--muted); }
.admin-link-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.admin-link-grid a { padding: 22px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); transition: transform .15s ease, border-color .15s ease; }
.admin-link-grid a:hover { transform: translateY(-2px); border-color: #9bb5ed; text-decoration: none; }
.admin-link-grid strong, .admin-link-grid span { display: block; }
.admin-link-grid span { margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.table-card { padding: 0; overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th { padding: 14px 18px; text-align: left; color: #738096; background: #f8fafc; border-bottom: 1px solid var(--line); font-size: 11.5px; text-transform: uppercase; letter-spacing: .055em; }
.data-table td { padding: 16px 18px; border-bottom: 1px solid #edf1f6; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table strong, .data-table small { display: block; }
.data-table small { margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.table-actions { text-align: right; }
.tag { display: inline-flex; padding: 5px 8px; border-radius: 7px; background: #eef3fb; color: #40516b; font-size: 11px; font-weight: 800; }
.status { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status-active { color: #087a55; background: #e9f8f2; }
.status-inactive { color: #6b7280; background: #eef0f3; }
.status-suspended { color: #a33a15; background: #fff0e9; }
.empty-state { padding: 42px !important; text-align: center; color: var(--muted); }
.form-card { max-width: 980px; }
.admin-form { display: grid; gap: 22px; }
.form-grid { display: grid; gap: 18px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field select { width: 100%; height: 55px; border: 1px solid var(--line); border-radius: 13px; padding: 0 15px; color: var(--ink); background: #fff; outline: none; }
.field select:focus { border-color: #6f94f0; box-shadow: 0 0 0 4px rgba(21,73,208,.10); }
.check-field { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 13px; font-weight: 750; }
.check-field input { width: 17px; height: 17px; }
.form-help { padding: 14px 16px; border-radius: 12px; background: var(--soft); color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.action-row { display: flex; align-items: center; gap: 12px; margin-top: 24px; }

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
    .app-topbar { height: auto; min-height: 76px; flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
    .app-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .admin-link-grid, .form-grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .app-base-main { width: min(100% - 24px, 1120px); margin-top: 34px; }
    .admin-card { padding: 18px; }
    .table-card { padding: 0; }
}

/* Nimatooz brand finish */
.brand-panel::before { border-color: rgba(125,211,252,.16); box-shadow: 0 0 0 90px rgba(7,141,199,.06),0 0 0 180px rgba(255,255,255,.025); }
.brand-panel::after { background: linear-gradient(135deg,rgba(240,68,11,.5),rgba(7,141,199,.16)); box-shadow: 0 24px 70px rgba(2,18,33,.2); }
.brand-top::after { content:""; position:absolute; left:0; bottom:-18px; width:86px; height:3px; border-radius:99px; background:linear-gradient(90deg,var(--brand-orange),#38bdf8); }
.product-pill { border-color:rgba(255,164,124,.42); background:rgba(240,68,11,.13); box-shadow:inset 0 0 0 1px rgba(255,255,255,.03); }
.product-pill::before { content:""; display:inline-block; width:7px; height:7px; margin-right:7px; border-radius:50%; background:#ff6b35; box-shadow:0 0 0 4px rgba(240,68,11,.14); }
.eyebrow { color:#7dd3fc; }
.form-panel { position:relative; background:radial-gradient(circle at 100% 0,rgba(7,141,199,.075),transparent 24rem),#fff; }
.form-panel::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:linear-gradient(180deg,var(--brand-orange),var(--primary),#0f9f8f); }
.auth-heading .kicker { color:var(--primary); }
.auth-heading h2 { color:#102a3d; }
.field input:focus { border-color:var(--primary); box-shadow:0 0 0 4px rgba(7,141,199,.12); }
.btn-primary { background:linear-gradient(135deg,var(--primary),var(--primary-dark)); box-shadow:0 13px 30px rgba(7,141,199,.24); }
.btn-primary:hover { filter:saturate(1.12) brightness(.96); }
.security-note { border-color:#d9eaf1; background:linear-gradient(135deg,#f7fcfe,#fff9f6); }
.shield { color:var(--primary); background:#ddf3fb; box-shadow:inset 0 0 0 1px #c8eaf7; }
@media(max-width:980px){.form-panel::before{top:0;right:0;bottom:auto;width:auto;height:4px;background:linear-gradient(90deg,var(--brand-orange),var(--primary),#0f9f8f)}}
