/* =====================================================================
   Inohype WP — Premium Design System (wp.inohype.com)
   Tokens + base + "ih-" prefixed components.
   Fonts : Plus Jakarta Sans (UI) · JetBrains Mono (code)
   Icons : Phosphor Icons (regular / bold / duotone)
   Theme : dark (default) · light → <html data-theme="light">
   ===================================================================== */

:root {
    color-scheme: dark;

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Brand */
    --brand: #7C5CFF;
    --brand-hover: #6B48FF;
    --brand-2: #4F7BFF;
    --brand-3: #14D3A0;
    --brand-soft: rgba(124, 92, 255, 0.14);
    --brand-border: rgba(124, 92, 255, 0.35);
    --grad: linear-gradient(135deg, #8B5CF6 0%, #4F7BFF 55%, #14D3A0 100%);
    --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, 0.16) 0%, rgba(79, 123, 255, 0.12) 55%, rgba(20, 211, 160, 0.12) 100%);

    /* Surfaces */
    --bg: #07080F;
    --bg-elev: #0B0D17;
    --surface: #0F121E;
    --surface-2: #151929;
    --surface-3: #1C2134;
    --surface-hover: rgba(255, 255, 255, 0.04);
    --overlay: rgba(4, 5, 12, 0.72);

    /* Lines */
    --line: rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.12);

    /* Text */
    --text: #EEF0F8;
    --text-2: #A6ACC4;
    --text-3: #6E7593;

    /* Status */
    --ok: #22C55E;
    --ok-soft: rgba(34, 197, 94, 0.13);
    --warn: #F5A524;
    --warn-soft: rgba(245, 165, 36, 0.14);
    --err: #F04461;
    --err-soft: rgba(240, 68, 97, 0.13);
    --inf: #38BDF8;
    --inf-soft: rgba(56, 189, 248, 0.13);

    /* Shape & depth */
    --r-xs: 6px;
    --r-sm: 10px;
    --r: 14px;
    --r-lg: 18px;
    --r-xl: 24px;
    --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --sh: 0 8px 24px -8px rgba(0, 0, 0, 0.55);
    --sh-lg: 0 24px 64px -16px rgba(0, 0, 0, 0.7);
    --sh-brand: 0 10px 30px -10px rgba(124, 92, 255, 0.65);
    --ring: 0 0 0 4px rgba(124, 92, 255, 0.22);
    --ease: cubic-bezier(.2, .8, .2, 1);

    /* Layout */
    --sidebar-w: 272px;
    --topbar-h: 68px;

    /* ---- Legacy aliases (dashboard.css / eski sayfalar bu isimleri kullanır) ---- */
    --primary: var(--brand);
    --primary-dark: var(--brand-hover);
    --primary-light: #9B85FF;
    --secondary: var(--brand-2);
    --accent: var(--brand-3);
    --danger: var(--err);
    --warning: var(--warn);
    --success: var(--ok);
    --info: var(--inf);
    --bg-primary: var(--bg);
    --bg-secondary: var(--bg-elev);
    --bg-tertiary: var(--surface-2);
    --bg-card: var(--surface);
    --bg-elevated: var(--surface-3);
    --text-primary: var(--text);
    --text-secondary: var(--text-2);
    --text-muted: var(--text-3);
    --text-disabled: #555B75;
    --border: var(--line);
    --border-light: var(--line-strong);
    --shadow-sm: var(--sh-sm);
    --shadow-md: var(--sh);
    --shadow-lg: var(--sh-lg);
    --shadow-xl: var(--sh-lg);
    --success-bg: var(--ok-soft);
    --danger-bg: var(--err-soft);
    --warning-bg: var(--warn-soft);
    --info-bg: var(--inf-soft);
    --radius-sm: var(--r-sm);
    --radius-md: var(--r);
    --radius-lg: var(--r-lg);
    --radius-xl: var(--r-xl);
    --transition-fast: .15s var(--ease);
    --transition-base: .25s var(--ease);
    --transition-slow: .45s var(--ease);
    --sidebar-width: var(--sidebar-w);
}

