/* ========================================
   XDUNAMIS MANAGER - DESIGN SYSTEM
   Colors: #000000 (Black), #E85D04 (Orange X), #FFFFFF (White)
   Style: Modern, Dark-first, Orange Accent
======================================== */

/* ========================================
   CSS CUSTOM PROPERTIES
======================================== */

:root {
    /* Primary Orange Palette (from XDunamis logo "X") */
    --primary: #E85D04;
    --primary-dark: #C44D03;
    --primary-light: #FF7B2E;
    --primary-lighter: #FFF0E6;
    --primary-alpha: rgba(232, 93, 4, 0.15);

    /* Semantic Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;

    /* Neutral Grays */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Backgrounds (dark only — matches logo #000000) */
    --bg-body: #000000;
    --bg-surface: #000000;
    --bg-elevated: #000000;
    --bg-input: #000000;

    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --text-muted: #777777;
    --text-inverse: #000000;

    /* Borders */
    --border-color: #1F1F1F;
    --border-strong: #2A2A2A;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.5), 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);

    /* Spacing & Sizing */
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Sidebar */
    --sidebar-width: 280px;
}

/* ========================================
   SINGLE THEME: DARK (logo-matched #000000)
   No theme switching — dark only
======================================== */

/* ========================================
   RESET & BASE
======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ========================================
   LOGIN PAGE
======================================== */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: #000000;
}

.login-card {
    background: var(--bg-surface);
    padding: 48px 40px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-logo {
    margin-bottom: 32px;
}

.login-logo img {
    max-width: 180px;
    height: auto;
}

.login-logo h1 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.login-form .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.login-form .form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-input);
    transition: var(--transition);
}

.login-form .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    color: #FCA5A5;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.login-error.visible {
    display: block;
}

/* ========================================
   SIDEBAR / NAVIGATION
======================================== */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    transition: var(--transition);
}

