/* ========================================
    VLADLEN FM - Admin "God Mode" Styles
    Premium SaaS Interface Framework
    Built with design-system.css variables
   ======================================== */

:root {
    --sidebar-glass: rgba(255, 255, 255, 0.8);
    --card-hover-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    --transition-premium: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --sidebar-glass: rgba(255, 255, 255, 0.9);
    --card-hover-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --sidebar-glass: rgba(15, 23, 42, 0.7);
    --card-hover-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.app {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* --- 1. SIDEBAR (Premium Glassmorphism) --- */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    background: var(--sidebar-glass) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition-premium);
}

.sidebar-header {
    padding: var(--spacing-2xl) var(--spacing-lg) var(--spacing-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 800;
    color: #ffffff;
    font-size: var(--font-size-xl);
    letter-spacing: -0.02em;
    text-align: center;
}

/* Mayak Logo - 3 Wave Animation */
.mayak-logo-small {
    width: 64px;
    height: 64px;
    color: var(--accent);
    filter: drop-shadow(0 0 16px rgba(99, 102, 241, 0.6)) drop-shadow(0 0 32px rgba(99, 102, 241, 0.3));
    position: relative;
}

.mayak-logo-small .wave {
    transform-origin: center;
    opacity: 0;
}

.mayak-logo-small .wave-1 {
    animation: wave-ripple 2s infinite ease-out;
}

.mayak-logo-small .wave-2 {
    animation: wave-ripple 2s infinite ease-out 0.6s;
}

.mayak-logo-small .wave-3 {
    animation: wave-ripple 2s infinite ease-out 1.2s;
}

@keyframes wave-ripple {
    0% { transform: scale(0.5); opacity: 0; }
    50% { opacity: 0.6; }
    100% { transform: scale(1.5); opacity: 0; }
}

.mayak-logo-small .tower {
    fill: currentColor;
}

.beacon {
    animation: beacon-pulse 1.5s infinite ease-in-out;
}

@keyframes beacon-pulse {
    0%, 100% { opacity: 0.4; filter: drop-shadow(0 0 2px var(--accent)); }
    50% { opacity: 1; filter: drop-shadow(0 0 12px var(--accent)); }
}

.sidebar-nav {
    padding: 0 var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-premium);
    position: relative;
    overflow: hidden;
}

.nav-item i {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
    color: #6366f1;
    box-shadow: inset 4px 0 0 #6366f1;
    font-weight: 600;
}

.sidebar-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
}

/* --- 2. MAIN CONTENT & LAYOUT --- */
body .app > .main-content {
    flex: 1;
    margin-left: 280px !important;
    padding: var(--spacing-2xl);
    width: calc(100% - 280px) !important;
    min-width: 0;
    box-sizing: border-box;
    transition: all var(--transition-premium);
    overflow-x: hidden;
    position: relative;
    z-index: 1;
}

.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-2xl);
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 3. PREMIUM CARDS */
.card, .stat-card {
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--spacing-xl);
    transition: all var(--transition-premium);
    position: relative;
    overflow: hidden;
}

.card.glass, .stat-card.glass {
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.card:hover, .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-hover-shadow);
    border-color: rgba(99, 102, 241, 0.2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
}

/* 4. STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-xl);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.primary { background: rgba(99, 102, 241, 0.1); color: var(--accent); }
.stat-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
}

/* 5. BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-premium);
    border: none;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Input Fields */
.input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-family);
    transition: all var(--transition-normal);
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input::placeholder {
    color: var(--text-muted);
}

select.input {
    cursor: pointer;
    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='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-premium);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    transform: translateY(-2px);
}

.menu-btn {
    display: none;
}

.close-sidebar {
    display: none;
}

.theme-toggle {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-premium);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

[data-theme="dark"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: none; }

/* Tables */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: var(--bg-tertiary);
}

th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

tr:hover {
    background: var(--bg-hover);
}

tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge.active, .badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge.banned, .badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge.expired, .badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* 6. CHARTS */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* 7. CARDS GRID */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
}

/* 8. DETAIL CARDS */
.detail-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
}

.detail-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.detail-box .label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.detail-box .value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Progress Bars */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

.progress-bar.primary { background: var(--accent); box-shadow: 0 0 10px rgba(99, 102, 241, 0.4); }
.progress-bar.success { background: var(--success); box-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
.progress-bar.warning { background: var(--warning); box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.active { background: var(--success); box-shadow: 0 0 10px var(--success); animation: pulse-glow 2s infinite; }

/* --- 8. RESPONSIVE REFINEMENTS --- */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    
    body .app > .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: var(--spacing-lg);
        padding-top: 80px;
    }
    
    .menu-btn {
        display: flex !important;
    }
    
    .mobile-only {
        display: flex !important;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: var(--spacing-lg);
    }
    
    .stat-value {
        font-size: 32px;
    }
    
    .page-title {
        font-size: var(--font-size-xl);
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* --- 9. MODULE SPECIFIC STYLES --- */

/* Audit Logs - Log Details */
.log-details-pre {
    font-family: monospace;
    font-size: 12px;
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-radius: 6px;
    max-width: 300px;
    max-height: 100px;
    overflow: auto;
    color: var(--text-secondary);
}

/* Security / 2FA */
.security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-xl);
}

.qr-wrapper {
    background: white;
    padding: 20px;
    border-radius: var(--radius-xl);
    display: inline-block;
    margin: 20px 0;
}

.whitelist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.ip-badge {
    font-family: monospace;
    background: var(--accent-light);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* Protocols */
.protocols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
}

.protocol-card {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.protocol-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.protocol-info-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.protocol-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========================================
    10. MODAL STYLES
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1999;
    display: none;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 2000;
    display: none;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-md) 0;
}