[data-theme="light"] {
    color-scheme: light;
    --brand: #6D4AFF;
    --brand-hover: #5A36F5;
    --brand-soft: rgba(109, 74, 255, 0.10);
    --brand-border: rgba(109, 74, 255, 0.30);
    --bg: #F5F6FB;
    --bg-elev: #EEF0F7;
    --surface: #FFFFFF;
    --surface-2: #F6F7FC;
    --surface-3: #EDEFF7;
    --surface-hover: rgba(15, 18, 34, 0.035);
    --overlay: rgba(15, 18, 34, 0.45);
    --line: rgba(15, 18, 34, 0.08);
    --line-strong: rgba(15, 18, 34, 0.14);
    --text: #0F1222;
    --text-2: #4A5070;
    --text-3: #8389A6;
    --text-disabled: #B3B8CC;
    --sh-sm: 0 1px 2px rgba(15, 18, 34, 0.06);
    --sh: 0 10px 30px -12px rgba(15, 18, 34, 0.18);
    --sh-lg: 0 30px 70px -20px rgba(15, 18, 34, 0.28);
    --sh-brand: 0 10px 30px -10px rgba(109, 74, 255, 0.45);
}

/* ============================ Base ============================ */

*, *::before, *::after { box-sizing: border-box; }

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

body.ih {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "ss01", "cv11";
}

/* :where() → sıfır özgüllük; bileşen sınıfları (.ih-btn, .ih-nav-item…) her zaman kazanır */
:where(body.ih) :where(a) { color: inherit; text-decoration: none; }
:where(body.ih) :where(button, input, select, textarea) { font: inherit; color: inherit; }
body.ih code, body.ih pre, body.ih kbd, .ih-mono { font-family: var(--font-mono); }
body.ih ::selection { background: rgba(124, 92, 255, 0.35); }

body.ih ::-webkit-scrollbar { width: 10px; height: 10px; }
body.ih ::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid var(--bg); }
body.ih ::-webkit-scrollbar-track { background: transparent; }

.ih-hidden, .hidden, body.ih [hidden] { display: none !important; }
.ph, .ph-bold, .ph-duotone, .ph-fill { display: inline-block; line-height: 1; }
.ih-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Ambient background */
.ih-ambient {
    position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.ih-ambient::before, .ih-ambient::after {
    content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55;
}
.ih-ambient::before { width: 560px; height: 560px; left: -160px; top: -200px; background: radial-gradient(circle, rgba(139,92,246,.55), transparent 65%); }
.ih-ambient::after { width: 520px; height: 520px; right: -180px; bottom: -220px; background: radial-gradient(circle, rgba(20,211,160,.35), transparent 65%); }
[data-theme="light"] .ih-ambient::before, [data-theme="light"] .ih-ambient::after { opacity: .28; }
.ih-grid-bg {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
    opacity: .6;
}

/* ============================ Logo ============================ */

.ih-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; font-size: 20px; color: var(--text); }
.ih-logo img { width: 36px; height: 36px; display: block; filter: drop-shadow(0 6px 16px rgba(124, 92, 255, .45)); }
.ih-logo .ih-logo-tag {
    font-size: 10.5px; font-weight: 800; letter-spacing: .08em; padding: 3px 7px; border-radius: 7px;
    color: #fff; background: var(--grad); line-height: 1.2;
}

/* ============================ Buttons ============================ */

