/* =========================================================
   NovaERP Yönetim Merkezi
   wwwroot/css/admin.css
   ========================================================= */

:root {
    --brand-950: #150E3A;
    --brand-900: #1E1450;
    --brand-800: #33208A;
    --brand-700: #4C2FC4;
    --brand-600: #6441E0;
    --brand-500: #7C5CEB;
    --brand-400: #9D84F2;
    --brand-300: #C2B3F7;
    --brand-200: #DCD3FB;
    --brand-100: #EEE9FE;
    --brand-50:  #F7F4FF;

    --bg: #F6F5FA;
    --surface: #FFFFFF;
    --surface-2: #FBFAFE;
    --border: #ECE9F3;
    --border-strong: #DDD8EA;
    --text: #221D3A;
    --text-2: #4D4866;
    --muted: #8A85A0;

    --green: #15924C;   --green-bg: #E8F7EE;
    --amber: #C2710C;   --amber-bg: #FDF3E3;
    --red: #D33A3A;     --red-bg: #FDECEC;
    --blue: #2F6FDB;    --blue-bg: #EAF1FD;
    --slate: #56607A;   --slate-bg: #EEF0F5;
    --gray: #7A7F8C;    --gray-bg: #F1F1F4;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(30, 20, 80, .04);
    --shadow: 0 1px 2px rgba(30, 20, 80, .04), 0 6px 20px rgba(30, 20, 80, .05);
    --shadow-lg: 0 20px 50px rgba(30, 20, 80, .16);

    --sidebar-w: 268px;
    --topbar-h: 68px;
    --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -.01em; }

.muted { color: var(--muted); }
.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; letter-spacing: .02em; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.hidden { display: none !important; }

/* =========================================================
   LAYOUT
   ========================================================= */

.app { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.sidebar-brand img { height: 36px; width: auto; }

.sidebar-brand .brand-text strong {
    display: block;
    font-size: 16px;
    font-weight: 800;
    color: var(--brand-900);
    letter-spacing: -.02em;
}

.sidebar-brand .brand-text strong span { color: var(--brand-600); }

.sidebar-brand .brand-text small {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--brand-600);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px 20px;
}

.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }

.nav-section { margin-top: 14px; }

.nav-section-title {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--muted);
    padding: 6px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    margin: 1px 0;
    border-radius: 10px;
    color: var(--text-2);
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, color .15s;
    position: relative;
}

.nav-item i { width: 18px; text-align: center; color: var(--muted); font-size: 14px; transition: color .15s; }
.nav-item:hover { background: var(--brand-50); color: var(--brand-800); }
.nav-item:hover i { color: var(--brand-600); }

.nav-item.active {
    background: var(--brand-100);
    color: var(--brand-800);
    font-weight: 700;
}

.nav-item.active i { color: var(--brand-600); }

.nav-item.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--brand-600);
}

.nav-item .soon {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    background: var(--gray-bg);
    padding: 1px 7px;
    border-radius: 20px;
}

.nav-item .count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    color: var(--amber);
    background: var(--amber-bg);
    padding: 0 8px;
    border-radius: 20px;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-footer .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }

.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ---------- Topbar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--topbar-h);
    background: rgba(246, 245, 250, .85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 28px;
}

.topbar .menu-toggle { display: none; }

.page-heading { min-width: 0; }
.page-heading h1 { font-size: 19px; color: var(--brand-950); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.breadcrumb { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand-600); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    cursor: pointer;
    position: relative;
    transition: border-color .15s, color .15s;
}

.icon-btn:hover { border-color: var(--brand-300); color: var(--brand-600); }

.icon-btn .badge-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--red);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
}

.env-chip {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--brand-700);
    background: var(--brand-100);
    border: 1px solid var(--brand-200);
    padding: 5px 11px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
}

.profile-btn:hover { border-color: var(--brand-300); }
.profile-btn .who { line-height: 1.2; text-align: left; }
.profile-btn .who strong { display: block; font-size: 13px; }
.profile-btn .who small { font-size: 11px; color: var(--muted); }

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 11.5px; }
.avatar.soft { background: var(--brand-100); color: var(--brand-700); }

/* ---------- Dropdown ---------- */

.dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    display: none;
    z-index: 60;
}

.dropdown.open .dropdown-menu { display: block; animation: pop .14s ease; }

.dropdown-menu .dd-header { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown-menu .dd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    color: var(--text-2);
    cursor: pointer;
    font-weight: 500;
    width: 100%;
    background: none;
    border: 0;
    text-align: left;
}
.dropdown-menu .dd-item:hover { background: var(--brand-50); color: var(--brand-800); }
.dropdown-menu .dd-item.danger { color: var(--red); }
.dropdown-menu .dd-item.danger:hover { background: var(--red-bg); }