.modal-footer {
    padding-top: var(--spacing-md);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: var(--spacing-md);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.form-row {
    display: flex;
    gap: var(--spacing-md);
}

.form-row .form-group {
    flex: 1;
}

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

.animate-fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ========================================
    11. MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablet breakpoint (max-width: 1024px) - Additional styles only */
@media (max-width: 1024px) {
    .main-header {
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    .page-title {
        font-size: var(--font-size-xl);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-card {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .protocols-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile breakpoint (max-width: 640px) */
@media (max-width: 640px) {
    :root {
        --font-size-base: 14px;
    }
    
    body .app > .main-content {
        padding: var(--spacing-md);
    }
    
    .main-header {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-lg);
    }
    
    .header-left {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);
        flex: 1;
    }
    
    .page-title {
        font-size: var(--font-size-lg);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        margin-bottom: var(--spacing-lg);
    }
    
    .stat-card {
        padding: var(--spacing-md);
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .card {
        padding: var(--spacing-md);
        border-radius: var(--radius-lg);
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
    
    .card-title {
        font-size: var(--font-size-lg);
    }
    
    .detail-card {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .detail-box {
        padding: var(--spacing-md);
    }
    
    .btn {
        padding: 12px 20px;
        min-height: 44px;
        font-size: 14px;
    }
    
    .icon-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-title {
        font-size: var(--font-size-lg);
    }
    
    .chart-container {
        height: 250px;
    }
    
    .sidebar {
        width: 280px;
        max-width: 85vw;
    }
    
    .sidebar-header {
        padding: var(--spacing-lg);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .nav-item {
        padding: 12px 14px;
        min-height: 44px;
    }
    
    .protocols-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .protocol-link {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .protocol-link code {
        font-size: 11px;
        word-break: break-all;
        white-space: normal;
    }
    
    .security-grid {
        grid-template-columns: 1fr;
    }
    
    .whitelist-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
}

/* Small mobile breakpoint (max-width: 375px) */
@media (max-width: 375px) {
    .page-title {
        font-size: var(--font-size-base);
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .card-title {
        font-size: var(--font-size-base);
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Landscape mode on mobile */
@media (max-width: 640px) and (orientation: landscape) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sidebar {
        max-width: 70vw;
    }
}

/* Touch optimization */
.nav-item,
.btn,
.icon-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Safe area insets for notched devices */
@supports (padding-top: env(safe-area-inset-top)) {
    .main-header {
        padding-top: max(var(--spacing-md), env(safe-area-inset-top));
    }
    
    .sidebar {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Section Titles */
.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: var(--bg-card);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    transform: translateX(120%);
    transition: transform 0.3s ease-out;
    max-width: 400px;
    min-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    gap: 12px;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--accent);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.toast-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Mobile Menu Improvements */
@media (max-width: 1024px) {
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Better mobile scrolling */
    .sidebar {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar-nav {
        padding-bottom: 20px;
    }
}

/* Enhanced mobile experience */
@media (max-width: 480px) {
    .main-header {
        padding: 12px 16px;
    }
    
    .page-title {
        font-size: 18px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60%;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .icon-btn {
        width: 40px;
        height: 40px;
    }
}

/* Prevent zoom on iOS */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
    select,
    textarea,
    input[type="text"],
    input[type="password"],
    input[type="datetime"],
    input[type="datetime-local"],
    input[type="date"],
    input[type="month"],
    input[type="time"],
    input[type="week"],
    input[type="number"],
    input[type="email"],
    input[type="url"],
    input[type="search"],
    input[type="tel"],
    input[type="color"]
    {
        font-size: 16px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-item {
        min-height: 50px;
        padding: 16px 20px;
    }
    
    .btn {
        min-height: 48px;
        padding: 12px 24px;
    }
    
    .stat-card {
        min-height: 120px;
    }
    
    /* Reduce animations on touch devices to improve performance */
    .animate-fade-in,
    .glass {
        animation-duration: 0.1s !important;
        transition-duration: 0.1s !important;
    }
}

/* Active states for touch feedback */
.nav-item:active,
.btn:active,
.icon-btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Focus management for keyboard navigation on touch devices */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Mobile Navigation Enhancements */
@media (max-width: 1024px) {
    /* Prevent overscroll on mobile sidebar */
    .sidebar {
        overscroll-behavior-y: contain;
    }
    
    /* Sticky sidebar header for mobile */
    .sidebar-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: inherit;
        backdrop-filter: blur(24px);
        border-bottom: 1px solid var(--border-color);
        padding: 16px;
    }
    
    /* Improve sidebar footer spacing */
    .sidebar-footer {
        margin-top: auto;
        padding: 16px;
        border-top: 1px solid var(--border-color);
    }
}

/* Landscape orientation improvements */
@media (max-width: 1024px) and (orientation: landscape) {
    .sidebar {
        max-height: 100vh;
        height: 100%;
    }
    
    .sidebar-nav {
        flex-grow: 1;
        overflow-y: auto;
    }
}

/* Notifications */
.notification-dropdown {
    position: absolute;
    right: 60px;
    top: 60px;
    width: 360px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
}

.notification-item {
    padding: 12px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--bg-hover);
}

.notification-item.unread {
    background: rgba(99, 102, 241, 0.1);
    border-left: 3px solid var(--accent);
}

.notification-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 8px;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.notification-message {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.notification-time {
    font-size: 11px;
    color: var(--text-muted);
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

#notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 10px;
    background: var(--danger);
    color: white;
    display: none;
}

#notification-badge:not([style*="display: none"]):not([style*="display:none"]) {
    display: flex !important;
    align-items: center;
    justify-content: center;
}
