:root {
    --bg: #06081d;
    --bg-2: #0a1033;
    --sidebar: #0d1232;
    --panel: #11173f;
    --panel-2: #121947;
    --border: rgba(255, 255, 255, .08);
    --muted: #8f95c4;
    --text: #eef1ff;
    --primary: #4268ff;
    --primary-2: #5e7cff;
    --success: #21d07a;
    --warning: #ffb649;
    --danger: #ff5475;
    --shadow: 0 24px 60px rgba(0,0,0,.35);
    --radius: 22px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(180deg, #070a21 0%, #050719 100%);
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 275px;
    background: linear-gradient(180deg, #0d1232 0%, #0c1030 100%);
    border-right: 1px solid var(--border);
    padding: 24px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 20;
}
.sidebar-brand-wrap {
    margin: -4px -4px 26px;
    padding: 6px 4px 22px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand { display:flex; align-items:center; gap: 14px; }
.brand-logo {
    width: 58px; height: 58px; display:block; flex: 0 0 auto;
    filter: drop-shadow(0 14px 24px rgba(88,108,255,.26));
}
.brand-stack { min-width: 0; }
.brand-name {
    font-weight: 800; font-size: 1.28rem; line-height: 1.05; letter-spacing: .02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-sub, .mini-card-label, .mini-card-meta, .eyebrow, .table-subtitle, .widget-label, .soft-text, .profile-role, .breadcrumb-text, .stat-subtitle { color: var(--muted); }
.brand-sub { margin-top: 4px; font-size: .96rem; }
.brand-tags { display:flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.brand-tags span {
    display:inline-flex; align-items:center; height: 28px; padding: 0 10px; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03); color: #dfe5ff;
    font-size: .74rem; font-weight: 700; letter-spacing: .03em;
}
.sidebar-group-title { text-transform: uppercase; font-size: .72rem; letter-spacing: .18em; color: #7f89bf; margin-bottom: 14px; padding-left: 2px; }
.sidebar-nav { display: grid; gap: 8px; }
.sidebar-link {
    display:flex; align-items:center; gap: 14px; padding: 14px 16px; border-radius: 18px;
    border: 1px solid transparent; color: #dbe0ff; font-weight: 500;
    transition: .2s ease;
}
.sidebar-link:hover, .sidebar-link.active {
    background: linear-gradient(135deg, rgba(66,104,255,.18), rgba(66,104,255,.08));
    border-color: rgba(66,104,255,.3);
}
.sidebar-divider { height: 1px; background: var(--border); margin: 28px 0; }
.sidebar-mini-card {
    background: linear-gradient(180deg, rgba(18,24,62,.95), rgba(15,20,52,.95));
    border: 1px solid var(--border);
    border-radius: 20px; padding: 18px; box-shadow: var(--shadow);
    position: relative; overflow: hidden;
}
.sidebar-mini-card::after {
    content: ''; position: absolute; inset: auto -20px -30px auto; width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(94,124,255,.18), transparent 70%);
}

.mini-card-value { font-size: 2rem; font-weight: 800; margin: 6px 0; }
.app-main { flex: 1; min-width: 0; }
.topbar {
    height: 96px; display:flex; justify-content:space-between; align-items:center; gap: 18px;
    background: rgba(7,10,33,.92); backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,.05);
    padding: 22px 30px; position: sticky; top: 0; z-index: 15;
}
.topbar-left, .topbar-right { display:flex; align-items:center; gap: 14px; }
.menu-toggle {
    border: 0; padding: 14px 20px; border-radius: 16px; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    display:flex; align-items:center; gap: 10px; font-weight: 700;
    box-shadow: 0 18px 34px rgba(66,104,255,.32);
}
.topbar-search {
    min-width: 280px; width: min(480px, 48vw); display:flex; align-items:center; gap: 12px;
    background: rgba(17,23,63,.96); border:1px solid var(--border); border-radius: 18px; padding: 14px 18px;
}
.topbar-search input {
    width:100%; border: 0; outline: 0; background: transparent; color: #fff;
}
.topbar-search input::placeholder { color: var(--muted); }
.icon-bubble {
    width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border);
    background: rgba(17,23,63,.96); display:grid; place-items:center; position: relative;
}
.icon-bubble span {
    position:absolute; top: 6px; right: 4px; min-width: 20px; height: 20px; border-radius: 999px;
    padding: 0 5px; background: var(--danger); color: #fff; font-size: .72rem; display:grid; place-items:center;
    border: 2px solid #0a1033;
}
.icon-bubble span.hidden { display: none; }
.soft-dot {
    position:absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
}
.profile-btn {
    border: 0; background: transparent; color: #fff; display:flex; align-items:center; gap: 12px;
}
.profile-avatar {
    width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, #edf0ff, #8fa4ff);
    color: #11173f; display:grid; place-items:center; font-weight: 800;
}
.profile-name { font-weight: 700; text-align: left; }
.soft-dropdown { background: #0f1538; border-color: var(--border); }
.content-area { padding: 28px 30px 36px; }
.content-header { display:flex; justify-content:space-between; gap: 18px; align-items:flex-start; margin-bottom: 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; margin-bottom: 6px; }
.page-title { margin: 0; font-size: clamp(2rem, 3vw, 3.1rem); font-weight: 800; }
.custom-alert {
    padding: 14px 18px; border-radius: 18px; margin-bottom: 18px; border: 1px solid transparent;
    background: rgba(17,23,63,.96);
}
.custom-alert-success { border-color: rgba(33,208,122,.3); color: #d6ffe6; }
.custom-alert-warning { border-color: rgba(255,182,73,.32); color: #fff1cf; }
.custom-alert-danger { border-color: rgba(255,84,117,.35); color: #ffdbe2; }
.custom-alert-info { border-color: rgba(66,104,255,.35); color: #dde4ff; }
.card-panel, .widget-panel, .form-panel, .table-panel, .hero-panel, .chat-panel {
    background: linear-gradient(180deg, rgba(17,23,63,.98), rgba(14,19,52,.98));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.grid-stats { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 22px; }
.stat-card { padding: 22px; display:flex; align-items:center; gap: 16px; min-height: 152px; }
.stat-icon {
    width: 58px; height: 58px; border-radius: 18px; display:grid; place-items:center; font-size: 1.45rem;
    background: rgba(66,104,255,.12); color: #8ea2ff;
}
.stat-icon.success { background: rgba(33,208,122,.12); color: var(--success); }
.stat-icon.warning { background: rgba(255,182,73,.14); color: var(--warning); }
.stat-icon.danger { background: rgba(255,84,117,.12); color: #ff8aa3; }
.stat-title { font-size: 2rem; font-weight: 800; margin: 4px 0; }
.hero-panel { padding: 26px; margin-bottom: 22px; }
.hero-grid, .dashboard-grid { display:grid; gap: 20px; }
.hero-grid { grid-template-columns: 1.15fr .85fr; align-items: stretch; }
.dashboard-grid { grid-template-columns: 1.5fr 1fr; margin-bottom: 22px; }
.hero-title { font-size: clamp(1.8rem, 2.4vw, 2.8rem); font-weight: 800; margin-bottom: 10px; max-width: 880px; }
.hero-actions { display:flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.btn-modern, .btn-outline-modern, .btn-danger-modern {
    border-radius: 16px; padding: 13px 18px; font-weight: 700; display:inline-flex; align-items:center; gap: 10px;
    border: 1px solid transparent;
}
.btn-modern { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 14px 30px rgba(66,104,255,.28); }
.btn-outline-modern { background: transparent; color: #d9e0ff; border-color: var(--border); }
.btn-danger-modern { background: linear-gradient(135deg, #ff5475, #ff7b6b); color: #fff; }
.widget-panel, .table-panel, .form-panel { padding: 22px; }
.widget-header { display:flex; justify-content:space-between; align-items:center; gap: 14px; margin-bottom: 16px; }
.widget-title { margin: 0; font-size: 1.14rem; font-weight: 700; }
.widget-value { font-size: 2.15rem; font-weight: 800; margin-top: 6px; }
.filter-badge {
    padding: 12px 16px; border-radius: 16px; background: rgba(255,255,255,.02);
    border: 1px solid var(--border); color: #dbe0ff;
}
.chart-box { height: 360px; }
.chart-box-sm { height: 360px; }
.form-control, .form-select, textarea {
    background: rgba(255,255,255,.03) !important;
    color: #fff !important; border: 1px solid var(--border) !important;
    border-radius: 16px !important; padding: 14px 16px !important; box-shadow: none !important;
}
.form-control::placeholder, textarea::placeholder { color: #7f87b8 !important; }
.form-label { color: #dfe4ff; margin-bottom: 8px; }
.table-dark { --bs-table-bg: transparent; --bs-table-border-color: rgba(255,255,255,.06); }
.table-dark td, .table-dark th { padding: 16px 12px; }
.table-responsive { border-radius: 18px; overflow: hidden; }
.info-tile {
    background: rgba(255,255,255,.025); border: 1px solid var(--border); border-radius: 18px; padding: 18px;
}
.info-value { font-size: 1.4rem; font-weight: 800; margin-top: 6px; }
.empty-state { padding: 48px 20px; text-align: center; }
.server-list-grid { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.server-card { padding: 22px; height: 100%; }
.server-card h3 { font-size: 1.1rem; margin: 0; }
.badge-soft {
    background: rgba(66,104,255,.12); border:1px solid rgba(66,104,255,.24); color:#d5deff;
    border-radius: 999px; padding: 8px 12px; font-size: .86rem;
}
.cfx-box { word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace; color: #dfe4ff; }
.footer-bar {
    border-top: 1px solid rgba(255,255,255,.05); color: var(--muted);
    padding: 18px 30px; display:flex; justify-content:space-between; gap: 16px;
}
.login-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.auth-card { padding: 24px; }
.soft-list { display:grid; gap: 12px; }
.soft-list-item { padding: 14px 16px; border-radius: 16px; border:1px solid var(--border); background: rgba(255,255,255,.02); }
.notification-list, .ticket-list { display:grid; gap: 14px; }
.notification-item, .ticket-item {
    border:1px solid var(--border); background: rgba(255,255,255,.02); border-radius: 18px; padding: 16px 18px;
}
.notification-item.unread { border-color: rgba(66,104,255,.35); box-shadow: inset 0 0 0 1px rgba(66,104,255,.18); }
.ticket-status {
    display:inline-flex; align-items:center; gap: 8px; border-radius: 999px; padding: 8px 12px; font-size: .82rem; font-weight: 700;
}
.ticket-status.open, .ticket-status.waiting_staff { background: rgba(255,182,73,.12); color: #ffd998; border:1px solid rgba(255,182,73,.24); }
.ticket-status.answered { background: rgba(33,208,122,.12); color: #caffde; border:1px solid rgba(33,208,122,.24); }
.ticket-status.closed { background: rgba(255,84,117,.12); color: #ffd1da; border:1px solid rgba(255,84,117,.24); }
.chat-panel { padding: 0; overflow: hidden; }
.chat-header { padding: 20px 22px; border-bottom: 1px solid var(--border); display:flex; justify-content:space-between; gap:16px; }
.chat-messages { max-height: 520px; overflow:auto; padding: 20px; display:grid; gap: 16px; background: linear-gradient(180deg, rgba(7,10,33,.4), rgba(17,23,63,.16)); }
.chat-bubble { max-width: 78%; padding: 14px 16px; border-radius: 18px; border:1px solid var(--border); background: rgba(255,255,255,.03); }
.chat-bubble.me { margin-left: auto; background: rgba(66,104,255,.16); border-color: rgba(66,104,255,.3); }
.chat-meta { font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.chat-compose { padding: 20px; border-top: 1px solid var(--border); background: rgba(10,16,51,.45); }
.chat-compose form { display:flex; gap: 12px; align-items:flex-end; }
.chat-compose textarea { min-height: 84px; }
.filter-row { display:flex; gap: 12px; align-items:center; flex-wrap: wrap; }
.metric-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.search-match-hidden { display: none !important; }
.inline-chip { display:inline-flex; align-items:center; gap: 8px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,.02); }
.list-compact { display:grid; gap: 10px; }
.list-compact > div { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.02); border: 1px solid var(--border); }
@media (max-width: 1400px) {
    .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .server-list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .hero-grid, .dashboard-grid, .login-grid { grid-template-columns: 1fr; }
    .chart-box, .chart-box-sm { height: 320px; }
}
@media (max-width: 920px) {
    .sidebar { position: fixed; transform: translateX(-100%); transition: transform .24s ease; }
    .sidebar.open { transform: translateX(0); }
    .topbar { height: auto; flex-direction: column; align-items: stretch; padding: 18px 20px; }
    .topbar-left, .topbar-right { justify-content: space-between; }
    .topbar-search { width: 100%; }
    .content-area, .footer-bar { padding-left: 20px; padding-right: 20px; }
    .content-header { flex-direction: column; }
    .grid-stats, .server-list-grid, .metric-grid { grid-template-columns: 1fr; }
}

.dashboard-grid-charts { grid-template-columns: minmax(0, 1.65fr) minmax(320px, .85fr); align-items: stretch; }
.dashboard-grid-main { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .9fr); }
.side-stack-panel { min-width: 0; }
.compact-chart-panel .chart-box-sm { height: 300px; }
.brand-name { letter-spacing: .01em; }
.profile-role { text-align: left; }
body.sidebar-collapsed .sidebar { width: 96px; padding-left: 14px; padding-right: 14px; }
body.sidebar-collapsed .sidebar-brand-wrap { padding-bottom: 14px; margin-bottom: 18px; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; }
body.sidebar-collapsed .brand-stack,
body.sidebar-collapsed .sidebar-group-title,
body.sidebar-collapsed .sidebar-link span,
body.sidebar-collapsed .sidebar-mini-card { display: none; }
body.sidebar-collapsed .sidebar-link { justify-content: center; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .app-main { width: calc(100% - 96px); }
@media (min-width: 921px) {
    .sidebar { transition: width .22s ease, padding .22s ease; }
}
@media (max-width: 1280px) {
    .dashboard-grid-charts, .dashboard-grid-main { grid-template-columns: 1fr; }
    .compact-chart-panel .chart-box-sm { height: 260px; }
}


.quick-add-panel { margin-bottom: 22px; }
.quick-add-panel .soft-text { font-size: .95rem; }
@media (max-width: 1100px) {
    .quick-add-panel .soft-text { width: 100%; }
}


@media (max-width: 420px) {
    .brand-name { font-size: 1.1rem; }
    .brand-sub { font-size: .88rem; }
    .brand-tags { gap: 6px; }
    .brand-tags span { height: 25px; padding: 0 8px; font-size: .68rem; }
}