.logo {
    padding: 28px 24px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.logo img {
    max-width: 80px;
    height: auto;
}

.logo-text {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.5px;
}

.user-info {
    padding: 16px 24px;
    background: var(--primary-alpha);
    border-bottom: 1px solid var(--border-color);
}

.user-info strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.user-info small {
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar nav {
    flex: 1;
    padding: 16px 12px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    min-height: 44px;
}

.sidebar nav a:hover {
    background: var(--primary-alpha);
    color: var(--primary);
}

.sidebar nav a.active {
    background: var(--primary-alpha);
    color: var(--primary);
    font-weight: 600;
    border-left: 3px solid var(--primary);
}

.sidebar nav a .nav-icon {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

/* Theme Toggle Button */
.theme-toggle {
    padding: 12px 16px;
    margin: 0 0 8px 0;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
    min-height: 44px;
}

.theme-toggle:hover {
    background: var(--primary-alpha);
    color: var(--primary);
    border-color: var(--primary);
}

.theme-toggle:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Logout Button */
.btn-logout {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    min-height: 44px;
}

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

/* ========================================
   MAIN CONTENT
======================================== */

.main-content {
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
}

.section {
    display: block;
}

.section.hidden {
    display: none;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

/* ========================================
   DASHBOARD HEADER
======================================== */

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-header .header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dashboard-header .header-logo img {
    height: 40px;
    width: auto;
}

.dashboard-header .header-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========================================
   STATS CARDS
======================================== */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card h3 {
    margin-bottom: 4px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 8px;
    line-height: 1;
}

.stat-card .unit {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ========================================
   CARDS
======================================== */

.card {
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========================================
   TABLES
======================================== */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
}

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

th {
    background: var(--bg-body);
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

td {
    font-size: 14px;
    color: var(--text-primary);
}

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

tr:hover td {
    background: var(--primary-alpha);
}

/* ========================================
   BUTTONS
======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    min-height: 44px;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-body);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background: var(--success);
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-warning {
    background: var(--warning);
    color: #111827;
}

.btn-warning:hover {
    background: #D97706;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    min-height: 36px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    min-height: 52px;
}

.btn-block {
    width: 100%;
}

/* Loading state */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading .btn-text {
    opacity: 0;
}

.btn-spinner {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.btn.loading .btn-spinner {
    display: block;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================
   FORMS
======================================== */

.form-card {
    background: var(--bg-surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    max-width: 600px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-input);
    transition: var(--transition);
    font-family: inherit;
    min-height: 44px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group .form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

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

/* ========================================
   MODALS
======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-surface);
    margin: 5% auto;
    padding: 32px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

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

.modal-description {
    font-size: 14px;
    color: var(--text-secondary);
}

.modal-body {
    margin-bottom: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.modal .close {
    color: var(--text-muted);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    transition: var(--transition);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* ========================================
   STATUS BADGES
======================================== */

.status {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status.online,
.status.active {
    background: rgba(16, 185, 129, 0.2);
    color: #6EE7B7;
}

.status.stopped,
.status.error {
    background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
}

.status.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #FCD34D;
}

.status.info {
    background: rgba(59, 130, 246, 0.2);
    color: #93C5FD;
}

/* ========================================
   PROCESS LIST (PM2)
======================================== */

.process-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.process-item {
    background: var(--bg-surface);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.process-item:hover {
    box-shadow: var(--shadow-md);
}

.process-item.protected {
    border-left: 3px solid var(--warning);
}

.process-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.process-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.process-metrics {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.process-actions {
    display: flex;
    gap: 8px;
}

.process-actions .btn {
    min-height: 36px;
    padding: 6px 12px;
}

.process-actions .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========================================
   LOG VIEWER
======================================== */

.log-viewer {
    background: #1a1a2e;
    color: #E5E7EB;
    padding: 20px;
    border-radius: var(--radius-lg);
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.log-line {
    padding: 2px 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-line .timestamp {
    color: var(--primary);
    margin-right: 8px;
}

.log-line.error {
    color: #FCA5A5;
}

.log-line.warning {
    color: #FCD34D;
}

/* ========================================
   AUDIT LOG
======================================== */

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

.audit-entry {
    background: var(--bg-surface);
    padding: 14px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

.audit-entry .audit-time {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 150px;
}

.audit-entry .audit-user {
    font-weight: 600;
    color: var(--primary);
    min-width: 80px;
}

.audit-entry .audit-action {
    color: var(--text-primary);
    flex: 1;
}

/* ========================================
   FIREWALL RULES (IPTABLES)
======================================== */

.chain-section {
    margin-bottom: 24px;
}

.chain-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--primary-alpha);
    border-radius: var(--radius) var(--radius) 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
}

.chain-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--primary);
}

.chain-policy {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.chain-policy.drop {
    background: #FEE2E2;
    color: #991B1B;
}

.chain-policy.accept {
    background: #D1FAE5;
    color: #065F46;
}

.rule-protected {
    opacity: 0.7;
    position: relative;
}

.rule-protected::after {
    content: '🔒';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

/* ========================================
   FAIL2BAN
======================================== */

.jail-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.jail-card {
    background: var(--bg-surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.jail-card .jail-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}

.jail-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.jail-metric {
    font-size: 13px;
    color: var(--text-secondary);
}

.jail-metric .metric-value {
    font-weight: 600;
    color: var(--text-primary);
}

.banned-list {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.banned-ip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.banned-ip .ip-address {
    font-family: 'Monaco', 'Menlo', monospace;
    color: var(--text-primary);
}

/* ========================================
   TOAST NOTIFICATIONS
======================================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: var(--bg-surface);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.removing {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

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

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

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }

/* ========================================
   EMPTY STATES
======================================== */

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 48px 24px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
    max-width: 300px;
    margin: 0 auto;
}

/* ========================================
   ACTIONS BAR
======================================== */

.actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.actions-bar .search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: var(--transition);
    min-height: 44px;
}

.actions-bar .search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-alpha);
}

/* ========================================
   MOBILE MENU
======================================== */

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius);
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background: #FFFFFF;
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
}

/* ========================================
   RESPONSIVE: TABLET (768px - 1024px)
======================================== */

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }

    .sidebar {
        width: var(--sidebar-width);
    }

    .main-content {
        margin-left: var(--sidebar-width);
        padding: 24px;
    }

    .stats {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .jail-list {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   RESPONSIVE: MOBILE (below 768px)
======================================== */

@media (max-width: 768px) {
    /* Show hamburger menu */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Sidebar as sliding overlay */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar.active ~ .sidebar-backdrop {
        display: block;
    }

    /* Main content full width */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 80px 16px 16px 16px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 22px;
    }

    /* Touch targets: min 44x44px on mobile */
    .btn,
    .btn-sm,
    .sidebar nav a,
    .theme-toggle,
    .btn-logout,
    .toast-close,
    .modal .close,
    .form-group input,
    .form-group select,
    .actions-bar .search-input {
        min-height: 44px;
        min-width: 44px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .btn-sm {
        min-height: 44px;
        padding: 10px 16px;
    }

    /* Process list mobile layout */
    .process-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .process-actions {
        width: 100%;
    }

    .process-actions .btn {
        flex: 1;
        min-height: 44px;
    }

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

    /* Audit entries mobile */
    .audit-entry {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* Form adjustments */
    .form-card {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Modal mobile */
    .modal-content {
        width: 95%;
        padding: 24px;
        margin: 10% auto;
    }

    .modal-footer {
        flex-direction: column;
    }

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

    /* Actions bar mobile */
    .actions-bar {
        flex-direction: column;
    }

    .actions-bar .search-input {
        width: 100%;
    }

    /* Dashboard header mobile */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Firewall table scroll */
    .table-container {
        margin: 0 -16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    /* Toast mobile */
    .toast-container {
        left: 10px;
        right: 10px;
        top: 10px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    /* Login adjustments */
    .login-card {
        padding: 32px 24px;
    }
}

/* ========================================
   RESPONSIVE: SMALL MOBILE (below 480px)
======================================== */

@media (max-width: 480px) {
    .main-content {
        padding: 72px 12px 12px 12px;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-card .value {
        font-size: 28px;
    }

    .card {
        padding: 16px;
    }

    .login-card {
        padding: 28px 20px;
        border-radius: var(--radius-lg);
    }

    .login-logo img {
        max-width: 100px;
    }

    .jail-card {
        padding: 16px;
    }

    .banned-ip {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .banned-ip .btn {
        width: 100%;
    }
}

/* ========================================
   UTILITY CLASSES
======================================== */

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.hidden { display: none; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   ANIMATIONS
======================================== */

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========================================
   SCROLLBAR CUSTOM
======================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}

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

/* ========================================
   PRINT STYLES
======================================== */

@media print {
    .sidebar,
    .mobile-menu-toggle,
    .sidebar-backdrop,
    .toast-container {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .card, .stat-card, .process-item {
        break-inside: avoid;
    }
}
