/**
 * ZAKLE - Modern SaaS Theme
 * Clean, professional design with refined aesthetics
 */

/* ============================================
   1. TYPOGRAPHY & GLOBAL OVERRIDES
   ============================================ */

:root {
    /* Refined Color Palette */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-50: rgba(79, 70, 229, 0.05);
    --primary-100: rgba(79, 70, 229, 0.1);
    --primary-200: rgba(79, 70, 229, 0.2);

    --secondary: #64748b;
    --success: #10b981;
    --success-light: #ecfdf5;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --info: #06b6d4;
    --info-light: #ecfeff;

    /* Neutral Palette */
    --background: #f8fafc;
    --card-bg: #ffffff;
    --surface: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;

    /* Enhanced Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 16px -4px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.1), 0 8px 16px -4px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);

    /* Ring for focus states */
    --ring: 0 0 0 3px rgba(79, 70, 229, 0.15);
    --ring-danger: 0 0 0 3px rgba(239, 68, 68, 0.15);

    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark mode refinements */
.dark-mode {
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --primary-light: rgba(129, 140, 248, 0.1);
    --primary-50: rgba(129, 140, 248, 0.05);
    --primary-100: rgba(129, 140, 248, 0.1);
    --primary-200: rgba(129, 140, 248, 0.2);

    --background: #0f172a;
    --card-bg: #1e293b;
    --surface: #1e293b;
    --border: #334155;
    --border-light: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 16px -4px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.5);

    --ring: 0 0 0 3px rgba(129, 140, 248, 0.2);

    --success-light: rgba(16, 185, 129, 0.1);
    --danger-light: rgba(239, 68, 68, 0.1);
    --warning-light: rgba(245, 158, 11, 0.1);
    --info-light: rgba(6, 182, 212, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.011em;
    background: var(--background);
}

/* ============================================
   2. NAVIGATION - Modern SaaS Top Bar
   ============================================ */

.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85);
}

.dark-mode .navbar {
    background: rgba(30, 41, 59, 0.85);
}

.nav-brand {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--primary);
    gap: 0.4rem;
}

.nav-brand-logo {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: #ffffff;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.nav-brand .icon {
    font-size: 1.1rem;
}

.nav-links {
    gap: 0.125rem;
}

.nav-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    transition: all 0.15s var(--ease);
    position: relative;
    letter-spacing: 0;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--primary-50);
}

.nav-link::after {
    display: none;
}

.nav-link .icon {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Active nav link state */
.nav-link.active,
.nav-link[aria-current="page"] {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

/* Nav left controls */
.nav-left {
    gap: 0.625rem;
}

/* Time display refinement */
.time-display-nav {
    gap: 0.375rem;
}

.time-item {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    gap: 0.25rem;
}

.time-icon {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.time-value {
    font-family: 'Inter', monospace;
    font-size: 0.6875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Online users indicator */
.online-users-indicator {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.15s var(--ease);
}

.online-users-indicator:hover {
    background: var(--primary-50);
    border-color: var(--primary);
    color: var(--primary);
}

.online-dot {
    width: 7px;
    height: 7px;
    background: var(--success);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Online users dropdown */
.online-users-dropdown {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    background: var(--surface);
}

.dark-mode .online-users-dropdown {
    border-color: var(--border);
}

.dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.8125rem;
    background: var(--background);
    color: var(--text-primary);
}

.dark-mode .dropdown-header {
    background: var(--background);
    border-color: var(--border);
}

/* Dark mode toggle */
.dark-mode-toggle {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.3rem 0.45rem;
    transition: all 0.15s var(--ease);
    color: var(--text-secondary);
}

.dark-mode-toggle:hover {
    background: var(--primary-50);
    border-color: var(--primary);
    color: var(--primary);
    transform: none;
}

/* ============================================
   3. CARDS - Clean, Elevated Design
   ============================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
    overflow: visible;
}

.card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--border);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin: 0;
}

.card-header h2 {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-body {
    padding: 1.25rem 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
}

/* Interactive cards */
.card-interactive:hover,
.client-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow), var(--ring);
    transform: translateY(-1px);
}

/* ============================================
   4. BUTTONS - Refined SaaS Style
   ============================================ */

.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.8125rem;
    letter-spacing: 0;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    transition: all 0.15s var(--ease);
    box-shadow: var(--shadow-xs);
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    line-height: 1.5;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-xs);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-sm), var(--ring);
}

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