.ih-btn {
    --_bg: var(--surface-2); --_fg: var(--text); --_bd: var(--line-strong);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; padding: 0 18px; border-radius: var(--r-sm);
    background: var(--_bg); color: var(--_fg); border: 1px solid var(--_bd);
    font-weight: 650; font-size: 14px; letter-spacing: -.005em; white-space: nowrap;
    cursor: pointer; user-select: none; text-decoration: none;
    transition: transform .15s var(--ease), background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), opacity .2s;
}
.ih-btn:hover { background: var(--surface-3); }
.ih-btn:active { transform: translateY(1px) scale(.99); }
.ih-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.ih-btn:disabled, .ih-btn[aria-busy="true"] { opacity: .6; cursor: not-allowed; }
.ih-btn i { font-size: 18px; }
.ih-btn--primary { --_fg: #fff; --_bd: transparent; background: var(--grad); box-shadow: var(--sh-brand), inset 0 1px 0 rgba(255,255,255,.22); background-size: 140% 140%; background-position: 0% 50%; }
.ih-btn--primary:hover { background: var(--grad); background-size: 140% 140%; background-position: 100% 50%; filter: brightness(1.06); }
.ih-btn--soft { --_bg: var(--brand-soft); --_fg: var(--brand); --_bd: var(--brand-border); }
[data-theme="dark"] .ih-btn--soft, :root:not([data-theme="light"]) .ih-btn--soft { --_fg: #B9A8FF; }
.ih-btn--soft:hover { background: rgba(124, 92, 255, .22); }
.ih-btn--ghost { --_bg: transparent; --_bd: transparent; --_fg: var(--text-2); }
.ih-btn--ghost:hover { background: var(--surface-hover); color: var(--text); }
.ih-btn--danger { --_bg: var(--err-soft); --_fg: var(--err); --_bd: rgba(240, 68, 97, .3); }
.ih-btn--danger:hover { background: rgba(240, 68, 97, .22); }
.ih-btn--ok { --_bg: var(--ok-soft); --_fg: var(--ok); --_bd: rgba(34, 197, 94, .3); }
.ih-btn--sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.ih-btn--sm i { font-size: 16px; }
.ih-btn--lg { height: 50px; padding: 0 22px; font-size: 15px; border-radius: var(--r); }
.ih-btn--block { width: 100%; }
.ih-btn--icon { width: 40px; padding: 0; }
.ih-btn--icon.ih-btn--sm { width: 34px; }

.ih-spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent;
    animation: ih-spin .7s linear infinite; display: inline-block; flex: none;
}
@keyframes ih-spin { to { transform: rotate(360deg); } }

/* ============================ Forms ============================ */

.ih-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.ih-label { font-size: 12.5px; font-weight: 650; color: var(--text-2); letter-spacing: .01em; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ih-hint { font-size: 12px; color: var(--text-3); }

.ih-input, .ih-select, .ih-textarea {
    width: 100%; height: 44px; padding: 0 14px;
    background: var(--surface-2); color: var(--text);
    border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    font-size: 14px; outline: none;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.ih-textarea { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.ih-select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='%238A90AD' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; }
.ih-input::placeholder, .ih-textarea::placeholder { color: var(--text-3); }
.ih-input:hover, .ih-select:hover, .ih-textarea:hover { border-color: rgba(124, 92, 255, .35); }
.ih-input:focus, .ih-select:focus, .ih-textarea:focus { border-color: var(--brand); box-shadow: var(--ring); background: var(--surface); }

.ih-input-wrap { position: relative; display: flex; align-items: center; }
.ih-input-wrap > i:first-child { position: absolute; left: 14px; font-size: 18px; color: var(--text-3); pointer-events: none; transition: color .2s; }
.ih-input-wrap > .ih-input { padding-left: 42px; }
.ih-input-wrap:focus-within > i:first-child { color: var(--brand); }
.ih-input-wrap .ih-input-action {
    position: absolute; right: 6px; height: 32px; width: 34px; border: 0; background: transparent;
    color: var(--text-3); border-radius: 8px; cursor: pointer; display: grid; place-items: center; font-size: 18px;
}
.ih-input-wrap .ih-input-action:hover { color: var(--text); background: var(--surface-hover); }

.ih-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.ih-form-grid .ih-span-2 { grid-column: 1 / -1; }

/* Switch */
.ih-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; color: var(--text-2); }
.ih-switch input { position: absolute; opacity: 0; pointer-events: none; }
.ih-switch .ih-switch-track { width: 40px; height: 23px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-strong); position: relative; transition: background .2s var(--ease); flex: none; }
.ih-switch .ih-switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .25s var(--ease); }
.ih-switch input:checked + .ih-switch-track { background: var(--brand); border-color: transparent; }
.ih-switch input:checked + .ih-switch-track::after { transform: translateX(17px); }
.ih-switch input:focus-visible + .ih-switch-track { box-shadow: var(--ring); }

