/* Base Variables - Yandex Fleet Aesthetic */
:root {
    --bg-color: #0c0d0e; /* Deep Black */
    --sidebar-bg: #1a1b1e; /* Carbon Dark */
    --topbar-bg: #1a1b1e;
    --text-color: #ffffff;
    --text-muted: #94a3b8;
    --primary-color: #ffcc00; /* Yandex Yellow */
    --accent-color: #3b82f6;
    --hover-color: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.08);
    --card-bg: #1a1b1e;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
}

.dark-theme {
    /* Already defaulted to dark for this premium look */
    --bg-color: #0c0d0e;
    --sidebar-bg: #101112; 
    --card-bg: #1c1d1f;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: var(--transition);
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar - Slim & Modern */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.sidebar.closed {
    width: 80px;
}

.sidebar-header {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    margin-bottom: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    padding: 6px;
    border-radius: 14px;
    width: fit-content;
}

.logo-img {
    width: 32px;
    height: 32px;
    border-radius: 10px;
}

.logo span {
    color: #000;
    font-weight: 800;
    font-size: 18px;
    display: inline-block;
}

.sidebar.closed .logo span {
    display: none;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    margin-bottom: 8px;
}

.nav-links a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    padding: 12px;
    border-radius: var(--border-radius-md);
    transition: var(--transition);
}

.nav-links a i {
    font-size: 24px;
    min-width: 40px;
    display: flex;
    justify-content: center;
}

.nav-links a:hover {
    background: var(--hover-color);
    color: #fff;
}