.btn-secondary:hover {
    background: var(--background);
    border-color: var(--text-tertiary);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: var(--shadow-sm), var(--ring-danger);
}

.btn-sm {
    font-size: 0.75rem;
    padding: 0.3125rem 0.625rem;
    border-radius: 0.375rem;
    min-height: 32px;
}

.btn-lg {
    font-size: 0.9375rem;
    padding: 0.625rem 1.25rem;
    min-height: 44px;
}

.btn-block {
    width: 100%;
}

.btn-link {
    box-shadow: none;
    padding: 0.25rem 0.5rem;
    color: var(--primary);
    font-weight: 500;
}

.btn-link:hover {
    transform: none;
    box-shadow: none;
    text-decoration: underline;
}

.btn-icon {
    box-shadow: none;
    min-width: 36px;
    min-height: 36px;
    padding: 0.375rem;
    border-radius: 0.375rem;
}

.btn-icon:hover {
    background: var(--background);
    transform: none;
    box-shadow: none;
}

/* ============================================
   5. FORMS - Clean, Accessible Inputs
   ============================================ */

.form-group label,
.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    letter-spacing: 0;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="search"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group select,
.form-group textarea,
.form-input,
.form-select,
.form-textarea {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
    min-height: 38px;
    line-height: 1.5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
    transform: none;
}

.form-group input::placeholder,
.form-input::placeholder {
    color: var(--text-tertiary);
}

/* ============================================
   6. TABLES - Clean Data Display
   ============================================ */

.data-table,
.table-traditional {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 0.8125rem;
}

.data-table thead,
.table-traditional thead {
    background: var(--background);
}

.data-table th,
.table-traditional th {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td,
.table-traditional td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr,
.table-traditional tbody tr {
    transition: background-color 0.1s var(--ease);
}

.data-table tbody tr:hover,
.table-traditional tbody tr:hover {
    background: var(--primary-50);
}

.data-table tbody tr:last-child td,
.table-traditional tbody tr:last-child td {
    border-bottom: none;
}

/* Table card rows (mobile) */
.table-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
}

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

.table-card-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.table-card-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

/* ============================================
   7. BADGES - Refined Pill Badges
   ============================================ */

.badge {
    font-family: 'Inter', sans-serif;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.1875rem 0.5rem;
    border-radius: 9999px;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: none;
    text-transform: none;
}