/* OTP */
.ih-otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.ih-otp input {
    width: 100%; height: 56px; text-align: center; font-size: 22px; font-weight: 700; font-family: var(--font-mono);
    background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-sm); color: var(--text); outline: none;
    transition: border-color .2s, box-shadow .2s, transform .15s;
}
.ih-otp input:focus { border-color: var(--brand); box-shadow: var(--ring); transform: translateY(-1px); }
.ih-otp.is-error input { border-color: var(--err); animation: ih-shake .4s; }
@keyframes ih-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ============================ Cards ============================ */

.ih-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--sh-sm); position: relative; min-width: 0;
}
.ih-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ih-card-title { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.ih-card-title i { font-size: 20px; color: var(--brand); }
.ih-card-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }
.ih-card-body { padding: 20px; }
.ih-card-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.ih-glass { background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); }

/* Stat */
.ih-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ih-stat { padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); position: relative; overflow: hidden; }
.ih-stat::after { content: ""; position: absolute; inset: auto -40px -60px auto; width: 140px; height: 140px; border-radius: 50%; background: var(--_glow, rgba(124,92,255,.14)); filter: blur(30px); pointer-events: none; }
.ih-stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ih-stat-label { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.ih-stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; background: var(--brand-soft); color: var(--brand); }
.ih-stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.ih-stat-meta { margin-top: 6px; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.ih-stat--ok { --_glow: rgba(34,197,94,.14); } .ih-stat--ok .ih-stat-icon { background: var(--ok-soft); color: var(--ok); }
.ih-stat--warn { --_glow: rgba(245,165,36,.14); } .ih-stat--warn .ih-stat-icon { background: var(--warn-soft); color: var(--warn); }
.ih-stat--inf { --_glow: rgba(56,189,248,.14); } .ih-stat--inf .ih-stat-icon { background: var(--inf-soft); color: var(--inf); }
.ih-stat--err { --_glow: rgba(240,68,97,.14); } .ih-stat--err .ih-stat-icon { background: var(--err-soft); color: var(--err); }

/* ============================ Badges ============================ */

.ih-badge {
    display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
    background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line);
}
.ih-badge i { font-size: 13px; }
.ih-badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }
.ih-badge--ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(34,197,94,.25); }
.ih-badge--warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(245,165,36,.25); }
.ih-badge--err { background: var(--err-soft); color: var(--err); border-color: rgba(240,68,97,.25); }
.ih-badge--inf { background: var(--inf-soft); color: var(--inf); border-color: rgba(56,189,248,.25); }
.ih-badge--brand { background: var(--brand-soft); color: #A996FF; border-color: var(--brand-border); }
[data-theme="light"] .ih-badge--brand { color: var(--brand); }

/* ============================ Table ============================ */

.ih-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ih-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.ih-table th {
    text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
    color: var(--text-3); padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.ih-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ih-table tbody tr { transition: background .15s; }
.ih-table tbody tr:hover { background: var(--surface-hover); }
.ih-table tbody tr:last-child td { border-bottom: 0; }
.ih-table .ih-actions { display: flex; gap: 6px; justify-content: flex-end; }
.ih-table td.ih-right, .ih-table th.ih-right { text-align: right; }

.ih-user-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ih-avatar {
    width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center;
    font-weight: 800; font-size: 14px; color: #fff; background: var(--grad); text-transform: uppercase;
}
.ih-avatar--lg { width: 48px; height: 48px; border-radius: 14px; font-size: 18px; }
.ih-user-cell strong { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ih-user-cell span { display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ih-user-cell strong .ih-badge { display: inline-flex; vertical-align: 1px; color: var(--text-2); font-size: 10.5px; height: 19px; padding: 0 7px; margin-left: 4px; }

/* Dropdown menu */
.ih-menu { position: fixed; z-index: 2000; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-strong); box-shadow: var(--sh-lg); animation: ih-pop .16s var(--ease); }
.ih-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border: 0; background: transparent; color: var(--text); border-radius: 9px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left; }
.ih-menu-item i { font-size: 17px; color: var(--text-2); }
.ih-menu-item:hover:not(:disabled), .ih-menu-item:focus-visible { background: var(--surface-hover); outline: none; }
.ih-menu-item:disabled { opacity: .4; cursor: not-allowed; }
.ih-menu-item.is-danger, .ih-menu-item.is-danger i { color: var(--err); }
.ih-menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* Mobile: tables become stacked cards */
@media (max-width: 760px) {
    .ih-table--stack thead { display: none; }
    .ih-table--stack, .ih-table--stack tbody, .ih-table--stack tr, .ih-table--stack td { display: block; width: 100%; }
    .ih-table--stack tr { border: 1px solid var(--line); border-radius: var(--r); margin: 10px 0; padding: 6px 0; background: var(--surface); }
    .ih-table--stack td { border: 0; padding: 8px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
    .ih-table--stack td::before { content: attr(data-label); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); text-align: left; flex: none; }
    .ih-table--stack td[data-label=""]::before { content: none; }
    .ih-table--stack td.ih-cell-main { justify-content: flex-start; text-align: left; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 4px; }
    .ih-table--stack td.ih-cell-main::before { content: none; }
    .ih-table--stack .ih-actions { justify-content: flex-end; width: 100%; }
    .ih-table--stack tbody tr:hover { background: var(--surface); }
}

/* ============================ Modal ============================ */

.ih-modal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; }
.ih-modal.is-open { display: flex; }
.ih-modal-backdrop { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: ih-fade .2s var(--ease); }
.ih-modal-dialog {
    position: relative; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-xl); box-shadow: var(--sh-lg);
    animation: ih-pop .28s var(--ease);
}
.ih-modal-dialog--sm { max-width: 420px; }
.ih-modal-dialog--lg { max-width: 760px; }
.ih-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.ih-modal-head h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.ih-modal-head p { margin: 4px 0 0; color: var(--text-3); font-size: 13px; }
.ih-modal-body { padding: 18px 22px; overflow-y: auto; }
.ih-modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
@keyframes ih-fade { from { opacity: 0; } }
@keyframes ih-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@media (max-width: 640px) {
    .ih-modal { align-items: flex-end; padding: 0; }
    .ih-modal-dialog { max-width: 100% !important; border-radius: 22px 22px 0 0; max-height: 92vh; animation: ih-sheet .32s var(--ease); }
    .ih-modal-foot .ih-btn { flex: 1; }
    @keyframes ih-sheet { from { transform: translateY(100%); } }
}

