/* ==========================================================================
   GT DEFECT — GESTTECH
   Responsive app shell + components
   ========================================================================== */

:root {
    --ink: #0f172a;
    --ink-soft: #1e293b;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --line: #e2e8f0;
    --line-soft: #eef2f7;
    --bg: #f4f7fb;
    --card: #ffffff;
    --navy: #0b1220;
    --navy-2: #111c31;
    --teal: #0f766e;
    --teal-2: #14b8a6;
    --teal-soft: #ccfbf1;
    --blue: #2563eb;
    --rose: #e11d48;
    --amber: #d97706;
    --violet: #7c3aed;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px rgba(15, 23, 42, .06);
    --shadow-lg: 0 18px 50px rgba(15, 23, 42, .14);
    --sidebar-w: 264px;
    --topbar-h: 74px;
    --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; }

:focus-visible {
    outline: 3px solid rgba(20, 184, 166, .35);
    outline-offset: 2px;
}

.ico { width: 20px; height: 20px; flex: 0 0 auto; }
.ico-sm { width: 15px; height: 15px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.req { color: var(--rose); }
.dot { color: var(--muted-2); }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13.5px;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn .ico { width: 17px; height: 17px; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 6px 16px rgba(15, 118, 110, .18); }
.btn-primary:hover { background: #0b5f59; }
.btn-secondary { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.btn-secondary:hover { background: #bae6fd; }
.btn-ghost { background: #fff; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-danger-ghost { background: #fff; color: #be123c; border-color: #fecdd3; }
.btn-danger-ghost:hover { background: #fff1f2; }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-lg { min-height: 50px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.icon-btn {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-soft);
    border-radius: 10px;
    padding: 0;
}
.icon-btn:hover { background: #f8fafc; }

.icon-action {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    text-decoration: none;
    padding: 0;
}
.icon-action .ico { width: 15px; height: 15px; }
.icon-action:hover { color: var(--teal); border-color: #99f6e4; background: #f0fdfa; }
.icon-action.danger:hover { color: var(--rose); border-color: #fecdd3; background: #fff1f2; }
.inline-form { display: inline; margin: 0; }

/* --------------------------------------------------------------------------
   App shell / sidebar
   -------------------------------------------------------------------------- */
.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background:
        radial-gradient(600px 300px at 10% 0%, rgba(20, 184, 166, .18), transparent 60%),
        linear-gradient(180deg, #0b1220 0%, #0c1526 60%, #0a1120 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 20px 16px 16px;
    z-index: 50;
    border-right: 1px solid rgba(148, 163, 184, .12);
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.brand {
    display: inline-flex; align-items: center; gap: 11px;
    text-decoration: none; color: inherit; min-width: 0;
}
.brand-mark {
    width: 42px; height: 42px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, var(--teal-2), #0d9488 65%, #0f766e);
    color: #042f2e;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -.5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 16px rgba(13, 148, 136, .25);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-copy strong { font-size: 16px; letter-spacing: 2.5px; font-weight: 800; }
.brand-copy small { font-size: 8.5px; letter-spacing: 2.2px; color: var(--muted-2); margin-top: 5px; font-weight: 600; }
.brand-lg .brand-mark { width: 52px; height: 52px; font-size: 20px; border-radius: 14px; }
.brand-lg .brand-copy strong { font-size: 20px; }
.brand-lg .brand-copy small { font-size: 9px; }
.brand-on-dark .brand-copy strong { color: #fff; }

.sidebar-close { display: none; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); color: #cbd5e1; }

.store-card {
    display: flex; gap: 10px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 12px;
    padding: 11px;
    margin-bottom: 18px;
}
.store-icon {
    width: 34px; height: 34px; border-radius: 9px;
    background: rgba(20, 184, 166, .14); color: #5eead4;
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.store-icon .ico { width: 17px; height: 17px; }
.store-copy { display: flex; flex-direction: column; min-width: 0; }
.store-copy .store-code { font-size: 9.5px; letter-spacing: 1.4px; color: #5eead4; font-weight: 700; }
.store-copy strong { font-size: 11.5px; line-height: 1.3; margin: 2px 0; color: #f1f5f9; font-weight: 600; }
.store-copy small { font-size: 10px; color: #94a3b8; }

.sidebar-nav { flex: 1; overflow-y: auto; padding-right: 2px; }
.nav-label {
    font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.6px;
    color: #64748b; font-weight: 700; margin: 0 10px 8px;
}
.nav-link {
    display: flex; align-items: center; gap: 11px;
    min-height: 43px; padding: 0 11px;
    border-radius: 9px;
    color: #aebdd0;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 3px;
    transition: background .15s ease, color .15s ease;
}
.nav-link .ico { width: 18px; height: 18px; color: #7c8da3; }
.nav-link:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.nav-link:hover .ico { color: #99f6e4; }
.nav-link.is-active {
    background: linear-gradient(90deg, rgba(20, 184, 166, .18), rgba(20, 184, 166, .06));
    color: #fff;
    box-shadow: inset 2px 0 0 #2dd4bf;
}
.nav-link.is-active .ico { color: #5eead4; }
.nav-hint {
    margin-left: auto; width: 19px; height: 19px; border-radius: 6px;
    background: rgba(20, 184, 166, .18); color: #5eead4;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
}

.sidebar-footer { border-top: 1px solid rgba(148, 163, 184, .12); padding-top: 12px; margin-top: 10px; }
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: inherit;
    padding: 8px; border-radius: 10px;
}
.sidebar-user:hover { background: rgba(255, 255, 255, .05); }
.sidebar-user-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sidebar-user-copy strong { font-size: 12px; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-copy small { font-size: 10px; color: #94a3b8; }
.sidebar-user > .ico { width: 15px; height: 15px; color: #64748b; }
.logout-form { margin: 4px 0 0; }
.sidebar-logout {
    width: 100%; min-height: 38px;
    display: flex; align-items: center; gap: 9px;
    background: transparent; border: 0; color: #94a3b8;
    padding: 0 10px; border-radius: 8px; font-size: 12.5px;
}
.sidebar-logout:hover { background: rgba(244, 63, 94, .1); color: #fda4af; }
.sidebar-logout .ico { width: 17px; height: 17px; }

.avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(145deg, #ccfbf1, #99f6e4);
    color: #115e59;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex: 0 0 auto;
    border: 1px solid rgba(15, 118, 110, .12);
}
.avatar-sm { width: 32px; height: 32px; font-size: 11px; }
.avatar-xs { width: 28px; height: 28px; font-size: 10px; }
.avatar-xl { width: 76px; height: 76px; font-size: 24px; }

.sidebar-overlay {
    position: fixed; inset: 0; z-index: 45;
    background: rgba(2, 6, 23, .55);
    backdrop-filter: blur(2px);
}

.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */
.topbar {
    position: sticky; top: 0; z-index: 40;
    min-height: var(--topbar-h);
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 12px 28px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 13px; min-width: 0; }
.menu-btn { display: none; }
.topbar-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.topbar-eyebrow { font-size: 9.5px; letter-spacing: 1.8px; font-weight: 700; color: var(--teal); text-transform: uppercase; }
.topbar-title strong { font-size: 17px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.user-menu { position: relative; }
.user-chip {
    display: flex; align-items: center; gap: 9px;
    background: #fff; border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px 4px 5px;
    min-height: 42px;
}
.user-chip:hover { background: #f8fafc; }
.user-chip-copy { display: flex; flex-direction: column; line-height: 1.15; text-align: left; max-width: 150px; }
.user-chip-copy strong { font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-copy small { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip > .ico { color: var(--muted-2); transform: rotate(90deg); }
.user-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    width: 244px; background: #fff; border: 1px solid var(--line);
    border-radius: 13px; box-shadow: var(--shadow-lg);
    padding: 6px; z-index: 60;
}
.user-dropdown-head {
    display: flex; gap: 10px; align-items: center;
    padding: 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 5px;
}
.user-dropdown-head strong { display: block; font-size: 12.5px; }
.user-dropdown-head small { color: var(--muted); font-size: 11px; }
.user-dropdown a, .user-dropdown button {
    width: 100%; display: flex; align-items: center; gap: 9px;
    background: transparent; border: 0; text-decoration: none;
    padding: 9px 10px; border-radius: 8px; font-size: 12.5px; color: var(--ink-soft); text-align: left;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: #f1f5f9; }
.user-dropdown .ico { width: 16px; height: 16px; color: var(--muted); }
.user-dropdown form { margin: 0; }

.content { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 26px 28px 40px; }
.app-footer {
    display: flex; justify-content: center; gap: 7px;
    padding: 4px 20px 22px; color: var(--muted-2); font-size: 10.5px;
    letter-spacing: .3px;
}

/* --------------------------------------------------------------------------
   Alerts / flash
   -------------------------------------------------------------------------- */
.flash-stack { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.flash-stack:empty { display: none; }
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    border: 1px solid; border-radius: 12px;
    padding: 11px 13px; font-size: 12.5px; line-height: 1.45;
}
.alert > .ico { width: 18px; height: 18px; margin-top: 1px; }
.alert span, .alert div { flex: 1; min-width: 0; }
.alert strong { font-weight: 700; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-close { border: 0; background: transparent; color: currentColor; opacity: .6; padding: 0; margin-left: auto; }
.alert-close:hover { opacity: 1; }
.alert-close .ico { width: 15px; height: 15px; }
.alert-list { margin: 5px 0 0 16px; padding: 0; }
.alert-list li { margin: 2px 0; }

/* --------------------------------------------------------------------------
   Typography / page head
   -------------------------------------------------------------------------- */
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
    margin-bottom: 20px;
}
.page-head h1 { font-size: 25px; letter-spacing: -.55px; line-height: 1.15; margin: 3px 0 5px; }
.page-head p { color: var(--muted); font-size: 13px; max-width: 720px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.back-link {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600;
}
.back-link:hover { color: var(--teal); }
.back-link .ico { width: 14px; height: 14px; }
.eyebrow { font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: #99f6e4; font-weight: 700; }

/* --------------------------------------------------------------------------
   Cards / grids
   -------------------------------------------------------------------------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 18px;
}
.card-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
    margin-bottom: 15px;
}
.card-head h2 { font-size: 15px; letter-spacing: -.2px; font-weight: 700; }
.card-head p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.link-arrow {
    display: inline-flex; align-items: center; gap: 3px;
    color: var(--teal); text-decoration: none; font-size: 11.5px; font-weight: 700;
    white-space: nowrap; padding: 4px 0;
}
.link-arrow .ico { width: 14px; height: 14px; }
.link-arrow:hover { color: #0b5f59; }

/* --------------------------------------------------------------------------
   Hero / dashboard
   -------------------------------------------------------------------------- */
.hero {
    position: relative; overflow: hidden;
    display: flex; align-items: stretch; justify-content: space-between; gap: 24px;
    background:
        radial-gradient(700px 300px at 85% -20%, rgba(45, 212, 191, .28), transparent 60%),
        radial-gradient(400px 200px at 0% 100%, rgba(59, 130, 246, .16), transparent 60%),
        linear-gradient(120deg, #0b1220, #0f2a2a 70%, #0b3b36);
    border-radius: 20px;
    padding: 28px;
    color: #fff;
    margin-bottom: 18px;
    box-shadow: 0 18px 50px rgba(11, 18, 32, .18);
}
.hero::after {
    content: ""; position: absolute; right: -40px; bottom: -80px;
    width: 260px; height: 260px; border-radius: 50%;
    border: 1px solid rgba(94, 234, 212, .18);
    box-shadow: 0 0 0 35px rgba(94, 234, 212, .04), 0 0 0 70px rgba(94, 234, 212, .025);
}
.hero-copy { position: relative; z-index: 1; max-width: 620px; }
.hero h1 { font-size: 31px; letter-spacing: -.8px; line-height: 1.1; margin: 2px 0 6px; }
.hero-sub { color: #cbd5e1; font-size: 13px; line-height: 1.55; max-width: 470px; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 18px; }
.hero-actions .btn-primary { background: #2dd4bf; color: #042f2e; box-shadow: 0 8px 22px rgba(45, 212, 191, .25); }
.hero-actions .btn-primary:hover { background: #5eead4; }
.hero-actions .btn-ghost { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .18); color: #e2e8f0; }
.hero-actions .btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.hero-side {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
    min-width: 220px;
}
.hero-date {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    padding: 10px 13px; border-radius: 12px;
    backdrop-filter: blur(4px);
}
.hero-date .ico { color: #5eead4; width: 19px; height: 19px; }
.hero-date div { display: flex; flex-direction: column; line-height: 1.25; }
.hero-date span { font-size: 9.5px; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; }
.hero-date strong { font-size: 13px; }
.hero-store { display: flex; flex-direction: column; gap: 1px; padding: 0 3px; }
.hero-store span { font-size: 10px; letter-spacing: 1.5px; color: #5eead4; font-weight: 700; }
.hero-store strong { font-size: 11.5px; color: #cbd5e1; font-weight: 500; line-height: 1.35; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    padding: 15px; box-shadow: var(--shadow);
}
.stat-icon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.stat-icon .ico { width: 20px; height: 20px; }
.tone-teal { background: #ccfbf1; color: #0f766e; }
.tone-blue { background: #dbeafe; color: #1d4ed8; }
.tone-violet { background: #ede9fe; color: #6d28d9; }
.tone-amber { background: #fef3c7; color: #b45309; }
.stat-copy { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.stat-copy span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); font-weight: 700; }
.stat-copy strong { font-size: 25px; letter-spacing: -.7px; margin: 3px 0 1px; }
.stat-copy small { font-size: 10.5px; color: var(--muted-2); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 18px; align-items: start; }
.dashboard-grid .card { margin-bottom: 0; }
.dashboard-grid + .card { margin-top: 18px; }

.type-bars { display: flex; flex-direction: column; gap: 6px; }
.type-bar-row {
    display: flex; align-items: center; gap: 11px;
    text-decoration: none; color: inherit; padding: 8px;
    border-radius: 10px; transition: background .14s ease;
}
.type-bar-row:hover { background: #f8fafc; }
.type-bar-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.type-bar-icon .ico { width: 17px; height: 17px; }
.type-bar-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.type-bar-title { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.type-bar-title strong { font-weight: 600; }
.type-bar-title em { font-style: normal; font-weight: 700; color: var(--muted); }
.progress { display: block; height: 6px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; min-width: 0; }
.type-bar-pct { font-size: 10.5px; color: var(--muted); width: 34px; text-align: right; font-weight: 600; }

.quick-list { display: flex; flex-direction: column; gap: 4px; }
.quick-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px; border-radius: 10px; text-decoration: none; color: inherit;
}
.quick-item:hover { background: #f8fafc; }
.quick-icon { width: 35px; height: 35px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.quick-icon .ico { width: 17px; height: 17px; }
.quick-item > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.quick-item strong { font-size: 12px; }
.quick-item small { font-size: 10.5px; color: var(--muted); }
.quick-item > .ico { width: 15px; height: 15px; color: var(--muted-2); }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 9px; }
.team-item { display: flex; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--line-soft); border-radius: 10px; }
.team-copy { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.team-copy strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-copy small { font-size: 10px; color: var(--muted); }
.team-count { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.team-count strong { font-size: 17px; }
.team-count small { font-size: 9px; color: var(--muted-2); }

/* --------------------------------------------------------------------------
   Type colors / badges
   -------------------------------------------------------------------------- */
.type-1 { --tc: #e11d48; --tbg: #fff1f2; --tbd: #fecdd3; }
.type-2 { --tc: #2563eb; --tbg: #eff6ff; --tbd: #bfdbfe; }
.type-3 { --tc: #d97706; --tbg: #fffbeb; --tbd: #fde68a; }
.type-4 { --tc: #7c3aed; --tbg: #f5f3ff; --tbd: #ddd6fe; }

.type-bar-icon, .quick-icon.type-1, .quick-icon.type-2, .quick-icon.type-3, .quick-icon.type-4,
.type-pick-icon, .summary-type-icon, .report-kpi-icon, .type-pick.type-1 .type-pick-icon {
    background: var(--tbg); color: var(--tc);
}
.type-pick-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.type-pick-icon .ico { width: 21px; height: 21px; }
.progress > span.type-1 { background: #e11d48; }
.progress > span.type-2 { background: #2563eb; }
.progress > span.type-3 { background: #d97706; }
.progress > span.type-4 { background: #7c3aed; }

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 8px; border-radius: 999px;
    font-size: 10px; font-weight: 700; letter-spacing: .15px;
    background: #f1f5f9; color: var(--ink-soft); white-space: nowrap;
}
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.type-1 { background: #fff1f2; color: #be123c; }
.badge.type-2 { background: #eff6ff; color: #1d4ed8; }
.badge.type-3 { background: #fffbeb; color: #b45309; }
.badge.type-4 { background: #f5f3ff; color: #6d28d9; }
.badge-neutral { background: #f1f5f9; color: #475569; font-weight: 600; }
.badge-xs { font-size: 9px; padding: 2px 6px; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
    text-align: left; padding: 9px 10px;
    font-size: 9.5px; text-transform: uppercase; letter-spacing: .9px;
    color: var(--muted); font-weight: 700;
    background: #f8fafc; border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.data-table th:first-child { border-top-left-radius: 8px; }
.data-table th:last-child { border-top-right-radius: 8px; }
.data-table td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.data-table tbody tr:hover td { background: #fbfdff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table.compact td { padding: 9px 8px; }
.data-table.compact th { padding: 8px; }
.cell-title { display: block; font-weight: 600; font-size: 12.5px; line-height: 1.35; }
.cell-sub { display: block; color: var(--muted); font-size: 10.5px; line-height: 1.4; margin-top: 1px; }
.cell-meta { display: block; color: var(--muted-2); font-size: 10px; margin-top: 3px; line-height: 1.35; }
.cell-stack { display: block; }
.cell-date { display: block; font-size: 12px; white-space: nowrap; }
.cell-user { font-size: 11.5px; font-weight: 600; }
.cell-detail { font-size: 11px; color: var(--muted); }
.table-actions { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; }
.table-actions .btn { min-height: 30px; padding: 0 8px; font-size: 11px; }
.detail-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.detail-chip {
    display: inline-flex; align-items: baseline; gap: 4px;
    background: #f8fafc; border: 1px solid var(--line-soft);
    border-radius: 6px; padding: 2px 6px; font-size: 10.5px; line-height: 1.35;
}
.detail-chip em { font-style: normal; color: var(--muted-2); font-size: 9px; text-transform: uppercase; letter-spacing: .3px; }
.qty-pill { display: inline-flex; min-width: 26px; height: 23px; padding: 0 7px; align-items: center; justify-content: center; background: #f1f5f9; border-radius: 6px; font-weight: 700; font-size: 11px; }
.cell-actions { white-space: nowrap; }
.cell-actions .icon-action { margin-right: 3px; }
.th-actions { width: 1%; white-space: nowrap; }
.th-num, .td-num { text-align: right !important; }
.td-num { font-variant-numeric: tabular-nums; }

.user-inline { display: flex; align-items: center; gap: 8px; }
.user-inline strong { display: block; font-size: 12px; }
.user-inline small { display: block; color: var(--muted); font-size: 10px; }

.empty-state { text-align: center; padding: 38px 16px; }
.empty-icon {
    width: 54px; height: 54px; border-radius: 16px;
    background: #f1f5f9; color: var(--muted-2);
    display: inline-flex; align-items: center; justify-content: center; margin-bottom: 11px;
}
.empty-icon .ico { width: 25px; height: 25px; }
.empty-state h3 { font-size: 15px; margin-bottom: 4px; }
.empty-state p { color: var(--muted); font-size: 12px; margin-bottom: 15px; }
.empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Filters / summary strip / pagination
   -------------------------------------------------------------------------- */
.filter-card { padding: 14px; margin-bottom: 16px; }
.filter-grid { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.filter-grid .field { margin: 0; min-width: 132px; }
.filter-grid .field label { font-size: 10px; }
.filter-grid .field input, .filter-grid .field select { min-height: 38px; font-size: 12px; border-radius: 8px; }
.filter-grid .field-grow { flex: 1; min-width: 190px; }
.filter-actions { display: flex; align-items: center; gap: 7px; padding-bottom: 0; }
.filter-actions .btn { min-height: 38px; font-size: 12px; }

.summary-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.summary-total {
    display: flex; flex-direction: column; justify-content: center;
    background: #0b1220; color: #fff; border-radius: 12px;
    padding: 10px 15px; min-width: 130px; line-height: 1.05;
}
.summary-total span { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; font-weight: 700; }
.summary-total strong { font-size: 21px; margin: 3px 0; }
.summary-total small { font-size: 9px; color: #94a3b8; }
.summary-chip {
    display: flex; align-items: center; gap: 7px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: 8px 11px; text-decoration: none; color: inherit;
    min-height: 48px; transition: border-color .14s ease, background .14s ease;
}
.summary-chip:hover { border-color: var(--tbd); background: #fbfdff; }
.summary-chip.is-active { border-color: var(--tc); box-shadow: inset 0 0 0 1px var(--tc); }
.summary-chip > span {
    width: 29px; height: 29px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    background: var(--tbg); color: var(--tc);
}
.summary-chip > span .ico { width: 15px; height: 15px; }
.summary-chip strong { font-size: 15px; line-height: 1; }
.summary-chip small { font-size: 9.5px; color: var(--muted); line-height: 1.2; max-width: 80px; }

.table-card { padding: 18px; }
.card-tools { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.pagination {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding-top: 15px; margin-top: 4px; border-top: 1px solid var(--line-soft);
    flex-wrap: wrap;
}
.pagination-info { font-size: 11px; color: var(--muted); }
.pagination-links { display: flex; gap: 5px; flex-wrap: wrap; }
.page-link {
    display: inline-flex; align-items: center; gap: 3px;
    min-height: 31px; padding: 0 9px;
    border: 1px solid var(--line); border-radius: 7px;
    background: #fff; text-decoration: none; color: var(--ink-soft);
    font-size: 11px; font-weight: 600;
}
.page-link:hover { border-color: #99f6e4; color: var(--teal); }
.page-link.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }
.page-link .ico { width: 12px; height: 12px; }

.note-line {
    display: flex; align-items: flex-start; gap: 8px;
    color: var(--muted); font-size: 11px; line-height: 1.5; padding: 2px 4px 8px;
}
.note-line .ico { width: 15px; height: 15px; color: var(--teal); margin-top: 1px; }
.note-line a { color: var(--teal); font-weight: 600; }

/* --------------------------------------------------------------------------
   Report / summary
   -------------------------------------------------------------------------- */
.report-kpis { display: grid; grid-template-columns: 1.2fr repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.report-kpi {
    background: #fff; border: 1px solid var(--line); border-radius: 13px;
    padding: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
    text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.report-kpi.total { background: #0b1220; color: #fff; border-color: #0b1220; flex-direction: column; align-items: flex-start; justify-content: center; }
.report-kpi.total span { font-size: 9.5px; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; font-weight: 700; }
.report-kpi.total strong { font-size: 27px; line-height: 1; margin: 3px 0; }
.report-kpi.total small { color: #94a3b8; font-size: 9.5px; }
.report-kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.report-kpi-icon .ico { width: 17px; height: 17px; }
.report-kpi-copy { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.report-kpi-copy span { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.report-kpi-copy strong { font-size: 19px; margin-top: 2px; }
.report-kpi > small { width: 100%; font-size: 9.5px; color: var(--muted-2); padding-left: 43px; margin-top: -3px; }

.print-note {
    display: flex; gap: 12px; align-items: flex-start;
    background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 14px;
    padding: 15px; color: #115e59;
}
.print-note-icon { width: 36px; height: 36px; border-radius: 10px; background: #ccfbf1; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.print-note-icon .ico { width: 18px; height: 18px; }
.print-note strong { font-size: 12.5px; }
.print-note p { font-size: 11.5px; line-height: 1.55; margin-top: 3px; color: #134e4a; }

.summary-hero {
    display: grid; grid-template-columns: 1.15fr repeat(4, minmax(0, 1fr)); gap: 10px;
    margin-bottom: 16px;
}
.summary-hero-total {
    background: linear-gradient(140deg, #0b1220, #123536);
    color: #fff; border-radius: 14px; padding: 15px;
    display: flex; flex-direction: column; justify-content: center;
}
.summary-hero-total span { font-size: 9.5px; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; font-weight: 700; }
.summary-hero-total strong { font-size: 32px; line-height: 1; margin: 5px 0; letter-spacing: -1px; }
.summary-hero-total small { font-size: 9.5px; color: #94a3b8; }
.summary-type {
    background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px;
    display: flex; flex-direction: column; gap: 5px; box-shadow: var(--shadow);
}
.summary-type-head { display: flex; align-items: center; gap: 6px; font-size: 9.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.summary-type-icon { width: 24px; height: 24px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.summary-type-icon .ico { width: 13px; height: 13px; }
.summary-type > strong { font-size: 24px; line-height: 1; letter-spacing: -.5px; }
.summary-type small { font-size: 9.5px; color: var(--muted-2); }
.summary-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: 18px; align-items: start; }
.summary-grid .card { margin-bottom: 18px; }

.trend-chart {
    display: flex; align-items: flex-end; gap: 3px;
    height: 210px; padding: 8px 2px 0; border-bottom: 1px solid var(--line);
}
.trend-col { flex: 1; min-width: 4px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.trend-value { font-size: 8.5px; color: var(--muted); height: 11px; }
.trend-bar { width: 100%; max-width: 24px; background: linear-gradient(180deg, #2dd4bf, #0f766e); border-radius: 4px 4px 0 0; min-height: 3px; transition: height .25s ease; }
.trend-col:hover .trend-bar { background: #0f766e; }
.trend-label { font-size: 8px; color: var(--muted-2); height: 12px; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d7e0ea;
    border-radius: var(--radius-sm);
    background: #fff;
    padding: 9px 12px;
    color: var(--ink);
    font-size: 13px;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.field textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: #a8b4c4; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 0; border-color: #2dd4bf; box-shadow: 0 0 0 3px rgba(45, 212, 191, .16);
}
.field-help { font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.field-error { font-size: 10.5px; color: #be123c; font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row .field { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .32fr); gap: 18px; align-items: start; }
.form-grid-narrow { grid-template-columns: minmax(0, 640px) minmax(220px, .5fr); }
.form-card { padding: 0; overflow: hidden; }
.form-card-head { display: flex; align-items: center; gap: 11px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); background: #fbfdff; }
.form-card-head > div { flex: 1; min-width: 0; }
.form-card-head h2 { font-size: 14px; letter-spacing: -.15px; }
.form-card-head p { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.form-body { padding: 18px; }
.form-actions {
    display: flex; justify-content: flex-end; align-items: center; gap: 8px;
    padding: 13px 18px; border-top: 1px solid var(--line-soft); background: #fbfdff;
    flex-wrap: wrap;
}
.form-aside { position: sticky; top: calc(var(--topbar-h) + 16px); }
.aside-card { padding: 16px; }
.aside-card h3 { font-size: 12.5px; margin-bottom: 3px; }
.aside-card > p { font-size: 10.5px; color: var(--muted); line-height: 1.45; margin-bottom: 10px; }
.mini-dl { margin: 8px 0 0; display: flex; flex-direction: column; gap: 7px; }
.mini-dl > div { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; padding-bottom: 6px; border-bottom: 1px dashed var(--line-soft); }
.mini-dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.mini-dl dt { color: var(--muted); }
.mini-dl dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.aside-note {
    display: flex; gap: 7px; align-items: flex-start;
    background: #f0fdfa; border: 1px solid #ccfbf1; border-radius: 9px;
    padding: 9px; font-size: 10.5px; line-height: 1.45; color: #115e59; margin-top: 12px;
}
.aside-note .ico { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }
.delete-form { max-width: 640px; margin-top: -4px; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .ico { position: absolute; left: 12px; width: 17px; height: 17px; color: #94a3b8; pointer-events: none; }
.input-wrap input { padding-left: 39px; }
.input-action {
    position: absolute; right: 5px;
    width: 34px; height: 34px; border: 0; background: transparent;
    color: #64748b; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
}
.input-action:hover { background: #f1f5f9; color: var(--teal); }
.input-action .ico { width: 17px; height: 17px; }
.text-action { width: auto; padding: 0 9px; font-size: 11px; font-weight: 700; color: var(--teal); }
.input-suffix { display: flex; align-items: stretch; }
.input-suffix input { border-radius: 10px 0 0 10px; }
.input-suffix > span { display: flex; align-items: center; padding: 0 12px; background: #f8fafc; border: 1px solid #d7e0ea; border-left: 0; border-radius: 0 10px 10px 0; color: var(--muted); font-size: 12px; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix > span { display: flex; align-items: center; padding: 0 11px; background: #f8fafc; border: 1px solid #d7e0ea; border-right: 0; border-radius: 10px 0 0 10px; color: var(--muted); font-size: 12px; }
.input-prefix input { border-radius: 0 10px 10px 0; }

.optional { border-top: 1px solid var(--line-soft); }
.optional summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
    padding: 12px 18px; font-size: 12px; font-weight: 700; color: var(--ink-soft);
    background: #fbfdff;
}
.optional summary::-webkit-details-marker { display: none; }
.optional summary .ico { width: 16px; height: 16px; color: var(--muted); }
.optional summary span { font-weight: 500; color: var(--muted-2); font-size: 10.5px; margin-left: auto; }
.optional summary::after { content: "+"; font-size: 16px; color: var(--muted); font-weight: 400; }
.optional[open] summary::after { content: "–"; }
.optional-body { padding: 2px 18px 18px; }
.check-line { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; }
.check-line input { width: 17px; height: 17px; min-height: 0; margin-top: 1px; accent-color: var(--teal); flex: 0 0 auto; }
.check-line > span { display: flex; flex-direction: column; gap: 1px; }
.check-line strong { font-size: 11.5px; }
.check-line small { font-size: 10.5px; color: var(--muted); font-weight: 400; }
.inline-note { display: flex; align-items: flex-start; gap: 7px; background: #f8fafc; border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px; font-size: 11px; color: var(--muted); margin-top: 4px; }
.inline-note .ico { width: 15px; height: 15px; color: var(--teal); flex: 0 0 auto; }
.inline-note a { color: var(--teal); font-weight: 700; }

/* --------------------------------------------------------------------------
   Type picker / form preview
   -------------------------------------------------------------------------- */
.type-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 16px; }
.type-pick {
    display: flex; align-items: center; gap: 13px;
    background: #fff; border: 1px solid var(--line); border-radius: 14px;
    padding: 15px; text-decoration: none; color: inherit;
    box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.type-pick:hover { transform: translateY(-2px); border-color: var(--tbd); box-shadow: 0 14px 32px rgba(15, 23, 42, .09); }
.type-pick-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.type-pick-no { font-size: 9px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--tc); font-weight: 800; }
.type-pick-body strong { font-size: 13.5px; letter-spacing: -.15px; }
.type-pick-body > span:last-child { font-size: 11px; color: var(--muted); line-height: 1.45; }
.type-pick-arrow { width: 30px; height: 30px; border-radius: 50%; background: #f8fafc; display: flex; align-items: center; justify-content: center; color: var(--muted); flex: 0 0 auto; }
.type-pick-arrow .ico { width: 15px; height: 15px; }
.type-pick:hover .type-pick-arrow { background: var(--tbg); color: var(--tc); }

.info-strip {
    display: flex; gap: 11px; align-items: flex-start;
    background: #fff; border: 1px solid var(--line); border-radius: 13px;
    padding: 13px; margin-bottom: 16px;
}
.info-strip-icon { width: 34px; height: 34px; border-radius: 9px; background: #ccfbf1; color: #0f766e; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.info-strip-icon .ico { width: 17px; height: 17px; }
.info-strip strong { font-size: 12px; }
.info-strip p { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 2px; }

.mini-preview { display: flex; align-items: center; gap: 12px; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 11px; background: #fbfdff; }
.mini-preview-logo { font-family: Georgia, "Times New Roman", serif; font-weight: 700; color: #d71920; font-size: 22px; letter-spacing: -1px; border-right: 1px solid var(--line); padding-right: 12px; }
.mini-preview-copy { display: flex; flex-direction: column; min-width: 0; }
.mini-preview-copy strong { font-size: 11px; letter-spacing: .4px; }
.mini-preview-copy span { font-size: 10px; color: var(--muted); }

/* --------------------------------------------------------------------------
   Settings / signature editor
   -------------------------------------------------------------------------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .34fr); gap: 18px; align-items: start; }
.settings-preview { position: sticky; top: calc(var(--topbar-h) + 16px); }
.signature-editor { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px; }
.signature-row { display: flex; align-items: flex-end; gap: 8px; }
.signature-row .field { flex: 1; margin: 0; }
.signature-row .field-role { max-width: 96px; }
.signature-no { width: 23px; height: 23px; border-radius: 50%; background: #f1f5f9; color: var(--muted); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 9px; flex: 0 0 auto; }
.form-preview { border: 1px solid #111; border-radius: 2px; padding: 10px; background: #fff; font-family: Arial, sans-serif; }
.form-preview-top { position: relative; min-height: 38px; padding-left: 52px; }
.map-logo { position: absolute; left: 0; top: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 700; color: #d71920; font-size: 27px; letter-spacing: -1.5px; line-height: 1; }
.form-preview-title { text-align: center; font-size: 8.5px; font-weight: 700; letter-spacing: .2px; padding-top: 4px; line-height: 1.25; }
.form-preview-info { margin: 8px 0 6px 30px; font-size: 7.5px; }
.form-preview-info > div { display: flex; gap: 4px; padding: 1px 0; }
.form-preview-info dt { width: 40px; color: #333; }
.form-preview-info dd { margin: 0; font-weight: 700; }
.form-preview-table { display: grid; grid-template-columns: 12% 28% 32% 10% 18%; border: .6px solid #000; font-size: 6.5px; text-align: center; }
.form-preview-table span { border-right: .6px solid #000; padding: 2px 1px; font-weight: 700; background: #f1f1f1; }
.form-preview-table span:last-child { border-right: 0; }
.form-preview-sign { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; font-size: 6.5px; margin-top: 14px; gap: 3px; }
.form-preview-sign span { border-top: 1px solid #555; padding-top: 2px; }

/* --------------------------------------------------------------------------
   Users / account
   -------------------------------------------------------------------------- */
.generated-card {
    display: flex; gap: 13px; align-items: flex-start;
    background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
    border: 1px solid #a7f3d0; border-radius: 14px; padding: 15px; margin-bottom: 16px;
}
.generated-icon { width: 40px; height: 40px; border-radius: 11px; background: #ccfbf1; color: #0f766e; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.generated-icon .ico { width: 20px; height: 20px; }
.generated-copy { flex: 1; min-width: 0; }
.generated-copy > strong { font-size: 13.5px; }
.generated-copy > p { font-size: 11px; color: #475569; margin: 2px 0 9px; }
.credential-row { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.credential-row > span { font-size: 10px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); width: 68px; font-weight: 700; }
.credential-row code { background: #fff; border: 1px solid #d1fae5; border-radius: 7px; padding: 5px 9px; font-size: 13px; font-weight: 700; letter-spacing: .5px; color: #065f46; }
.role-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-size: 9.5px; font-weight: 700; white-space: nowrap; }
.role-admin { background: #ede9fe; color: #5b21b6; }
.role-store { background: #e0f2fe; color: #075985; }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; }
.status > span { width: 6px; height: 6px; border-radius: 50%; }
.status.is-on { color: #15803d; }
.status.is-on > span { background: #22c55e; }
.status.is-off { color: #9f1239; }
.status.is-off > span { background: #f43f5e; }
.role-info { display: flex; flex-direction: column; gap: 10px; margin-top: 9px; }
.role-info-item { border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px; }
.role-info-item p { font-size: 10.5px; color: var(--muted); line-height: 1.45; margin-top: 4px; }
.tip-list { margin: 9px 0 0 15px; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.tip-list li { margin-bottom: 4px; }
.reset-target { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); background: #fbfdff; }
.reset-target > div { display: flex; flex-direction: column; }
.reset-target strong { font-size: 13px; }
.reset-target small { font-size: 10.5px; color: var(--muted); }

.account-grid { display: grid; grid-template-columns: minmax(250px, .38fr) minmax(0, .62fr); gap: 18px; align-items: start; }
.profile-card { padding: 22px; }
.profile-head { display: flex; align-items: center; gap: 14px; padding-bottom: 15px; border-bottom: 1px solid var(--line-soft); }
.profile-head h2 { font-size: 18px; letter-spacing: -.3px; margin: 5px 0 1px; }
.profile-head p { font-size: 11.5px; color: var(--muted); }
.profile-list { margin: 14px 0 0; display: flex; flex-direction: column; gap: 9px; }
.profile-list > div { display: flex; justify-content: space-between; gap: 14px; font-size: 11.5px; }
.profile-list dt { color: var(--muted); }
.profile-list dd { margin: 0; text-align: right; font-weight: 600; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff; border-color: #fecdd3; }
.danger-zone h2 { font-size: 13.5px; color: #9f1239; }
.danger-zone p { font-size: 11px; color: var(--muted); margin-top: 2px; }
.danger-zone form { margin: 0; }

/* --------------------------------------------------------------------------
   Auth / login
   -------------------------------------------------------------------------- */
.auth-body {
    min-height: 100vh;
    background: #eef3f8;
}
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 46% 54%; }
.auth-aside {
    position: relative; overflow: hidden;
    background:
        radial-gradient(700px 420px at 105% 0%, rgba(45, 212, 191, .26), transparent 60%),
        radial-gradient(500px 300px at -10% 100%, rgba(59, 130, 246, .16), transparent 60%),
        linear-gradient(160deg, #0b1220, #0d2424 65%, #0a1f1d);
    color: #fff;
    padding: 46px;
    display: flex; flex-direction: column; justify-content: space-between;
}
.auth-aside::after {
    content: ""; position: absolute; right: -100px; bottom: -120px;
    width: 360px; height: 360px; border-radius: 50%;
    border: 1px solid rgba(94, 234, 212, .18);
    box-shadow: 0 0 0 45px rgba(94, 234, 212, .04), 0 0 0 90px rgba(94, 234, 212, .025);
}
.auth-aside-top { position: relative; z-index: 1; }
.auth-kicker { font-size: 10px; letter-spacing: 2.4px; color: #5eead4; font-weight: 700; margin: 36px 0 13px; }
.auth-aside h1 { font-size: 37px; line-height: 1.12; letter-spacing: -1.1px; font-weight: 700; }
.auth-lead { color: #cbd5e1; font-size: 13px; line-height: 1.65; max-width: 420px; margin-top: 15px; }
.auth-points { list-style: none; margin: 25px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.auth-points li { display: flex; gap: 9px; align-items: flex-start; color: #cbd5e1; font-size: 12px; }
.auth-points .ico { width: 16px; height: 16px; color: #5eead4; margin-top: 1px; flex: 0 0 auto; }
.auth-aside-bottom { position: relative; z-index: 1; }
.auth-store { display: flex; flex-direction: column; padding: 12px 0; border-top: 1px solid rgba(148, 163, 184, .18); }
.auth-store .store-code { font-size: 9.5px; letter-spacing: 1.6px; color: #5eead4; font-weight: 700; }
.auth-store strong { font-size: 11.5px; color: #e2e8f0; margin: 2px 0; }
.auth-store small { font-size: 10px; color: #94a3b8; }
.auth-aside-bottom > p { color: #64748b; font-size: 10px; letter-spacing: .6px; margin-top: 8px; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card {
    width: 100%; max-width: 430px; background: #fff;
    border: 1px solid var(--line); border-radius: 20px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
    padding: 30px;
}
.auth-mobile-brand { display: none; margin-bottom: 22px; }
.auth-card-head { margin-bottom: 20px; }
.auth-pill {
    display: inline-flex; align-items: center; gap: 5px;
    background: #f0fdfa; border: 1px solid #ccfbf1; color: #0f766e;
    padding: 4px 8px; border-radius: 999px; font-size: 9.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .8px;
}
.auth-pill .ico { width: 12px; height: 12px; }
.auth-card-head h2 { font-size: 24px; letter-spacing: -.55px; margin: 10px 0 4px; }
.auth-card-head p { color: var(--muted); font-size: 12px; }
.auth-form .field { margin-bottom: 14px; }
.auth-form .btn { margin-top: 4px; }
.auth-help { border-top: 1px solid var(--line-soft); margin-top: 19px; padding-top: 13px; }
.auth-help p { font-size: 10.5px; line-height: 1.55; color: var(--muted); }
.auth-help strong { color: var(--ink-soft); }
.auth-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; font-size: 9.5px; color: var(--muted-2); }

/* --------------------------------------------------------------------------
   Error / install
   -------------------------------------------------------------------------- */
.error-body {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(600px 320px at 100% 0%, rgba(45, 212, 191, .12), transparent 60%),
        #f4f7fb;
    padding: 24px;
}
.error-card, .install-card {
    width: 100%; max-width: 520px; background: #fff; border: 1px solid var(--line);
    border-radius: 18px; box-shadow: var(--shadow-lg); padding: 30px;
}
.error-icon { width: 50px; height: 50px; border-radius: 14px; background: #fff1f2; color: #be123c; display: flex; align-items: center; justify-content: center; margin-bottom: 13px; }
.error-icon .ico { width: 24px; height: 24px; }
.error-card h1, .install-card h1 { font-size: 22px; letter-spacing: -.4px; margin-bottom: 7px; }
.error-card p { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin-bottom: 18px; }
.install-card .brand { margin-bottom: 18px; }
.install-list { margin: 9px 0 0 17px; }
.install-list li { margin: 3px 0; font-size: 12px; }
.install-next { margin-top: 17px; display: flex; flex-direction: column; gap: 9px; }

/* --------------------------------------------------------------------------
   Bottom nav (mobile)
   -------------------------------------------------------------------------- */
.bottom-nav { display: none; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
    .report-kpis { grid-template-columns: 1fr 1fr 1fr; }
    .report-kpi.total { grid-column: span 1; }
    .summary-hero { grid-template-columns: 1fr 1fr 1fr; }
    .summary-hero-total { grid-column: span 3; flex-direction: row; align-items: center; gap: 12px; }
    .summary-hero-total strong { margin: 0; }
    .summary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
    :root { --sidebar-w: 0px; }
    .sidebar {
        transform: translateX(-104%);
        transition: transform .22s ease;
        width: 276px;
        box-shadow: 20px 0 60px rgba(2, 6, 23, .25);
    }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar-close, .menu-btn { display: inline-flex; }
    .main { margin-left: 0; }
    .topbar { padding: 10px 18px; }
    .content { padding: 20px 18px 40px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-grid .card { margin-bottom: 0; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .form-grid, .settings-grid, .account-grid { grid-template-columns: 1fr; }
    .form-aside, .settings-preview { position: static; }
    .hero { padding: 22px; }
    .hero h1 { font-size: 26px; }
    .hero-side { min-width: 190px; }
    .summary-grid { grid-template-columns: 1fr; }
    .type-picker { grid-template-columns: 1fr 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-main { padding: 26px 18px; }
    .auth-mobile-brand { display: block; }
    .auth-card { padding: 24px; border-radius: 16px; }
}

@media (max-width: 820px) {
    .content { padding: 16px 14px 96px; }
    .app-footer { display: none; }
    .bottom-nav {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 44;
        background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(14px);
        border-top: 1px solid var(--line);
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
        box-shadow: 0 -8px 26px rgba(15, 23, 42, .06);
    }
    .bottom-link {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        min-height: 48px; border-radius: 9px; text-decoration: none; color: var(--muted);
        font-size: 9.5px; font-weight: 600;
    }
    .bottom-link .ico { width: 20px; height: 20px; }
    .bottom-link.is-active { color: var(--teal); background: #f0fdfa; }
    .topbar-input { display: none; }
    .topbar { min-height: 66px; }
    .topbar-title strong { font-size: 16px; }
    .page-head { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
    .page-head h1 { font-size: 22px; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
    .card { padding: 15px; border-radius: 14px; }
    .stat-grid { gap: 9px; }
    .stat-card { padding: 12px; gap: 9px; }
    .stat-icon { width: 36px; height: 36px; border-radius: 9px; }
    .stat-copy strong { font-size: 21px; }
    .stat-copy span { font-size: 9px; }
    .hero { flex-direction: column; padding: 20px; border-radius: 16px; }
    .hero h1 { font-size: 24px; }
    .hero-side { flex-direction: row; flex-wrap: wrap; min-width: 0; }
    .hero-date { flex: 1; }
    .hero-store { flex: 1; justify-content: center; }
    .hero-actions .btn { flex: 1; }
    .type-picker { grid-template-columns: 1fr; }
    .type-pick { padding: 13px; }
    .report-kpis { grid-template-columns: 1fr 1fr; }
    .report-kpi.total { grid-column: span 2; }
    .summary-hero { grid-template-columns: 1fr 1fr; }
    .summary-hero-total { grid-column: span 2; }
    .filter-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
    .filter-grid .field, .filter-grid .field-grow { min-width: 0; }
    .filter-actions { grid-column: span 2; }
    .filter-actions .btn { flex: 1; }
    .card-head { flex-direction: column; align-items: flex-start; gap: 8px; }
    .card-tools { width: 100%; justify-content: flex-start; }
    .card-tools .btn { flex: 0 0 auto; }
    .summary-strip { gap: 6px; }
    .summary-total { width: 100%; flex-direction: row; align-items: baseline; gap: 8px; }
    .summary-total strong { font-size: 20px; }
    .summary-chip { flex: 1; min-width: 132px; }
    .type-bar-row { padding: 7px 4px; }
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr {
        border: 1px solid var(--line);
        border-radius: 12px;
        margin-bottom: 9px;
        padding: 4px 0;
        background: #fff;
        overflow: hidden;
    }
    .data-table td {
        display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
        padding: 6px 11px; border-bottom: 1px dashed var(--line-soft);
        text-align: right;
    }
    .data-table td:last-child { border-bottom: 0; }
    .data-table td::before {
        content: attr(data-label);
        font-size: 9px; text-transform: uppercase; letter-spacing: .7px;
        color: var(--muted-2); font-weight: 700; text-align: left; flex: 0 0 88px;
        padding-top: 2px;
    }
    .data-table td.cell-actions { justify-content: flex-end; }
    .data-table td.cell-actions::before { flex: 1; }
    .table-actions { justify-content: flex-end; }
    .data-table td > * { max-width: 72%; }
    .data-table td.cell-actions > * { max-width: none; }
    .data-table .detail-chips { justify-content: flex-end; }
    .data-table.compact td { padding: 6px 10px; }
    .data-table tbody tr:hover td { background: transparent; }
    .pagination { align-items: flex-start; }
    .pagination-links { width: 100%; }
    .page-link { flex: 1; justify-content: center; }
    .generated-card { flex-direction: column; }
    .credential-row > span { width: 100%; }
    .danger-zone { flex-direction: column; align-items: flex-start; }
    .danger-zone .btn { width: 100%; }
    .profile-head { align-items: flex-start; }
    .auth-card { padding: 20px; }
    .auth-card-head h2 { font-size: 21px; }
    .form-card-head { padding: 13px 14px; }
    .form-body { padding: 14px; }
    .form-actions { padding: 12px 14px; }
    .form-actions .btn { flex: 1; }
    .optional summary { padding: 11px 14px; }
    .optional-body { padding: 2px 14px 14px; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .field-row .field { margin-bottom: 14px; }
    .field-row .field:last-child { margin-bottom: 0; }
    .signature-row { flex-wrap: wrap; }
    .signature-row .field-role { max-width: none; flex: 1; }
    .trend-chart { height: 160px; }
    .trend-value { display: none; }
    .page-head p { font-size: 12px; }
    .table-card { padding: 13px; }
    .card-tools .btn { font-size: 11px; }
}

@media (max-width: 480px) {
    .topbar { padding: 9px 12px; }
    .topbar-eyebrow { display: none; }
    .content { padding: 13px 11px 92px; }
    .user-chip-copy { display: none; }
    .user-chip { padding: 4px; border-radius: 50%; }
    .user-chip > .ico { display: none; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { align-items: flex-start; }
    .stat-icon { width: 32px; height: 32px; }
    .stat-copy strong { font-size: 19px; }
    .report-kpis { grid-template-columns: 1fr 1fr; }
    .summary-hero { grid-template-columns: 1fr 1fr; }
    .summary-type > strong { font-size: 20px; }
    .filter-grid { grid-template-columns: 1fr; }
    .filter-actions { grid-column: span 1; }
    .summary-strip { display: grid; grid-template-columns: 1fr 1fr; }
    .summary-total { grid-column: 1 / -1; }
    .summary-chip { min-width: 0; }
    .summary-chip small { display: block; font-size: 9px; max-width: none; }
    .summary-chip strong { font-size: 14px; }
    .hero-side { flex-direction: column; }
    .page-actions .btn { font-size: 12px; }
    .page-actions { flex-wrap: wrap; }
    .auth-main { padding: 14px; }
    .auth-card { padding: 18px; border-radius: 14px; }
    .auth-foot { flex-direction: column; gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
