/* ==========================================================================
   DESIGN SYSTEM & VARIABLES (LIGHT THEME)
   ========================================================================== */
:root {
    /* Colors */
    --primary: #4f46e5;         /* Indigo-600 */
    --primary-glow: rgba(79, 70, 229, 0.06);
    --primary-hover: #4338ca;
    
    --secondary: #9333ea;       /* Purple-600 */
    --secondary-hover: #7e22ce;
    
    --success: #059669;         /* Emerald-600 */
    --success-glow: rgba(5, 150, 105, 0.08);
    
    --danger: #dc2626;          /* Red-600 */
    --danger-glow: rgba(220, 38, 38, 0.08);
    --danger-hover: #b91c1c;
    
    --warning: #d97706;         /* Amber-600 */
    
    --bg-dark: #f8fafc;         /* Soft Light Slate */
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    
    --border-color: #e2e8f0;    /* Slate-200 */
    --border-color-active: rgba(79, 70, 229, 0.3);
    
    --text-main: #0f172a;       /* Slate-900 */
    --text-muted: #64748b;      /* Slate-500 */
    --text-disabled: #94a3b8;   /* Slate-400 */
    
    /* Layout */
    --sidebar-width: 280px;
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Prompt', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Background Glowing Shapes */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(150px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
}

.bg-glow-1 {
    top: -200px;
    left: -100px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.15) 0%, rgba(0,0,0,0) 70%);
}

.bg-glow-2 {
    bottom: -200px;
    right: -100px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.12) 0%, rgba(0,0,0,0) 70%);
}

/* ==========================================================================
   UI UTILITIES & BUTTONS
   ========================================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 10px 15px -3px rgba(0, 0, 0, 0.02), 0 0 0 1px rgba(0, 0, 0, 0.02);
    transition: transform var(--transition-normal), border var(--transition-normal), box-shadow var(--transition-normal);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.card:hover {
    border-color: rgba(79, 70, 229, 0.2);
    box-shadow: 0 12px 24px -10px rgba(79, 70, 229, 0.08), 0 0 0 1px rgba(79, 70, 229, 0.1);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.card-header-flex {
    flex-wrap: wrap;
    gap: 16px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-title i {
    font-size: 1.25rem;
}

.card-title h4 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-title p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-body {
    padding: 24px;
}

.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center !important; }
.mt-8 { margin-top: 8px !important; }
.mt-16 { margin-top: 16px !important; }
.mt-24 { margin-top: 24px !important; }
.mt-32 { margin-top: 32px !important; }
.mb-8 { margin-bottom: 8px !important; }
.mb-16 { margin-bottom: 16px !important; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    color: #fff;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    box-shadow: 0 4px 12px 0 rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px 0 rgba(79, 70, 229, 0.35);
}

.btn-secondary {
    background: #e2e8f0;
    color: #0f172a !important;
    border: 1px solid #cbd5e1;
    font-weight: 600;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #cbd5e1;
    color: #020617 !important;
    border-color: #94a3b8;
}

.btn-warning {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 4px 12px 0 rgba(217, 119, 6, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #b45309 0%, #78350f 100%);
    box-shadow: 0 6px 16px 0 rgba(217, 119, 6, 0.4);
}

.btn-wg-script {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
    border: none;
}

.btn-wg-script:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}

.btn-info {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px 0 rgba(2, 132, 199, 0.25);
}

.btn-info:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    box-shadow: 0 6px 16px 0 rgba(2, 132, 199, 0.35);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px 0 rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--danger-hover);
    box-shadow: 0 6px 16px 0 rgba(239, 68, 68, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-outline-danger {
    background: #fff1f2;
    color: #e11d48 !important;
    border: 1.5px solid #fda4af;
    font-weight: 600;
}

.btn-outline-danger:hover {
    background: #ffe4e6;
    color: #be123c !important;
    border-color: #f43f5e;
}

.btn-outline-primary {
    background: #eff6ff;
    color: #2563eb !important;
    border: 1.5px solid #93c5fd;
    font-weight: 600;
}

.btn-outline-primary:hover {
    background: #dbeafe;
    color: #1d4ed8 !important;
    border-color: #3b82f6;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--border-radius-sm);
}

.btn-block {
    width: 100%;
}

.btn-icon-only {
    padding: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
    text-transform: capitalize;
}

.badge-admin {
    background-color: rgba(168, 85, 247, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.badge-co-admin {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.badge-user {
    background-color: rgba(5, 150, 105, 0.1);
    color: var(--success);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.badge-profile {
    background-color: #f1f5f9;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   LOGIN SCREEN STYLES (REDESIGNED)
   ========================================================================== */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(circle at 50% 50%, #f1f5f9 0%, #e2e8f0 100%);
}

