:root {
    --bg: #f6f8fc;
    --panel: #ffffff;
    --panel-2: #f9fbff;
    --text: #172033;
    --muted: #69758a;
    --line: #e5eaf3;
    --primary: #4f46e5;
    --primary-2: #7c3aed;
    --primary-soft: #eef2ff;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --dark: #0f172a;
    --shadow: 0 18px 50px rgba(15, 23, 42, .08);
    --radius: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(79,70,229,.13), transparent 34rem),
        radial-gradient(circle at top right, rgba(124,58,237,.11), transparent 32rem),
        var(--bg);
    color: var(--text);
    font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
    width: min(960px, 100%);
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: rgba(255,255,255,.84);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,.65);
    border-radius: 34px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.auth-hero {
    padding: 46px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(15,23,42,.93), rgba(79,70,229,.88)),
        radial-gradient(circle at 20% 20%, rgba(255,255,255,.2), transparent 20rem);
}
.auth-hero h1 { font-size: 42px; line-height: 1.05; margin: 0 0 16px; letter-spacing: -.04em; }
.auth-hero p { color: rgba(255,255,255,.78); font-size: 16px; line-height: 1.7; }
.auth-form { padding: 46px; }
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 286px;
    position: fixed;
    inset: 16px auto 16px 16px;
    background: rgba(15,23,42,.94);
    color: #fff;
    border-radius: 28px;
    padding: 18px;
    box-shadow: 0 22px 70px rgba(15,23,42,.28);
    overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 12px 12px 18px; }
.brand-logo {
    width: 44px; height: 44px; border-radius: 15px;
    display: grid; place-items: center; font-weight: 900;
    background: linear-gradient(135deg, #fff, #c7d2fe);
    color: var(--primary);
}
.brand-title { font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.brand-sub { color: rgba(255,255,255,.55); font-size: 12px; margin-top: 2px; }
.nav-section { margin: 16px 8px 8px; color: rgba(255,255,255,.42); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 12px;
    border-radius: 15px;
    color: rgba(255,255,255,.72);
    margin: 3px 0;
    transition: .18s ease;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.12); color: #fff; }
.nav-ico { width: 25px; text-align: center; opacity: .95; }
.main { flex: 1; margin-left: 318px; padding: 22px 26px 36px 0; }
.topbar {
    min-height: 76px;
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(255,255,255,.74);
    backdrop-filter: blur(18px);
    border-radius: 26px;
    padding: 16px 20px;
    box-shadow: 0 10px 35px rgba(15,23,42,.05);
}
.page-title h1 { margin: 0; font-size: 26px; letter-spacing: -.035em; }
.page-title p { margin: 5px 0 0; color: var(--muted); }
.userbar { display: flex; align-items: center; gap: 10px; }
.avatar { width: 42px; height: 42px; border-radius: 15px; background: var(--dark); color: #fff; display: grid; place-items: center; font-weight: 800; }
.content { padding-top: 22px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(255,255,255,.78);
    border-radius: var(--radius);
    box-shadow: 0 14px 36px rgba(15,23,42,.06);
    padding: 20px;
}
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title h2 { font-size: 18px; margin: 0; letter-spacing: -.02em; }
.kpi { position: relative; overflow: hidden; min-height: 132px; }
.kpi::after { content: ''; position: absolute; width: 140px; height: 140px; right: -52px; top: -62px; border-radius: 999px; background: linear-gradient(135deg, rgba(79,70,229,.17), rgba(124,58,237,.08)); }
.kpi-label { color: var(--muted); font-weight: 700; }
.kpi-value { font-size: 28px; font-weight: 900; letter-spacing: -.04em; margin-top: 12px; }
.kpi-note { color: var(--muted); margin-top: 8px; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn {
    border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 14px; border-radius: 14px; cursor: pointer;
    background: var(--primary); color: #fff; font-weight: 800; min-height: 40px;
    box-shadow: 0 10px 24px rgba(79,70,229,.18);
}
.btn:hover { filter: brightness(.98); transform: translateY(-1px); }
.btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.danger { background: var(--danger); box-shadow: 0 10px 24px rgba(220,38,38,.14); }
.btn.soft { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
.table-wrap { overflow: auto; border-radius: 18px; border: 1px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 880px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--panel-2); color: #4b5565; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
tr:hover td { background: #fbfcff; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #eef2ff; color: #4338ca; }
.badge.green { background: #ecfdf5; color: #047857; }
.badge.red { background: #fef2f2; color: #b91c1c; }
.badge.orange { background: #fff7ed; color: #c2410c; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
label { color: #334155; font-weight: 800; font-size: 13px; }
input, select, textarea {
    width: 100%; border: 1px solid var(--line); background: #fff; color: var(--text);
    border-radius: 14px; padding: 12px 13px; outline: none; transition: .15s ease;
}
textarea { min-height: 98px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,.10); }
.help { color: var(--muted); font-size: 12px; line-height: 1.5; }
.alert { border-radius: 18px; padding: 13px 15px; margin-bottom: 14px; border: 1px solid; line-height: 1.55; }
.alert.success { background: #ecfdf5; color: #065f46; border-color: #bbf7d0; }
.alert.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert.warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; min-width: 170px; }
.lang-switch { display: flex; gap: 5px; background: #fff; border: 1px solid var(--line); padding: 4px; border-radius: 14px; }
.lang-switch a { padding: 7px 9px; border-radius: 10px; color: var(--muted); font-weight: 800; }
.lang-switch a.active { background: var(--primary); color: #fff; }
.mobile-toggle { display: none; }
.footer { color: var(--muted); font-size: 12px; text-align: center; padding: 22px; }
.empty { text-align: center; padding: 34px; color: var(--muted); }
.soft-panel { background: linear-gradient(135deg, #fff, #f8faff); border-radius: 20px; padding: 18px; border: 1px solid var(--line); }
@media (max-width: 1040px) {
    .sidebar { transform: translateX(-110%); z-index: 20; transition: .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; padding: 16px; }
    .mobile-toggle { display: inline-flex; }
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .auth-card { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
}
@media (max-width: 560px) {
    .topbar { align-items: flex-start; flex-direction: column; }
    .userbar { width: 100%; justify-content: space-between; }
    .auth-form { padding: 28px; }
    .kpi-value { font-size: 24px; }
}