.badge-primary,
.badge-admin {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success,
.badge-active {
    background: var(--success-light);
    color: #059669;
}

.badge-danger {
    background: var(--danger-light);
    color: #dc2626;
}

.badge-warning,
.badge-editor {
    background: var(--warning-light);
    color: #d97706;
}

.badge-info,
.badge-viewer {
    background: var(--info-light);
    color: #0891b2;
}

.badge-secondary,
.badge-inactive {
    background: var(--background);
    color: var(--text-secondary);
}

.dark-mode .badge-primary,
.dark-mode .badge-admin {
    background: var(--primary-100);
    color: var(--primary);
}

.dark-mode .badge-success,
.dark-mode .badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.dark-mode .badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.dark-mode .badge-warning,
.dark-mode .badge-editor {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.dark-mode .badge-info,
.dark-mode .badge-viewer {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
}

.dark-mode .badge-secondary,
.dark-mode .badge-inactive {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

/* ============================================
   8. ALERTS - Refined Notifications
   ============================================ */

.alert {
    font-size: 0.8125rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    border-left: 3px solid;
    box-shadow: none;
    line-height: 1.5;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border-left-color: var(--success);
}

.alert-error {
    background: var(--danger-light);
    color: #991b1b;
    border-left-color: var(--danger);
}

.alert-info {
    background: var(--info-light);
    color: #0e7490;
    border-left-color: var(--info);
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border-left-color: var(--warning);
}

.dark-mode .alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}

.dark-mode .alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.dark-mode .alert-info {
    background: rgba(6, 182, 212, 0.1);
    color: #67e8f9;
}

.dark-mode .alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fcd34d;
}

/* ============================================
   9. MODALS - Clean Overlay
   ============================================ */

.modal-backdrop {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    background: var(--surface);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.modal-close {
    color: var(--text-tertiary);
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    border-radius: 0.375rem;
    transition: all 0.15s var(--ease);
}

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

.modal-body {
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    gap: 0.5rem;
}

/* Desktop modal styling */
@media (min-width: 768px) {
    .modal-content {
        border-radius: 0.75rem;
        animation: modalFadeIn 0.2s var(--ease);
    }

    @keyframes modalFadeIn {
        from {
            opacity: 0;
            transform: scale(0.97) translateY(8px);
        }
        to {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }
}

/* ============================================
   10. PAGE HEADERS - Clean Typography
   ============================================ */

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1,
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1.3;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.page-subtitle,
.page-header .subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-weight: 400;
}

/* ============================================
   11. SEARCH - Refined Search Box
   ============================================ */

.search-page {
    max-width: 720px;
}

.search-box input {
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: var(--ring);
}

/* Result items */
.result-item {
    border-left: 3px solid transparent;
    transition: all 0.15s var(--ease);
}

.result-item:hover {
    border-left-color: var(--primary);
    background: var(--primary-50);
}

.result-badge {
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.1875rem 0.5rem;
}

/* ============================================
   12. LOGIN PAGE - Professional Login
   ============================================ */

.login-box {
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

/* ============================================
   13. FOOTER - Subtle Footer
   ============================================ */

.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 0.875rem 0;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    box-shadow: none;
    backdrop-filter: none;
}

.footer-content {
    font-size: 0.75rem;
}

/* ============================================
   14. SWITCH / TOGGLE - Refined
   ============================================ */

.switch {
    width: 40px;
    height: 22px;
}

.slider {
    background-color: var(--border);
    border-radius: 22px;
}

.slider:before {
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    border-radius: 50%;
    box-shadow: var(--shadow-xs);
}

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

input:checked + .slider:before {
    transform: translateX(18px);
}

/* ============================================
   15. COUNTRY SECTIONS - Collapsible Cards
   ============================================ */

.country-section {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.country-section:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.collapse-status {
    font-weight: 500;
    color: var(--primary);
    font-size: 0.75rem;
}

/* ============================================
   16. CONVERTER PAGE - Tab Styles
   ============================================ */

.tabs {
    border-bottom: 1px solid var(--border);
    gap: 0;
    margin-bottom: 1.5rem;
}

.tab-button {
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.15s var(--ease);
    margin-bottom: -1px;
}

.tab-button:hover {
    color: var(--text-primary);
    background: transparent;
}

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

/* Timeline improvements */
.timeline-container {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.timezone-label {
    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.02);
}

.timeline-row {
    border-bottom: 1px solid var(--border-light);
}

.time-tile {
    font-size: 0.6875rem;
}

/* ============================================
   17. TOAST NOTIFICATIONS - Refined
   ============================================ */

.toast {
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.dark-mode .toast {
    background: var(--card-bg);
    border-color: var(--border);
}

/* ============================================
   18. EMPTY STATES - Refined
   ============================================ */

.empty-state,
.empty-state-large {
    padding: 3rem 2rem;
}

.empty-icon {
    font-size: 2.5rem;
    opacity: 0.4;
    margin-bottom: 0.75rem;
}

.empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.empty-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ============================================
   19. SCROLLBAR - Refined
   ============================================ */

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

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

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

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

/* ============================================
   20. FOCUS STATES - Consistent
   ============================================ */

*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ============================================
   21. DASHBOARD GRID - Superadmin
   ============================================ */

.dashboard-grid {
    gap: 1.25rem;
}

.info-box {
    background: var(--background);
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    padding: 0.875rem;
}

.info-box code {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.375rem 0.625rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.8125rem;
}

.role-item {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    transition: border-color 0.15s var(--ease);
}

.role-item:hover {
    border-color: var(--primary);
}

/* ============================================
   22. SERVER CARDS - Client Page
   ============================================ */

.server-card {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: border-color 0.15s var(--ease);
}

.server-card:hover {
    border-color: var(--primary);
}

/* Markdown content refinement */
.markdown-rendered {
    font-size: 0.875rem;
    line-height: 1.7;
}

.markdown-rendered h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.markdown-rendered h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 1.25rem 0 0.625rem;
}

.markdown-rendered h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
}

.markdown-rendered code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.8125rem;
    background: var(--background);
    border: 1px solid var(--border-light);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.markdown-rendered pre {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
}

.markdown-rendered pre code {
    border: none;
    padding: 0;
    background: none;
}

.markdown-rendered blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
}

/* ============================================
   23. CLIENT LAYOUT - 2 Column Grid
   ============================================ */

.client-layout {
    gap: 1.25rem;
}

/* ============================================
   24. PASSWORD CELLS - Database Page
   ============================================ */

.password-cell .password-actions {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    box-shadow: var(--shadow-sm);
}

.btn-icon-hover {
    background: var(--primary);
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
    font-weight: 500;
}

.btn-icon-hover:hover {
    background: var(--primary-hover);
    transform: none;
}

/* ============================================
   25. ACTIVITY LOG BADGES
   ============================================ */

.badge-create {
    background: var(--success-light);
    color: #059669;
}

.badge-update {
    background: var(--warning-light);
    color: #d97706;
}

.badge-delete {
    background: var(--danger-light);
    color: #dc2626;
}

.badge-view {
    background: var(--info-light);
    color: #0891b2;
}

.badge-login {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-logout {
    background: var(--background);
    color: var(--text-secondary);
}

.badge-search {
    background: var(--background);
    color: var(--text-secondary);
}

/* ============================================
   26. MOBILE BOTTOM NAV - Refined
   ============================================ */

.mobile-nav {
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
    padding: 0.375rem 0;
    height: 64px;
}

.mobile-nav-item {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-tertiary);
    gap: 0.125rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.15s var(--ease);
}

.mobile-nav-item.active {
    color: var(--primary);
    background: var(--primary-50);
}

.mobile-nav-icon {
    font-size: 1rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
}

.mobile-nav-item svg.mobile-nav-icon {
    stroke-width: 1.75;
}

/* ============================================
   27. RESPONSIVE OVERRIDES
   ============================================ */

@media (max-width: 768px) {
    .navbar {
        height: auto;
        padding: 0.625rem 1rem;
    }

    .page-header h1,
    .page-title {
        font-size: 1.25rem;
    }

    .card-header {
        padding: 1rem 1.25rem;
    }

    .card-body {
        padding: 1rem 1.25rem;
    }

    .card-footer {
        padding: 0.875rem 1.25rem;
    }

    .btn {
        min-height: 40px;
        font-size: 0.8125rem;
    }

    .container {
        padding: 1rem;
    }

    /* Mobile nav links dropdown */
    .nav-links {
        background: var(--surface);
        border-top: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        border-radius: 0 0 0.75rem 0.75rem;
    }

    .nav-links .nav-link {
        padding: 0.875rem 1.25rem;
        border-bottom: 1px solid var(--border-light);
        font-size: 0.875rem;
    }

    .nav-links .nav-link:last-child {
        border-bottom: none;
    }
}

@media (max-width: 1200px) {
    .navbar {
        padding: 0 1rem;
    }

    .nav-link {
        font-size: 0.75rem;
        padding: 0.3125rem 0.5rem;
    }
}

/* ============================================
   28. SUBTLE ANIMATIONS
   ============================================ */

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

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

/* Content fade in */
.main-content-wrapper {
    animation: fadeIn 0.2s var(--ease);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   29. CONFIRM DIALOG REFINEMENT
   ============================================ */

.confirm-dialog {
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    background: var(--surface);
}

.confirm-message {
    font-size: 0.9375rem;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ============================================
   30. REFERENCE CARD (Converter)
   ============================================ */

.reference-card {
    border-width: 1px;
    border-radius: 0.75rem;
}

/* ============================================
   31. SPINNER REFINEMENT
   ============================================ */

.spinner {
    border-color: var(--border);
    border-top-color: var(--primary);
}

.loading-spinner .spinner {
    border-color: rgba(79, 70, 229, 0.15);
    border-top-color: var(--primary);
}

/* ============================================
   32. DARK MODE SPECIFIC REFINEMENTS
   ============================================ */

.dark-mode .card {
    background: var(--surface);
    border-color: var(--border);
}

.dark-mode .data-table thead,
.dark-mode .table-traditional thead {
    background: rgba(30, 41, 59, 0.5);
}

.dark-mode .data-table tbody tr:hover,
.dark-mode .table-traditional tbody tr:hover {
    background: var(--primary-50);
}

.dark-mode .btn-secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-primary);
}

.dark-mode .btn-secondary:hover {
    background: var(--background);
    border-color: var(--text-tertiary);
}

.dark-mode .form-group input,
.dark-mode .form-group select,
.dark-mode .form-group textarea,
.dark-mode .form-input {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-primary);
}