.login-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 28px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.01);
    transform: translateY(0);
    transition: all var(--transition-normal);
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.brand-badge {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #ffffff;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    margin-bottom: 16px;
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.25);
}

.login-header h2 {
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

/* Inputs with Icons */
.input-with-icon {
    position: relative;
    width: 100%;
}

.input-with-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: color var(--transition-fast);
}

.form-control {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--border-radius-md);
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: #ffffff;
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 14px center;
    background-repeat: no-repeat;
    background-size: 1.1rem;
    padding-right: 40px;
    cursor: pointer;
}

.input-with-icon .form-control {
    padding-left: 46px;
}

.input-with-icon .form-control:focus + i {
    color: var(--primary);
}

.form-control::placeholder {
    color: var(--text-disabled);
}

.help-text {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.error-msg {
    background: var(--danger-glow);
    border: 1px solid rgba(220, 38, 38, 0.15);
    color: #b91c1c;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ==========================================================================
   DASHBOARD LAYOUT STYLES
   ========================================================================== */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    height: 100dvh;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.01);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header i {
    font-size: 1.8rem;
    color: var(--primary);
}

.sidebar-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-main);
}

.router-status-indicator {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    color: var(--text-muted);
}

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

.status-online {
    background-color: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.status-offline {
    background-color: var(--danger);
    box-shadow: 0 0 6px var(--danger);
}

.sidebar-menu {
    padding: 24px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.menu-item:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.menu-item.active {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid rgba(79, 70, 229, 0.1);
    font-weight: 600;
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    font-size: 1.8rem;
    color: var(--text-muted);
}

.user-details h4 {
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.user-details span {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: #f1f5f9;
    margin-top: 2px;
}

.logout-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    transition: color var(--transition-fast);
}

.logout-btn:hover {
    color: var(--danger);
}

/* Main Content Wrapper */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    max-width: calc(100vw - var(--sidebar-width));
    padding: 32px 24px;
    padding-top: max(32px, env(safe-area-inset-top, 0px));
    padding-bottom: max(32px, env(safe-area-inset-bottom, 0px));
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.content-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-main);
}

.content-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.update-timer-badge {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: #ffffff;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* ==========================================================================
   OVERVIEW PAGE STYLES
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: transform var(--transition-normal), border var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.stat-icon.cpu { background-color: var(--primary-glow); color: var(--primary); }
.stat-icon.ram { background-color: rgba(168, 85, 247, 0.08); color: var(--secondary); }
.stat-icon.uptime { background-color: var(--success-glow); color: var(--success); }
.stat-icon.model { background-color: rgba(245, 158, 11, 0.08); color: var(--warning); }

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Real-time Traffic Graph */
.chart-container {
    position: relative;
    height: 310px;
    padding-bottom: 0px;
}

#trafficChart {
    width: 100%;
    max-height: 280px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 12px;
}

.legend-item {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.download { background-color: #10b981; } /* Emerald */
.legend-color.upload { background-color: #6366f1; }   /* Indigo */

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
    min-height: 250px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 0.9rem;
}

.table th {
    padding: 14px 16px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.85rem;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 10;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    white-space: nowrap;
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.select-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--border-radius-sm);
}

/* ==========================================================================
   HOTSPOT PAGE STYLES
   ========================================================================== */
.tab-nav {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 12px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.horizontal-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: start;
}

.flex-bottom {
    align-self: end;
    margin-bottom: 2px;
}

/* Printable Vouchers */
.voucher-print-area {
    border-top: 1px dashed var(--border-color);
    padding-top: 24px;
}

.print-area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.voucher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.voucher-card {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.voucher-card-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 8px;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.voucher-field {
    margin-bottom: 8px;
}

.voucher-field label {
    display: block;
    font-size: 0.65rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 2px;
}

.voucher-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 1px;
}

.voucher-card-footer {
    border-top: 1px solid #f1f5f9;
    margin-top: 8px;
    padding-top: 6px;
    font-size: 0.65rem;
    color: #64748b;
}

.cleanup-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: var(--border-radius-md);
}

.cleanup-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 500;
}

.switch-sm {
    width: 44px;
    height: 24px;
}

.switch-sm .slider:before {
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
}

.switch-sm input:checked + .slider:before {
    transform: translateX(20px);
}

.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }

/* ==========================================================================
   FIREWALL BLOCK STYLES
   ========================================================================== */

.firewall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 24px;
}

.firewall-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
    transition: all 0.25 ease;
    position: relative;
    overflow: hidden;
}

.firewall-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px -5px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.firewall-card-main {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    width: 100%;
}

.firewall-card-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}