/* ============================ Toast ============================ */

.ih-toasts, .toast-container {
    position: fixed; top: 20px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 10px;
    width: min(380px, calc(100vw - 32px)); pointer-events: none;
}
.ih-toast, .toast-container .toast {
    pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 14px 16px;
    background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r);
    box-shadow: var(--sh-lg); animation: ih-toast-in .35s var(--ease); position: relative; overflow: hidden;
}
.ih-toast::before, .toast-container .toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--_c, var(--brand)); }
.ih-toast > i, .toast-container .toast .toast-icon { font-size: 22px; color: var(--_c, var(--brand)); flex: none; margin-top: 1px; }
.ih-toast-title, .toast-container .toast-title { font-weight: 700; font-size: 13.5px; }
.ih-toast-msg, .toast-container .toast-message { font-size: 13px; color: var(--text-2); margin-top: 2px; word-break: break-word; }
.ih-toast-x, .toast-container .toast-close { margin-left: auto; border: 0; background: transparent; color: var(--text-3); cursor: pointer; padding: 2px; border-radius: 6px; font-size: 16px; }
.ih-toast-x:hover, .toast-container .toast-close:hover { color: var(--text); }
.ih-toast.is-out, .toast-container .toast.removing { animation: ih-toast-out .3s var(--ease) forwards; }
.ih-toast--success, .toast-container .toast.success { --_c: var(--ok); }
.ih-toast--error, .toast-container .toast.error { --_c: var(--err); }
.ih-toast--warning, .toast-container .toast.warning { --_c: var(--warn); }
.ih-toast--info, .toast-container .toast.info { --_c: var(--inf); }
@keyframes ih-toast-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes ih-toast-out { to { opacity: 0; transform: translateX(24px); } }
@media (max-width: 640px) { .ih-toasts, .toast-container { top: auto; bottom: 16px; right: 16px; left: 16px; width: auto; } }