.dark-mode .info-box code {
    background: var(--background);
    border-color: var(--border);
}

/* ============================================
   33. SKELETON / SHIMMER LOADING STATES
   ============================================ */

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, rgba(226,232,240,0.6) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 0.375rem;
    display: block;
}

.skeleton-text {
    height: 0.875rem;
    margin-bottom: 0.625rem;
    width: 100%;
}

.skeleton-text:last-child {
    width: 70%;
    margin-bottom: 0;
}

.skeleton-text-sm {
    height: 0.625rem;
    margin-bottom: 0.5rem;
    width: 80%;
}

.skeleton-heading {
    height: 1.5rem;
    width: 50%;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-badge {
    height: 1.25rem;
    width: 64px;
    border-radius: 9999px;
}

.skeleton-button {
    height: 36px;
    width: 100px;
    border-radius: 0.5rem;
}

.skeleton-card {
    border-radius: 0.75rem;
    border: 1px solid var(--border-light);
    padding: 1.25rem;
    margin-bottom: 0.75rem;
}

.skeleton-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

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

.skeleton-cell {
    flex: 1;
    height: 0.875rem;
    border-radius: 0.25rem;
}

.skeleton-cell-sm {
    flex: 0.5;
}

.skeleton-cell-lg {
    flex: 2;
}

.dark-mode .skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, rgba(51,65,85,0.6) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
}