.firewall-card-icon.youtube { background-color: rgba(239, 68, 68, 0.1); color: #ef4444; }
.firewall-card-icon.line-app { background-color: rgba(16, 185, 129, 0.1); color: #10b981; }
.firewall-card-icon.games { background-color: rgba(168, 85, 247, 0.1); color: #a855f7; }
.firewall-card-icon.ads { background-color: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.firewall-card-icon.tiktok { background-color: rgba(15, 23, 42, 0.1); color: #0f172a; }
.firewall-card-icon.facebook { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.firewall-card-icon.adult { background-color: rgba(244, 63, 94, 0.1); color: #f43f5e; }

.firewall-card-body {
    flex: 1;
}

.firewall-card-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.firewall-card-body p {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 10px;
    line-height: 1.4;
}

.firewall-status-banner {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
}

.status-label {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    margin-left: 4px;
}

.status-label.blocked {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.2);
}

.status-label.unblocked {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
}

/* Schedule Control Styles */
.firewall-schedule-box {
    width: 100%;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-color);
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.schedule-checkbox-label {
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.schedule-controls {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 14px;
    margin-top: 12px;
}

.schedule-time-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.time-input-group input[type="time"] {
    padding: 4px 8px;
    width: 110px;
    font-size: 0.85rem;
}

.schedule-days-row {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.day-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.day-pill {
    cursor: pointer;
    user-select: none;
}

.day-pill input {
    display: none;
}

.day-pill span {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #ffffff;
    transition: all 0.2s ease;
}

.day-pill input:checked + span {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.firewall-card-body {
    flex: 1;
}

.firewall-card-body h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-main);
}

.firewall-card-body p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

.firewall-status-banner {
    font-size: 0.8rem;
}

.status-label {
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.status-label.blocked {
    background: var(--danger-glow);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.status-label.unblocked {
    background: var(--success-glow);
    color: #047857;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

/* Custom Checkbox Slider Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    border: 1px solid var(--border-color);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: .4s;

    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider {
    background-color: var(--primary);
    border-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
    background-color: #ffffff;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.4);
}

input:disabled + .slider {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==========================================================================
   ROUTER SETTINGS PAGE STYLES
   ========================================================================== */
.form-card-center {
    max-width: 580px;
    margin: 0 auto;
}

.form-status-box {
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    font-size: 0.85rem;
    margin-top: 16px;
}

.form-status-box.success {
    background-color: var(--success-glow);
    border: 1px solid rgba(5, 150, 105, 0.3);
    color: #047857;
}

.form-status-box.error {
    background-color: var(--danger-glow);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #b91c1c;
}

.form-actions-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    overflow-y: auto;
    padding: 20px 12px;
}

#modal-wg-script {
    z-index: 220;
}

.modal-wrapper.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 580px;
    margin: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform var(--transition-normal);
    max-height: calc(100vh - 40px);
    overflow: hidden;
}

.modal-form-flex {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(100vh - 40px);
    margin: 0;
    overflow: hidden;
}

.modal-wrapper.active .modal-card {
    transform: translateY(0);
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: #ffffff;
}

.modal-header h4 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close-btn:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    flex-shrink: 0;
    background: #f8fafc;
}

/* ==========================================================================
   RESPONSIVE LAYOUTS & MOBILE SIDEBAR DRAWER (iOS / ANDROID COMPATIBLE)
   ========================================================================== */
.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-menu-toggle {
    display: none; /* Hidden on desktop */
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-fast);
}

.btn-menu-toggle:hover {
    background: #f1f5f9;
}

/* Sidebar Dim Overlay for Mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 991px) {
    .btn-menu-toggle {
        display: flex; /* Show menu button on tablet and mobile */
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        height: 100dvh;
        width: 280px;
        transform: translateX(-100%); /* Slide out off-screen */
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 10px 0 20px rgba(0, 0, 0, 0.05);
        transition: transform var(--transition-normal);
        z-index: 1000;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar.active {
        transform: translateX(0); /* Slide in */
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        padding: 24px 18px !important;
        padding-top: max(24px, env(safe-area-inset-top, 0px)) !important;
        padding-bottom: max(24px, env(safe-area-inset-bottom, 0px)) !important;
    }
}

@media (max-width: 767px) {
    .login-wrapper {
        padding: 12px;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .login-card {
        padding: 32px 20px;
        border-radius: 22px;
        max-width: 100%;
    }

    .main-content {
        padding: 16px 10px !important;
        padding-top: max(16px, env(safe-area-inset-top, 0px)) !important;
        padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)) !important;
    }
    
    .content-header {
        margin-bottom: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .content-header h1 {
        font-size: 1.3rem;
    }

    /* Fix iOS Safari auto-zoom on input focus */
    .form-control, select.form-control, input.form-control {
        font-size: 16px !important; 
        min-height: 44px; /* Touch friendly tap target */
    }
    
    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile tabs horizontal scrollable bar */
    .tabs-header {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        margin-bottom: 16px;
        border-bottom: 1px solid var(--border-color);
    }

    .tabs-header .tab-btn {
        flex: 0 0 auto;
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    /* Mobile table responsive wrapper smooth scrolling */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        border-radius: var(--border-radius-md);
        width: 100%;
        overflow-x: auto;
    }

    .table th, .table td {
        padding: 10px 10px;
        white-space: nowrap;
    }
    
    .stats-grid {
        grid-template-columns: 1fr; /* Single column stats on mobile */
        gap: 12px;
    }
    
    .firewall-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .form-row-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .horizontal-form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions-flex {
        flex-direction: column;
        align-items: stretch;
    }

    .cleanup-status-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Mobile Bottom Sheet Modal Style */
    .modal-wrapper {
        padding: 10px 6px;
        align-items: flex-end;
    }

    .modal-card {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 92vh !important;
        max-height: 92dvh !important;
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-body {
        padding: 16px 14px;
    }

    .modal-footer {
        padding: 12px 14px;
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .modal-footer .btn {
        width: 100%;
    }
}


/* ==========================================================================
   SITE SELECTOR & MULTI-SITE STYLES
   ========================================================================== */
.site-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.site-select {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    outline: none !important;
}

.site-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.site-status-active {
    background: var(--success-glow);
    color: var(--success);
}

.site-status-normal {
    background: #f1f5f9;
    color: var(--text-muted);
}

/* ==========================================================================
   PROFESSIONAL VOUCHER CARD STYLES
   ========================================================================== */
.voucher-custom-specs-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--border-radius-md);
    padding: 16px;
}

.voucher-custom-specs-box .specs-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.voucher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.voucher-card {
    background: #ffffff;
    border: 2px dashed #94a3b8;
    border-radius: 12px;
    padding: 14px;
    position: relative;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.voucher-scissors {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.75rem;
    color: #cbd5e1;
    transform: rotate(-45deg);
    pointer-events: none;
}

.voucher-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -3px rgba(15, 23, 42, 0.1);
    border-color: var(--primary-color);
}

.voucher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.voucher-header .site-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
    letter-spacing: -0.3px;
}

.voucher-header .site-brand i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.voucher-header .price-badge {
    background: #4f46e5;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.voucher-header .price-badge.free {
    background: #10b981;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.voucher-pkg-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #475569;
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.voucher-pkg-bar .pkg-name {
    font-weight: 600;
    color: #1e293b;
}

.voucher-pkg-bar .pkg-limit {
    font-weight: 500;
    color: #64748b;
}

.voucher-body {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.voucher-credentials {
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.voucher-divider-v {
    width: 1px;
    height: 32px;
    background: #cbd5e1;
}

.voucher-field {
    text-align: center;
}

.voucher-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 2px;
}

.voucher-value {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 1px;
}

.voucher-value.pwd {
    color: #4f46e5;
}

.voucher-footer {
    border-top: 1px dashed #e2e8f0;
    padding-top: 6px;
    font-size: 0.7rem;
}

.voucher-footer .instruction {
    display: flex;
    justify-content: space-between;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 2px;
}

.voucher-footer .contact-info {
    color: #94a3b8;
    font-size: 0.68rem;
    text-align: center;
}

.single-voucher-preview-wrapper {
    display: flex;
    justify-content: center;
    background: #f1f5f9;
    padding: 20px;
    border-radius: 12px;
}

/* ==========================================================================
   PRINT STYLES (FOR INTERNATIONAL COUPONS CUTTING)
   ========================================================================== */
@media print {
    body * {
        visibility: hidden !important;
    }
    
    #voucher-print-area,
    #voucher-print-area *,
    .printable-single-target,
    .printable-single-target * {
        visibility: visible !important;
    }

    #voucher-print-area {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 8mm !important;
        display: block !important;
    }

    .print-area-header {
        display: none !important;
    }

    .voucher-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6mm !important;
    }

    .voucher-card {
        border: 1.5px dashed #475569 !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        background: #ffffff !important;
        color: #000000 !important;
        padding: 10px !important;
        border-radius: 6px !important;
    }

    .voucher-scissors {
        display: block !important;
        color: #000000 !important;
    }

    .voucher-header .site-brand,
    .voucher-value,
    .voucher-value.pwd {
        color: #000000 !important;
    }

    .voucher-header .price-badge {
        border: 1px solid #000 !important;
        background: none !important;
        color: #000000 !important;
    }

    .voucher-body {
        background: #f8fafc !important;
        border: 1px solid #000000 !important;
    }

    .voucher-pkg-bar {
        background: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
    }
}