.nav-links a.active {
    background: #2b2c2e;
    color: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar.closed .link_name {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Topbar - Breadcrumbs & Pill Profile */
.topbar {
    height: 80px;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

#btn-menu {
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

#btn-menu:hover {
    color: #fff;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-pill {
    background: #1a1b1e;
    border: 1px solid var(--border-color);
    padding: 4px 16px 4px 6px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    cursor: pointer;
}

.user-pill:hover {
    background: #232428;
    border-color: rgba(255, 255, 255, 0.15);
}

.user-pill .avatar {
    width: 36px;
    height: 36px;
    background: rgba(255, 204, 0, 0.1);
    color: var(--primary-color);
    border-radius: 14px;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 204, 0, 0.2);
}

.user-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.user-info .org-name {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.user-info .location {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1;
    margin-top: 2px;
}

/* Content Area */
.content-wrapper {
    flex: 1;
    padding: 0 40px 40px;
    overflow-y: auto;
}

/* Cards Grid - Modern Fleet Style */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 32px;
}

.stat-card {
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-content {
    display: flex;
    flex-direction: column;
}

.number {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.sub-info {
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
}

/* Tables */
.table-container {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.table-header h3 {
    font-size: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: var(--hover-color);
}

/* Specialized Cards */
.loyalty-card {
    background: linear-gradient(135deg, #2b2c2e 0%, #1a1b1e 100%);
}

.loyalty-card .badge-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 204, 0, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.financial-stat {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.financial-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.financial-row:last-child {
    border-bottom: none;
}

.financial-label {
    font-size: 14px;
    color: var(--text-muted);
}

.financial-value {
    font-weight: 700;
}

/* Modern Lists */
.status-list {
    list-style: none;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Animations */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.animate-slide {
    animation: slideIn 0.3s ease forwards;
}

/* Margin & Padding Utilities */
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.mt-3 { margin-top: 24px !important; }
.mt-4 { margin-top: 32px !important; }
.mt-5 { margin-top: 48px !important; }

.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mb-4 { margin-bottom: 32px !important; }
.mb-5 { margin-bottom: 48px !important; }

.pt-1 { padding-top: 8px !important; }
.pt-2 { padding-top: 16px !important; }
.pt-3 { padding-top: 24px !important; }
.pt-4 { padding-top: 32px !important; }
.pt-5 { padding-top: 48px !important; }

.pb-1 { padding-bottom: 8px !important; }
.pb-2 { padding-bottom: 16px !important; }
.pb-3 { padding-bottom: 24px !important; }
.pb-4 { padding-bottom: 32px !important; }
.pb-5 { padding-bottom: 48px !important; }

.p-0 { padding: 0 !important; }
.m-0 { margin: 0 !important; }


/* Responsive Adjustments & Off-Canvas Mobile Logic */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 1024px) {
    /* Tablet View */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100%;
        z-index: 999;
        width: 250px;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    .sidebar.mobile-open {
        left: 0;
    }
    .sidebar .link_name, .sidebar .logo span { 
        display: inline-block !important; 
    }
    .topbar { padding: 0 20px; }
    .content-wrapper { padding: 0 20px 20px; }
    .cards-grid { grid-template-columns: 1fr; }
    .vps-cards-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    /* Mobile View */
    .topbar {
        height: 70px;
        padding: 0 15px;
    }
    .page-title {
        font-size: 18px;
    }
    .user-info { display: none; }
    .user-pill { padding: 4px; border-radius: 50%; border: none; }
    .content-wrapper { padding: 0 15px 15px; }
    .stat-card { padding: 20px; }
    .modal-card { width: 95%; padding: 24px; }
    
    /* Horizontal scroll for generic overflowing elements */
    .table-container {
        overflow-x: auto;
    }
    /* Specific overrides for settings inputs */
    .modern-input { padding: 12px 15px; font-size: 14px; }
}

/* Custom Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--card-bg);
    width: 90%;
    max-width: 440px;
    padding: 32px;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.modal-overlay.active .modal-card {
    transform: scale(1) translateY(0);
}

.modal-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 204, 0, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 24px;
}

.modal-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #fff;
}

.modal-message {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 32px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 14px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.modal-btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-btn-confirm {
    background: var(--primary-color);
    color: #000;
}

.modal-btn-confirm:hover {
    background: #e6b800;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3);
}

.modal-btn-danger {
    background: var(--danger);
    color: #fff;
}

.modal-btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* Sidebar Submenu Styles */
.submenu-container {
    padding-left: 20px;
    margin-bottom: 8px;
    overflow: hidden;
    animation: fadeIn 0.4s ease forwards;
}

.submenu-links {
    list-style: none;
    border-left: 1px solid var(--border-color);
    margin-left: 20px;
    padding-left: 12px;
}

.submenu-links li {
    margin-bottom: 4px;
}

.submenu-links a {
    padding: 8px 12px !important;
    font-size: 13px !important;
    border-radius: 12px !important;
}

.submenu-links a i {
    font-size: 18px !important;
    min-width: 32px !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Premium Glassmorphism & UI Utilities */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.text-gradient {
    background: linear-gradient(135deg, #ffffff, #a0aec0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
    font-weight: 700;
}
h2.text-gradient { font-size: 1.8rem; }

.glass-panel {
    background: rgba(30, 34, 45, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.panel-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.panel-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}
.panel-header h3 i { color: var(--primary-color); }
.panel-body { padding: 24px; }

/* Alerts */
.alert-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 14px;
    margin-bottom: 24px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    animation: slideDown 0.4s ease;
}
.alert-success { background: rgba(46, 204, 113, 0.1); border: 1px solid rgba(46, 204, 113, 0.2); color: #2ecc71; }
.alert-info { background: rgba(52, 152, 219, 0.1); border: 1px solid rgba(52, 152, 219, 0.2); color: #3498db; }
.alert-warning { background: rgba(243, 156, 18, 0.1); border: 1px solid rgba(243, 156, 18, 0.2); color: #f39c12; }
.alert-danger { background: rgba(231, 76, 60, 0.1); border: 1px solid rgba(231, 76, 60, 0.2); color: #e74c3c; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn-glow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}
.btn-glow.primary { background: var(--primary-color); color: #000; box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3); }
.btn-glow.warning { background: #e67e22; color: #fff; box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3); }
.btn-glow:hover { transform: translateY(-2px); filter: brightness(1.1); }

.btn-outline-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid rgba(231, 76, 60, 0.5);
    background: transparent;
    color: #e74c3c;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 0.85rem;
}
.btn-outline-danger:hover { background: rgba(231, 76, 60, 0.1); }

/* Inputs */
.modern-input {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 14px 20px;
    color: #fff;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}
.modern-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.15);
    background: rgba(255,255,255,0.05);
}
.form-group { margin-bottom: 24px; }
.form-label { display: block; margin-bottom: 8px; color: #a0aec0; font-size: 0.9rem; font-weight: 500; }

.badge-glow {
    background: rgba(52, 152, 219, 0.1);
    color: var(--accent-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid rgba(52, 152, 219, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.badge-danger { color: #e74c3c; background: rgba(231, 76, 60, 0.1); border-color: rgba(231, 76, 60, 0.2); }
.badge-success { color: #2ecc71; background: rgba(46, 204, 113, 0.1); border-color: rgba(46, 204, 113, 0.2); }

/* Vps Stat Cards */
.vps-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.vps-stat-card {
    background: var(--card-bg, #1e222d);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.vps-stat-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.card-glow {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    filter: blur(50px);
    opacity: 0.4;
    z-index: 0;
}
.vps-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}
.vps-icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: inset 0 0 10px rgba(255,255,255,0.05);
}
.vps-stat-value { font-size: 2rem; font-weight: 800; color: #fff; }
.vps-card-body h4 { margin: 0 0 5px 0; font-size: 1rem; color: #a0aec0; }
.vps-card-body p { margin: 0 0 15px 0; font-size: 0.85rem; color: #718096; }

/* Tables */
.vps-table {
    width: 100%;
    border-collapse: collapse;
}
.vps-table th {
    text-align: left;
    padding: 15px 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #718096;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
}
.vps-table td {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    vertical-align: middle;
}
.vps-table tr:last-child td { border: none; }
.vps-table tbody tr:hover { background: rgba(255,255,255,0.02); }

.pid-badge {
    background: rgba(255,255,255,0.05);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: monospace;
    color: #a0aec0;
}
.proc-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e2e8f0;
    font-weight: 500;
}

.mini-progress {
    width: 80px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
}
.mini-progress .bar { height: 100%; border-radius: 3px; }

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar { height: 8px; width: 8px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }


/* Gold Premium Menu Item */
.nav-premium-gold a {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(255, 165, 0, 0.03)) !important;
    border: 1px solid rgba(255, 215, 0, 0.15) !important;
    color: #ffd700 !important;
    font-weight: 800 !important;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.nav-premium-gold a i {
    color: #ffd700 !important;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.nav-premium-gold a:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 165, 0, 0.08)) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.4) !important;
}

.nav-premium-gold .link_name {
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-size: 12px;
}