/* ============================================
   34. ELEVATED CARD INTERACTIONS
   ============================================ */

/* Card accent borders (left color strip) */
.card-accent-primary {
    border-left: 3px solid var(--primary);
}

.card-accent-success {
    border-left: 3px solid var(--success);
}

.card-accent-warning {
    border-left: 3px solid var(--warning);
}

.card-accent-danger {
    border-left: 3px solid var(--danger);
}

.card-accent-info {
    border-left: 3px solid var(--info);
}

/* Card hover lift effect */
.card-lift {
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

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

/* Enhanced interactive cards */
.card-interactive {
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}

.card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow), var(--ring);
    border-color: var(--primary);
}

.card-interactive:active {
    transform: translateY(0);
    box-shadow: var(--shadow-xs);
}

/* Server card enhanced hover */
.server-card {
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.15s var(--ease);
}

.server-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary);
}

/* ============================================
   35. ENHANCED EMPTY STATES WITH SVG
   ============================================ */

.empty-state,
.empty-state-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3.5rem 2rem;
    animation: fadeIn 0.3s var(--ease);
}

.empty-state-illustration {
    width: 120px;
    height: 120px;
    margin-bottom: 1.25rem;
    opacity: 0.5;
    color: var(--text-tertiary);
}

.empty-state-illustration svg {
    width: 100%;
    height: 100%;
}

.empty-icon {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
    line-height: 1;
}

.empty-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.empty-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    max-width: 320px;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.empty-action {
    margin-top: 0.5rem;
}

/* ============================================
   36. ENHANCED TABLES
   ============================================ */

/* Alternating row backgrounds */
.data-table tbody tr:nth-child(even),
.table-traditional tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

.dark-mode .data-table tbody tr:nth-child(even),
.dark-mode .table-traditional tbody tr:nth-child(even) {
    background: rgba(30, 41, 59, 0.3);
}

/* Sticky table header with shadow */
.table-wrapper {
    overflow-x: auto;
    position: relative;
}

.table-wrapper .data-table thead th,
.table-wrapper .table-traditional thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--background);
    box-shadow: 0 1px 0 var(--border);
}