.notif-menu { width: 380px; max-width: calc(100vw - 24px); padding: 0; }
.notif-menu .notif-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--surface-2); }
.notif-item .ni-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-item strong { display: block; font-size: 13px; }
.notif-item small { color: var(--muted); font-size: 12px; }

@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Content ---------- */

.content {
    padding: 26px 28px 40px;
    max-width: 1480px;
    width: 100%;
}

.fade-in { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* =========================================================
   COMPONENTS
   ========================================================= */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 0;
}

.card-head h3 { font-size: 15px; color: var(--brand-950); display: flex; align-items: center; gap: 8px; }
.card-head h3 i { color: var(--brand-500); font-size: 14px; }
.card-head .sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.card-body { padding: 18px 20px 20px; }
.card-body.flush { padding: 12px 0 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-dash-a { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.grid-dash-b { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.mt { margin-top: 18px; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}

.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
    background: var(--brand-600);
    color: #fff;
    box-shadow: 0 4px 12px rgba(100, 65, 224, .25);
}
.btn-primary:hover:not(:disabled) { background: var(--brand-700); color: #fff; }

.btn-light { background: var(--surface); border-color: var(--border-strong); color: var(--text-2); }
.btn-light:hover:not(:disabled) { border-color: var(--brand-300); color: var(--brand-700); }

.btn-soft { background: var(--brand-100); color: var(--brand-700); }
.btn-soft:hover:not(:disabled) { background: var(--brand-200); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b92f2f; }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--brand-50); color: var(--brand-700); }

.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn-icon { width: 32px; padding: 0; }

/* ---------- Forms ---------- */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }

.field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
}

.field label .req { color: var(--red); }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

.input, .select, .textarea {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A85A0' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

.input:focus, .select:focus, .textarea:focus {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 4px var(--brand-100);
}

.search-box { position: relative; }
.search-box i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.search-box .input { padding-left: 36px; }

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s, background .15s;
    font-weight: 500;
}

.check:hover { border-color: var(--brand-300); }
.check input { accent-color: var(--brand-600); width: 16px; height: 16px; margin: 0; }
.check.checked { border-color: var(--brand-400); background: var(--brand-50); color: var(--brand-800); }
.check i { color: var(--brand-500); width: 16px; text-align: center; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--border-strong); border-radius: 22px; cursor: pointer; transition: background .2s; }
.switch .slider::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.switch input:disabled + .slider { cursor: not-allowed; opacity: .6; }

.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented button {
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
}
.segmented button:hover { border-color: var(--brand-300); }
.segmented button.active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

/* ---------- Toolbar & chips ---------- */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar .search-box { width: 320px; max-width: 100%; }
.toolbar .spacer { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
    height: 34px;
    padding: 0 13px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-weight: 600;
    font-size: 12.5px;
    color: var(--text-2);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.chip:hover { border-color: var(--brand-300); }
.chip .n { font-size: 11px; background: var(--gray-bg); color: var(--muted); padding: 0 7px; border-radius: 10px; }
.chip.active { background: var(--brand-900); border-color: var(--brand-900); color: #fff; }
.chip.active .n { background: rgba(255, 255, 255, .18); color: #fff; }

/* ---------- Badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.5;
}

.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.no-dot::before { display: none; }

.b-green  { color: var(--green); background: var(--green-bg); }
.b-amber  { color: var(--amber); background: var(--amber-bg); }
.b-red    { color: var(--red);   background: var(--red-bg); }
.b-blue   { color: var(--blue);  background: var(--blue-bg); }
.b-slate  { color: var(--slate); background: var(--slate-bg); }
.b-gray   { color: var(--gray);  background: var(--gray-bg); }
.b-brand  { color: var(--brand-700); background: var(--brand-100); }

.plan-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
    font-size: 12.5px;
    white-space: nowrap;
}

.plan-pill .sw { width: 9px; height: 9px; border-radius: 3px; }

.status-dot { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.status-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.status-dot.online { color: var(--green); }
.status-dot.idle { color: #D79A10; }
.status-dot.offline { color: var(--red); }

.days {
    font-weight: 700;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }

table.table { width: 100%; border-collapse: collapse; }

.table th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    padding: 10px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    border-top: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-2);
}

.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table td strong { color: var(--text); font-weight: 600; }
.table td small { font-size: 11.5px; }
.table .cell-main { display: flex; align-items: center; gap: 10px; }
.table .cell-main small { display: block; color: var(--muted); font-size: 11.5px; }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }

.card > .table-wrap .table th:first-child,
.card > .table-wrap .table td:first-child { padding-left: 20px; }
.card > .table-wrap .table th:last-child,
.card > .table-wrap .table td:last-child { padding-right: 20px; }
.card > .table-wrap:first-child .table th { border-top: 0; }
.card > .table-wrap:first-child .table thead tr:first-child th:first-child { border-top-left-radius: var(--radius-lg); }
.card > .table-wrap:first-child .table thead tr:first-child th:last-child { border-top-right-radius: var(--radius-lg); }

.empty {
    text-align: center;
    padding: 44px 20px;
    color: var(--muted);
}

.empty i { font-size: 28px; color: var(--brand-300); margin-bottom: 10px; display: block; }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }

/* ---------- KPI ---------- */

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }

.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}

.kpi:hover { border-color: var(--brand-200); transform: translateY(-2px); box-shadow: var(--shadow); }

.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .kpi-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }

.kpi .kpi-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.kpi .kpi-value { font-size: 28px; font-weight: 800; letter-spacing: -.03em; color: var(--brand-950); line-height: 1; }
.kpi .kpi-sub { font-size: 11.5px; color: var(--muted); font-weight: 500; }

.i-brand { background: var(--brand-100); color: var(--brand-600); }
.i-green { background: var(--green-bg); color: var(--green); }
.i-amber { background: var(--amber-bg); color: var(--amber); }
.i-red   { background: var(--red-bg); color: var(--red); }
.i-blue  { background: var(--blue-bg); color: var(--blue); }
.i-slate { background: var(--slate-bg); color: var(--slate); }

/* ---------- Hero ---------- */

.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 22px 26px;
    margin-bottom: 18px;
    background:
        radial-gradient(600px 200px at 100% 0%, rgba(157, 132, 242, .35), transparent 60%),
        linear-gradient(120deg, #F3EEFF 0%, #FBF9FF 55%, #F0F6FF 100%);
    border: 1px solid var(--brand-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.hero h2 { font-size: 21px; color: var(--brand-950); }
.hero p { margin: 4px 0 0; color: var(--text-2); }
.hero .hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.hero::after {
    content: "";
    position: absolute;
    right: 210px;
    top: -30px;
    width: 120px;
    height: 120px;
    background: url("../img/novaerp-icon.png") no-repeat center / contain;
    opacity: .06;
    transform: rotate(-12deg);
    pointer-events: none;
}

/* ---------- Donut legend ---------- */

.donut-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 18px; align-items: center; }
.donut-box { position: relative; height: 170px; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center strong { font-size: 26px; font-weight: 800; color: var(--brand-950); line-height: 1; }
.donut-center small { font-size: 11.5px; color: var(--muted); }

.legend { display: flex; flex-direction: column; gap: 8px; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.legend-row:hover { background: var(--surface-2); }
.legend-row .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend-row .lbl { flex: 1; color: var(--text-2); font-weight: 500; }
.legend-row .val { font-weight: 700; color: var(--text); }
.legend-row .pct { font-size: 11.5px; color: var(--muted); width: 38px; text-align: right; }

/* ---------- Lists ---------- */

.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    border-top: 1px solid var(--border);
}

.list-row:first-child { border-top: 0; }
.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { background: var(--surface-2); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .grow small { color: var(--muted); font-size: 11.5px; }

.timeline { list-style: none; margin: 0; padding: 4px 20px 16px; }
.timeline li { position: relative; padding: 0 0 16px 24px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 18px; bottom: -2px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .tl-dot { position: absolute; left: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--brand-200); background: var(--brand-600); }
.timeline .tl-text { font-size: 13px; color: var(--text); font-weight: 500; }
.timeline .tl-meta { font-size: 11.5px; color: var(--muted); }

/* ---------- Progress ---------- */

.progress { height: 7px; background: var(--brand-50); border-radius: 10px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 10px; background: var(--brand-500); transition: width .4s ease; }
.progress.warn > span { background: #E3A02A; }
.progress.full > span { background: var(--red); }

/* ---------- Detail page ---------- */

.detail-head {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 22px 24px;
}

.detail-head .big-avatar {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
    color: #fff;
    font-weight: 800;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-head h2 { font-size: 21px; color: var(--brand-950); }
.detail-head .meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.detail-head .meta span { display: inline-flex; align-items: center; gap: 6px; }
.detail-head .head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.tabs { display: flex; gap: 4px; padding: 0 20px; border-top: 1px solid var(--border); overflow-x: auto; }
.tab {
    padding: 13px 14px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    display: inline-flex;
    gap: 7px;
    align-items: center;
}
.tab:hover { color: var(--brand-700); }
.tab.active { color: var(--brand-700); border-bottom-color: var(--brand-600); }
.tab .n { font-size: 11px; background: var(--gray-bg); color: var(--muted); border-radius: 10px; padding: 0 7px; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 14px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; color: var(--text); font-weight: 600; word-break: break-word; }

.key-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: var(--brand-50);
    border: 1px dashed var(--brand-300);
    border-radius: 12px;
}

.key-box .mono { font-size: 15px; font-weight: 700; color: var(--brand-800); }

.copy-btn {
    border: 0;
    background: transparent;
    color: var(--brand-600);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}
.copy-btn:hover { background: var(--brand-100); }

.module-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.module-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: var(--brand-50);
    color: var(--brand-800);
    border: 1px solid var(--brand-100);
}
.module-chip i { color: var(--brand-500); font-size: 11px; }

.usage { display: flex; flex-direction: column; gap: 6px; }
.usage-top { display: flex; justify-content: space-between; font-size: 12.5px; }
.usage-top span { color: var(--muted); font-weight: 500; }
.usage-top strong { font-weight: 700; }

.alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}
.alert i { margin-top: 2px; }
.alert.warn { background: var(--amber-bg); color: #8A4E05; }
.alert.danger { background: var(--red-bg); color: #9E2323; }
.alert.info { background: var(--brand-50); color: var(--brand-800); }

/* ---------- Plans ---------- */

.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }

.plan-card { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.plan-card .plan-bar { height: 5px; }
.plan-card .plan-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.plan-card h3 { font-size: 16.5px; color: var(--brand-950); }
.plan-card .price { font-size: 26px; font-weight: 800; color: var(--brand-950); letter-spacing: -.03em; }
.plan-card .price small { font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-card .limits { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-card ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 13px; }
.plan-card ul li { display: flex; gap: 8px; align-items: center; color: var(--text-2); }
.plan-card ul li i { color: var(--green); font-size: 12px; }
.plan-card .plan-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.plan-card.inactive { opacity: .6; }

.plan-select { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.plan-option {
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
    position: relative;
}
.plan-option:hover { border-color: var(--brand-300); }
.plan-option.active { border-color: var(--brand-600); background: var(--brand-50); box-shadow: 0 0 0 4px var(--brand-100); }
.plan-option .po-name { font-weight: 700; font-size: 13.5px; color: var(--brand-950); display: flex; align-items: center; gap: 8px; }
.plan-option .po-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.plan-option .po-check { position: absolute; top: 12px; right: 12px; color: var(--brand-600); display: none; }
.plan-option.active .po-check { display: block; }

/* ---------- License create ---------- */

.create-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.form-section { padding: 20px 22px; border-top: 1px solid var(--border); }
.form-section:first-child { border-top: 0; }
.form-section h4 { font-size: 14px; color: var(--brand-950); margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.form-section h4 .step { width: 24px; height: 24px; border-radius: 8px; background: var(--brand-100); color: var(--brand-700); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.form-section p.desc { margin: 0 0 14px 34px; color: var(--muted); font-size: 12.5px; }
.form-section .section-body { margin-left: 34px; }

.summary-card { position: sticky; top: calc(var(--topbar-h) + 20px); }
.summary-card .sum-head { padding: 20px; background: linear-gradient(135deg, var(--brand-700), var(--brand-500)); color: #fff; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.summary-card .sum-head small { opacity: .8; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; }
.summary-card .sum-head h3 { font-size: 18px; margin-top: 4px; }
.summary-card .sum-row { display: flex; justify-content: space-between; gap: 10px; padding: 11px 20px; border-top: 1px solid var(--border); font-size: 13px; }
.summary-card .sum-row:first-of-type { border-top: 0; }
.summary-card .sum-row span { color: var(--muted); }
.summary-card .sum-row strong { text-align: right; }
.summary-card .sum-foot { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); }

.success-key {
    text-align: center;
    padding: 10px 0 4px;
}
.success-key .ok-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: inline-flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 12px; }
.success-key .key-box { margin: 16px 0 6px; }
.success-key .key-box .mono { font-size: 18px; }

/* ---------- Coming soon ---------- */

.soon-card { text-align: center; padding: 64px 24px; }
.soon-card .soon-icon { width: 72px; height: 72px; border-radius: 22px; background: var(--brand-100); color: var(--brand-600); display: inline-flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 16px; }
.soon-card h2 { font-size: 20px; color: var(--brand-950); }
.soon-card p { color: var(--muted); max-width: 460px; margin: 8px auto 0; }

/* ---------- Permission matrix ---------- */

.matrix td.c, .matrix th.c { text-align: center; }
.matrix .yes { color: var(--green); }
.matrix .no { color: var(--border-strong); }

/* ---------- Modal ---------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(21, 14, 58, .38);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 60px 16px 20px;
    z-index: 100;
    overflow-y: auto;
    animation: fadeBg .15s ease;
}

@keyframes fadeBg { from { opacity: 0; } to { opacity: 1; } }

.modal {
    width: 100%;
    max-width: 560px;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    animation: pop .18s ease;
}

.modal.lg { max-width: 760px; }
.modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; color: var(--brand-950); }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--border); }

/* ---------- Toast ---------- */

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
    min-width: 280px;
    max-width: 380px;
    background: var(--brand-950);
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-weight: 500;
    animation: pop .2s ease;
}
.toast.success i { color: #6EE7A0; }
.toast.error i { color: #FF9A9A; }
.toast.info i { color: var(--brand-300); }

/* ---------- Loading ---------- */

.loading { padding: 60px 20px; text-align: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--brand-100); border-top-color: var(--brand-600); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton { background: linear-gradient(90deg, var(--brand-50), var(--brand-100), var(--brand-50)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Bars (system status) ---------- */

.bar-row { display: grid; grid-template-columns: 90px 1fr 40px; gap: 12px; align-items: center; font-size: 13px; padding: 6px 0; }
.bar-row .bar { height: 10px; background: var(--brand-50); border-radius: 10px; overflow: hidden; }
.bar-row .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); border-radius: 10px; }

.stat-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat-tile { padding: 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; gap: 14px; cursor: pointer; }
.stat-tile:hover { border-color: var(--brand-200); }
.stat-tile.active { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
.stat-tile .st-val { font-size: 24px; font-weight: 800; color: var(--brand-950); line-height: 1; }
.stat-tile .st-lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* ---------- Overlay (mobile) ---------- */

.overlay { display: none; }

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1400px) {
    .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
    .grid-dash-a, .grid-dash-b, .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .create-layout { grid-template-columns: minmax(0, 1fr); }
    .summary-card { position: static; }
    .grid-3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .overlay { display: block; position: fixed; inset: 0; background: rgba(21, 14, 58, .3); z-index: 45; }
    .main { margin-left: 0; }
    .topbar { padding: 0 16px; }
    .topbar .menu-toggle { display: inline-flex; }
    .content { padding: 18px 16px 32px; }
    .env-chip, .profile-btn .who { display: none; }
    .profile-btn { padding: 4px; }
}

@media (max-width: 640px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .donut-wrap { grid-template-columns: minmax(0, 1fr); }
    .donut-box { max-width: 200px; margin: 0 auto; }
    .kv { grid-template-columns: 1fr; gap: 2px 0; }
    .kv dd { margin-bottom: 8px; }
    .toolbar .search-box { width: 100%; }
    .stat-tiles { grid-template-columns: minmax(0, 1fr); }
    .form-section p.desc, .form-section .section-body { margin-left: 0; }
    .hero::after { display: none; }
    .breadcrumb { display: none; }
}

/* ---------- Kontör ---------- */

.credit-balance { font-weight: 800; font-size: 15px; color: var(--brand-950); }
.credit-balance.low { color: var(--red); }
.credit-amount.plus { color: var(--green); font-weight: 700; }
.credit-amount.minus { color: var(--red); font-weight: 700; }

.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.pkg-card { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.pkg-card .pkg-credits { font-size: 24px; font-weight: 800; color: var(--brand-950); letter-spacing: -.02em; }
.pkg-card .pkg-credits small { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.pkg-card .pkg-price { font-size: 15px; font-weight: 700; color: var(--brand-700); }
.pkg-card .pkg-meta { font-size: 12px; color: var(--muted); }
.pkg-card.inactive { opacity: .55; }

.usage-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; align-items: end; height: 170px; padding-top: 8px; }
.usage-bars .ub-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.usage-bars .ub-stack { width: 100%; max-width: 34px; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 2px 2px; overflow: hidden; background: var(--surface-2); }
.usage-bars .ub-in { background: var(--brand-300); }
.usage-bars .ub-out { background: var(--brand-600); }
.usage-bars .ub-val { font-size: 11px; font-weight: 700; color: var(--text-2); }
.usage-bars .ub-lbl { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.usage-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.usage-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--brand-600); }
.usage-legend span.in::before { background: var(--brand-300); }

@media (max-width: 640px) {
    .usage-bars { gap: 3px; }
    .usage-bars .ub-lbl { font-size: 9px; }
    .usage-bars .ub-val { display: none; }
}