/* ============================ App shell ============================ */

.ih-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.ih-sidebar {
    width: var(--sidebar-w); flex: none; position: fixed; inset: 0 auto 0 0; z-index: 900;
    display: flex; flex-direction: column; background: var(--bg-elev); border-right: 1px solid var(--line);
    transition: transform .3s var(--ease);
}
.ih-sidebar-head { height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line); }
.ih-sidebar-body { flex: 1; overflow-y: auto; padding: 14px 12px; }
.ih-sidebar-foot { padding: 12px; border-top: 1px solid var(--line); }

.ih-nav-label { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); padding: 14px 12px 8px; }
.ih-nav-item {
    display: flex; align-items: center; gap: 12px; padding: 0 12px; height: 42px; border-radius: 11px;
    color: var(--text-2); font-weight: 600; font-size: 14px; cursor: pointer; position: relative;
    border: 1px solid transparent; background: transparent; width: 100%; text-align: left;
    transition: background .15s, color .15s;
}
.ih-nav-item i { font-size: 20px; flex: none; }
.ih-nav-item:hover { background: var(--surface-hover); color: var(--text); }
.ih-nav-item.is-active { background: var(--brand-soft); color: var(--text); border-color: var(--brand-border); }
.ih-nav-item.is-active i { color: var(--brand); }
[data-theme="dark"] .ih-nav-item.is-active i, :root:not([data-theme="light"]) .ih-nav-item.is-active i { color: #A996FF; }
.ih-nav-item.is-active::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.ih-nav-count { margin-left: auto; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }

.ih-profile-chip { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.ih-profile-chip .ih-meta { min-width: 0; flex: 1; }
.ih-profile-chip strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ih-profile-chip span { display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ih-main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.ih-topbar {
    position: sticky; top: 0; z-index: 800; height: var(--topbar-h); display: flex; align-items: center; gap: 14px;
    padding: 0 28px; border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.ih-topbar-title { min-width: 0; }
.ih-topbar-title h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ih-topbar-title p { margin: 0; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ih-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ih-menu-btn { display: none; }
.ih-content { padding: 28px; width: 100%; max-width: 1440px; margin: 0 auto; }
.ih-section { display: none; animation: ih-section .35s var(--ease); }
.ih-section.is-active { display: block; }
@keyframes ih-section { from { opacity: 0; transform: translateY(6px); } }

.ih-sidebar-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 850; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }

@media (max-width: 1080px) {
    .ih-sidebar { transform: translateX(-100%); box-shadow: var(--sh-lg); }
    .ih-shell.is-nav-open .ih-sidebar { transform: none; }
    .ih-shell.is-nav-open .ih-sidebar-overlay { opacity: 1; pointer-events: auto; }
    .ih-main { margin-left: 0; }
    .ih-menu-btn { display: inline-flex; }
}
@media (max-width: 640px) {
    .ih-topbar { padding: 0 14px; gap: 10px; }
    .ih-content { padding: 16px; }
    .ih-topbar-title p { display: none; }
}

/* ============================ Layout helpers ============================ */

.ih-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ih-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ih-stack > * + * { margin-top: 20px; }
.ih-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.ih-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ih-grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; }
.ih-muted { color: var(--text-3); }
.ih-text-2 { color: var(--text-2); }
.ih-ok { color: var(--ok); } .ih-err { color: var(--err); } .ih-warn { color: var(--warn); }
.ih-grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ih-divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }
.ih-kbd { font-family: var(--font-mono); font-size: 12px; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--line-strong); }
.ih-code-inline { font-family: var(--font-mono); font-size: .9em; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: #C9BCFF; border: 1px solid var(--line); word-break: break-all; }
[data-theme="light"] .ih-code-inline { color: var(--brand); }

.ih-search { position: relative; min-width: 220px; }
.ih-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 17px; }
.ih-search .ih-input { padding-left: 38px; height: 40px; }

.ih-tabs { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); overflow-x: auto; max-width: 100%; }
.ih-tab { height: 34px; padding: 0 14px; border-radius: 9px; border: 0; background: transparent; color: var(--text-2); font-weight: 650; font-size: 13px; cursor: pointer; white-space: nowrap; }
.ih-tab:hover { color: var(--text); }
.ih-tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--sh-sm); border: 1px solid var(--line-strong); }