.dark-mode .table-wrapper .data-table thead th,
.dark-mode .table-wrapper .table-traditional thead th {
    background: var(--card-bg);
}

/* Row hover left accent */
.data-table tbody tr,
.table-traditional tbody tr {
    border-left: 3px solid transparent;
    transition: background-color 0.1s var(--ease), border-left-color 0.1s var(--ease);
}

.data-table tbody tr:hover,
.table-traditional tbody tr:hover {
    background: var(--primary-50);
    border-left-color: var(--primary);
}

/* Monospace data columns */
.td-mono,
td[data-type="number"] {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

/* Sort indicator in table headers */
.th-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s var(--ease);
}

.th-sortable:hover {
    color: var(--primary);
}

.th-sortable::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.375rem;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--text-tertiary);
    opacity: 0.4;
}

.th-sortable.sort-asc::after {
    border-top: none;
    border-bottom: 4px solid var(--primary);
    opacity: 1;
}

.th-sortable.sort-desc::after {
    border-top: 4px solid var(--primary);
    opacity: 1;
}

/* ============================================
   37. SEARCH UX IMPROVEMENTS
   ============================================ */

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
    width: 16px;
    height: 16px;
    transition: color 0.15s var(--ease);
}

.search-input-wrapper .form-input {
    padding-left: 2.375rem;
}

.search-input-wrapper .form-input:focus ~ .search-input-icon,
.search-input-wrapper:focus-within .search-input-icon {
    color: var(--primary);
}

.search-clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 0.625rem;
    line-height: 1;
    transition: all 0.15s var(--ease);
    padding: 0;
}

.search-clear-btn:hover {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

.search-clear-btn.visible {
    display: inline-flex;
}

.search-result-count {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
}

.search-result-count strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Search result highlight */
mark,
.search-highlight {
    background: rgba(245, 158, 11, 0.2);
    color: inherit;
    padding: 0.0625rem 0.125rem;
    border-radius: 0.125rem;
}

/* ============================================
   38. FORM FIELD POLISH
   ============================================ */

/* Focus background tint */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    background: var(--primary-50);
}

.dark-mode .form-group input:focus,
.dark-mode .form-group select:focus,
.dark-mode .form-group textarea:focus,
.dark-mode .form-input:focus {
    background: rgba(129, 140, 248, 0.05);
}

/* Required field indicator */
.form-label.required::after {
    content: ' *';
    color: var(--danger);
    font-weight: 400;
}

/* Field group container */
.form-field-group {
    background: var(--background);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.form-field-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

/* Validation states */
.form-input.is-valid {
    border-color: var(--success);
}

.form-input.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    background: rgba(16, 185, 129, 0.03);
}

.form-input.is-invalid {
    border-color: var(--danger);
}

.form-input.is-invalid:focus {
    box-shadow: var(--ring-danger);
    background: rgba(239, 68, 68, 0.03);
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* Animated underline on focus */
.form-input-underline {
    border: none;
    border-bottom: 2px solid var(--border);
    border-radius: 0;
    background: transparent;
    padding-left: 0;
    padding-right: 0;
    transition: border-color 0.2s var(--ease);
}

.form-input-underline:focus {
    border-bottom-color: var(--primary);
    box-shadow: none;
    background: transparent;
}

/* ============================================
   39. BREADCRUMB NAVIGATION
   ============================================ */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
    padding: 0;
    list-style: none;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s var(--ease);
    font-weight: 500;
}

.breadcrumb-item a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    user-select: none;
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-home-icon {
    width: 14px;
    height: 14px;
    color: var(--text-tertiary);
}

/* ============================================
   40. ALERT ICONS & SLIDE-IN ANIMATION
   ============================================ */

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

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    animation: alertSlideIn 0.3s var(--ease);
}

.alert-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

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

.alert-dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    padding: 0;
    font-size: 1.125rem;
    line-height: 1;
    transition: opacity 0.15s var(--ease);
}

.alert-dismiss:hover {
    opacity: 1;
}

/* ============================================
   41. BUTTON MICRO-INTERACTIONS
   ============================================ */

/* Press-down scale effect */
.btn:active {
    transform: scale(0.97);
    box-shadow: var(--shadow-xs);
    transition-duration: 0.05s;
}