.ih-empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.ih-empty i { font-size: 44px; color: var(--text-3); opacity: .7; display: block; margin-bottom: 10px; }
.ih-empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.ih-skel { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: ih-skel 1.4s ease infinite; height: 14px; }
@keyframes ih-skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.ih-alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface-2); font-size: 13.5px; color: var(--text-2); }
.ih-alert > i { font-size: 20px; flex: none; margin-top: 1px; }
.ih-alert strong { color: var(--text); }
.ih-alert--warn { background: var(--warn-soft); border-color: rgba(245,165,36,.28); } .ih-alert--warn > i { color: var(--warn); }
.ih-alert--inf { background: var(--inf-soft); border-color: rgba(56,189,248,.28); } .ih-alert--inf > i { color: var(--inf); }
.ih-alert--err { background: var(--err-soft); border-color: rgba(240,68,97,.28); } .ih-alert--err > i { color: var(--err); }
.ih-alert--ok { background: var(--ok-soft); border-color: rgba(34,197,94,.28); } .ih-alert--ok > i { color: var(--ok); }

/* Progress */
.ih-progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.ih-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width .6s var(--ease); }

/* Bar chart (pure CSS) */
.ih-bars { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 10px; }
.ih-bar { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.ih-bar-fill { width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: var(--grad); min-height: 4px; position: relative; transition: height .7s var(--ease); opacity: .9; }
.ih-bar:hover .ih-bar-fill { opacity: 1; filter: brightness(1.1); }
.ih-bar-fill[data-v]::after { content: attr(data-v); position: absolute; top: -24px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--text-2); opacity: 0; transition: opacity .2s; white-space: nowrap; }
.ih-bar:hover .ih-bar-fill::after { opacity: 1; }
.ih-bar-label { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }

/* Activity list */
.ih-feed { list-style: none; margin: 0; padding: 0; }
.ih-feed li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.ih-feed li:last-child { border-bottom: 0; }
.ih-feed-icon { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); font-size: 17px; border: 1px solid var(--line); }
.ih-feed-text { min-width: 0; font-size: 13px; }
.ih-feed-text strong { font-weight: 700; }
.ih-feed-text span { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Responsive grids */
@media (max-width: 1200px) { .ih-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ih-grid-main { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .ih-grid-2, .ih-grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
    .ih-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
    .ih-stat { padding: 14px; }
    .ih-stat-value { font-size: 22px; }
    .ih-form-grid { grid-template-columns: 1fr; }
    .ih-search { min-width: 0; width: 100%; }
    .ih-otp { gap: 7px; }
    .ih-otp input { height: 50px; font-size: 20px; }
}

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