/* Loading spinner inside button */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
}

.btn-primary.btn-loading::after {
    border-top-color: #ffffff;
}

.btn-secondary.btn-loading::after {
    border-top-color: var(--text-primary);
}

.btn-danger.btn-loading::after {
    border-top-color: #ffffff;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* Button success state */
.btn-success-state {
    background: var(--success) !important;
    border-color: var(--success) !important;
    color: #ffffff !important;
    transition: all 0.3s var(--ease);
}

/* Button with icon */
.btn-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-icon-left {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Ghost button (no background, subtle) */
.btn-ghost {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--background);
    color: var(--text-primary);
    box-shadow: none;
    transform: none;
}

/* ============================================
   42. ACTIVITY TIMELINE VIEW
   ============================================ */

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
    border-radius: 1px;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
    animation: fadeIn 0.2s var(--ease);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -1.75rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 2px var(--border);
    z-index: 1;
}

.timeline-dot-primary { background: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.timeline-dot-success { background: var(--success); box-shadow: 0 0 0 2px var(--success-light); }
.timeline-dot-warning { background: var(--warning); box-shadow: 0 0 0 2px var(--warning-light); }
.timeline-dot-danger  { background: var(--danger);  box-shadow: 0 0 0 2px var(--danger-light); }
.timeline-dot-info    { background: var(--info);    box-shadow: 0 0 0 2px var(--info-light); }
.timeline-dot-secondary { background: var(--text-tertiary); box-shadow: 0 0 0 2px var(--background); }

.timeline-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    padding: 0.875rem 1rem;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.timeline-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-xs);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.timeline-time {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.timeline-body {
    font-size: 0.8125rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.timeline-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Timeline toggle button */
.view-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--surface);
}

.view-toggle-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.view-toggle-btn:not(:last-child) {
    border-right: 1px solid var(--border);
}

.view-toggle-btn.active {
    background: var(--primary);
    color: #ffffff;
}

.view-toggle-btn:hover:not(.active) {
    background: var(--background);
}

/* ============================================
   43. PAGINATION IMPROVEMENTS
   ============================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.pagination-info {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.pagination .btn-sm {
    min-width: 34px;
    height: 34px;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.pagination .btn-primary {
    box-shadow: none;
    pointer-events: none;
}

/* ============================================
   44. TOOLTIP STYLES
   ============================================ */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    background: var(--text-primary);
    color: var(--surface);
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* ============================================
   45. STAGGER ANIMATIONS FOR LISTS
   ============================================ */

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

.stagger-item {
    animation: staggerFadeIn 0.3s var(--ease) both;
}

.stagger-item:nth-child(1) { animation-delay: 0s; }
.stagger-item:nth-child(2) { animation-delay: 0.03s; }
.stagger-item:nth-child(3) { animation-delay: 0.06s; }
.stagger-item:nth-child(4) { animation-delay: 0.09s; }
.stagger-item:nth-child(5) { animation-delay: 0.12s; }
.stagger-item:nth-child(6) { animation-delay: 0.15s; }
.stagger-item:nth-child(7) { animation-delay: 0.18s; }
.stagger-item:nth-child(8) { animation-delay: 0.21s; }
.stagger-item:nth-child(9) { animation-delay: 0.24s; }
.stagger-item:nth-child(10) { animation-delay: 0.27s; }

/* ============================================
   46. ENHANCED MOBILE TABLE CARDS
   ============================================ */

.table-card {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--surface);
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
    animation: staggerFadeIn 0.3s var(--ease) both;
}

.table-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-xs);
}

/* ============================================
   47. DIVIDER UTILITY
   ============================================ */

.divider {
    height: 1px;
    background: var(--border-light);
    margin: 1.5rem 0;
    border: none;
}

.divider-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.divider-label::before,
.divider-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

/* ============================================
   48. STATUS DOT INDICATORS
   ============================================ */

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

.status-dot-online {
    background: var(--success);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-dot-offline {
    background: var(--text-tertiary);
}

.status-dot-warning {
    background: var(--warning);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.status-dot-error {
    background: var(--danger);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.status-dot-pulse {
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

/* ============================================
   49. COMPREHENSIVE DARK MODE FIXES
   ============================================ */

/* Select & Option elements — prevent white-on-white */
.dark-mode select,
.dark-mode select.form-input {
    background-color: var(--surface);
    color: var(--text-primary);
}

.dark-mode select option {
    background-color: var(--surface);
    color: var(--text-primary);
}

/* Ensure all inputs/textareas have proper dark backgrounds */
.dark-mode input,
.dark-mode textarea,
.dark-mode select {
    background-color: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
}

.dark-mode input::placeholder,
.dark-mode textarea::placeholder {
    color: var(--text-tertiary);
}

/* Card headers & footers */
.dark-mode .card-header {
    border-bottom-color: var(--border);
}

.dark-mode .card-footer {
    border-top-color: var(--border);
    background: rgba(15, 23, 42, 0.3);
}

/* Table cells */
.dark-mode .table-traditional td,
.dark-mode .data-table td {
    border-bottom-color: var(--border);
    color: var(--text-primary);
}

.dark-mode .table-traditional th,
.dark-mode .data-table th {
    color: var(--text-secondary);
    border-bottom-color: var(--border);
}

/* Alternating table row backgrounds */
.dark-mode .table-traditional tbody tr:nth-child(even),
.dark-mode .data-table tbody tr:nth-child(even) {
    background: rgba(30, 41, 59, 0.3);
}

/* Sticky table header dark bg */
.dark-mode .table-wrapper .table-traditional thead th,
.dark-mode .table-wrapper .data-table thead th {
    background: var(--card-bg);
}

/* Modal dark mode */
.dark-mode .modal-content,
.dark-mode .modal {
    background: var(--surface);
    border-color: var(--border);
}

.dark-mode .modal-header {
    border-bottom-color: var(--border);
}

.dark-mode .modal-footer {
    border-top-color: var(--border);
}

.dark-mode .modal-title {
    color: var(--text-primary);
}

.dark-mode .modal-backdrop {
    background: rgba(0, 0, 0, 0.6);
}

/* Links in dark mode */
.dark-mode a {
    color: var(--primary);
}

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

/* Labels */
.dark-mode .form-label,
.dark-mode label {
    color: var(--text-primary);
}

/* Empty state illustration color */
.dark-mode .empty-state-illustration {
    color: var(--text-tertiary);
}

/* Button primary in dark mode */
.dark-mode .btn-primary {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.dark-mode .btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Button danger in dark mode */
.dark-mode .btn-danger {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.dark-mode .btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* Skeleton shimmer in dark mode */
.dark-mode .skeleton {
    background: linear-gradient(90deg, var(--border) 25%, rgba(51, 65, 85, 0.6) 50%, var(--border) 75%);
    background-size: 200% 100%;
}

/* Confirm dialog / browser native dark colors */
.dark-mode .table-card-label {
    color: var(--text-secondary);
}

.dark-mode .table-card-value {
    color: var(--text-primary);
}

/* Divider */
.dark-mode .divider,
.dark-mode hr {
    border-color: var(--border);
}

/* Scrollbar dark mode */
.dark-mode ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dark-mode ::-webkit-scrollbar-track {
    background: var(--background);
}

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

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Collapse status in countries page */
.dark-mode .collapse-status {
    color: var(--primary);
}

/* Stats cards text */
.dark-mode .text-xs {
    color: var(--text-secondary);
}

/* Table wrapper border */
.dark-mode .table-wrapper {
    border-color: var(--border);
}

/* Footer dark mode */
.dark-mode .footer {
    background: var(--surface);
    border-top-color: var(--border);
    color: var(--text-secondary);
}

/* Nav dark mode refinements */
.dark-mode .navbar {
    background: var(--surface);
    border-bottom-color: var(--border);
}

.dark-mode .nav-link {
    color: var(--text-secondary);
}

.dark-mode .nav-link:hover,
.dark-mode .nav-link.active {
    color: var(--text-primary);
}

/* Mobile nav dark mode */
.dark-mode .mobile-nav {
    background: var(--surface);
    border-top-color: var(--border);
}

.dark-mode .mobile-nav-item {
    color: var(--text-secondary);
}

.dark-mode .mobile-nav-item.active {
    color: var(--primary);
}
