/**
 * HappilyHosted Customer Portal - Core Stylesheet
 * Light mode default with dark mode toggle
 */

/* ============================================
   CSS Custom Properties (Light Theme Default)
   ============================================ */
:root {
    /* Brand Colors */
    --hh-primary: #e67e22;
    --hh-primary-hover: #d35400;
    --hh-primary-light: #f39c12;
    --hh-primary-soft: rgba(230, 126, 34, 0.1);
    
    /* Semantic Colors */
    --hh-success: #10b981;
    --hh-success-soft: rgba(16, 185, 129, 0.1);
    --hh-warning: #f59e0b;
    --hh-warning-soft: rgba(245, 158, 11, 0.1);
    --hh-danger: #ef4444;
    --hh-danger-soft: rgba(239, 68, 68, 0.1);
    --hh-info: #3b82f6;
    --hh-info-soft: rgba(59, 130, 246, 0.1);
    
    /* Light Theme Colors */
    --bg-body: #f8fafc;
    --bg-sidebar: #1e293b;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    --bg-code: #f1f5f9;
    
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-focus: var(--hh-primary);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 64px;
    --content-max-width: 1400px;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ============================================
   Dark Theme
   ============================================ */
.dark-theme,
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-sidebar: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-input: #1e293b;
    --bg-code: #0f172a;
    
    --border-color: #334155;
    --border-light: #1e293b;
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Density variations */
.density-comfortable {
    --space-sm: 12px;
    --space-md: 20px;
    --space-lg: 32px;
}

.density-compact {
    --space-sm: 6px;
    --space-md: 12px;
    --space-lg: 18px;
    font-size: 13px;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

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

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

.text-mono {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

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

/* ============================================
   Layout Structure
   ============================================ */
.portal-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-inverse);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-slow);
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 var(--space-lg);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.sidebar-logo img {
    height: 32px;
}

.sidebar-logo span {
    font-weight: 700;
    font-size: 1.125rem;
    color: white;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md) 0;
}

.nav-section {
    margin-bottom: var(--space-lg);
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.4);
    padding: var(--space-sm) var(--space-lg);
    margin-bottom: var(--space-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-lg);
    color: rgba(255,255,255,0.7);
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    cursor: pointer;
}

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

.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--hh-primary);
}

.nav-item i {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--hh-primary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Bar */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 var(--space-xl);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.topbar-search input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    padding-left: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--hh-primary);
    box-shadow: 0 0 0 3px var(--hh-primary-soft);
}

.topbar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.topbar-search kbd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-left: auto;
}

.topbar-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

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

.topbar-btn .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--hh-danger);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-menu:hover {
    background: var(--bg-body);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--hh-primary), var(--hh-primary-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-info {
    text-align: left;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

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

/* Page Content */
.page-content {
    flex: 1;
    padding: var(--space-xl);
    max-width: var(--content-max-width);
    width: 100%;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: var(--space-xs);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--hh-primary);
}

.breadcrumb-sep {
    color: var(--border-color);
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.card-title i {
    color: var(--text-muted);
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-color);
    background: var(--bg-body);
}

/* ============================================
   Stats Cards
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--hh-primary);
    box-shadow: var(--shadow-md);
}

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

.stat-icon.primary {
    background: var(--hh-primary-soft);
    color: var(--hh-primary);
}

.stat-icon.success {
    background: var(--hh-success-soft);
    color: var(--hh-success);
}

.stat-icon.warning {
    background: var(--hh-warning-soft);
    color: var(--hh-warning);
}

.stat-icon.info {
    background: var(--hh-info-soft);
    color: var(--hh-info);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

.stat-trend {
    font-size: 0.75rem;
    margin-top: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.stat-trend.up { color: var(--hh-success); }
.stat-trend.down { color: var(--hh-danger); }

/* ============================================
   Service Cards
   ============================================ */
.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-fast);
}

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

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

.service-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--hh-primary), var(--hh-primary-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.service-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 2px;
}

.service-domain {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.service-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-badge.active {
    background: var(--hh-success-soft);
    color: var(--hh-success);
}

.status-badge.pending {
    background: var(--hh-warning-soft);
    color: var(--hh-warning);
}

.status-badge.suspended {
    background: var(--hh-danger-soft);
    color: var(--hh-danger);
}

.status-badge.expiring {
    background: var(--hh-warning-soft);
    color: var(--hh-warning);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge.active .status-dot {
    animation: pulse 2s infinite;
}

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

/* Resource Bars */
.resource-bars {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.resource-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.resource-label {
    width: 80px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.resource-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-body);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.resource-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--hh-primary);
    transition: width var(--transition-slow);
}

.resource-fill.low { background: var(--hh-success); }
.resource-fill.medium { background: var(--hh-warning); }
.resource-fill.high { background: var(--hh-danger); }

.resource-value {
    width: 100px;
    text-align: right;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

/* Service Actions */
.service-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--hh-primary), var(--hh-primary-hover));
    color: white !important;
    box-shadow: 0 2px 4px rgba(230, 126, 34, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(230, 126, 34, 0.4);
    color: white !important;
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

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

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

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

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

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

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

.form-input.error {
    border-color: var(--hh-danger);
}

.form-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.form-error {
    font-size: 0.8rem;
    color: var(--hh-danger);
    margin-top: var(--space-xs);
}

/* ============================================
   Tables
   ============================================ */
.table-wrapper {
    overflow-x: auto;
}

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

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

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-body);
}

.table tbody tr:hover {
    background: var(--bg-card-hover);
}

.table-mono {
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-success {
    background: var(--hh-success-soft);
    color: var(--hh-success);
    border: 1px solid var(--hh-success);
}

.alert-warning {
    background: var(--hh-warning-soft);
    color: #92400e;
    border: 1px solid var(--hh-warning);
}

.alert-danger {
    background: var(--hh-danger-soft);
    color: var(--hh-danger);
    border: 1px solid var(--hh-danger);
}

.alert-info {
    background: var(--hh-info-soft);
    color: var(--hh-info);
    border: 1px solid var(--hh-info);
}

/* ============================================
   Activity Feed
   ============================================ */
.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

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

.activity-text {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   System Status Banner - Premium Design
   ============================================ */
.system-status {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 10px var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
    font-size: 0.8rem;
    position: relative;
    overflow: hidden;
}

.system-status::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #10b981, #059669);
}

.system-status.warning::before {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}

.system-status.danger::before {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}

[data-theme="dark"] .system-status {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.04) 100%);
    border-bottom-color: rgba(16, 185, 129, 0.15);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.01em;
}

[data-theme="dark"] .status-indicator {
    color: #e2e8f0;
}

.status-indicator .status-dot {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-indicator .status-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    animation: statusPulse 2s ease-in-out infinite;
}

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

.system-status.warning .status-dot {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.system-status.danger .status-dot {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.status-metrics {
    display: flex;
    gap: 6px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.status-badge:hover {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
    transform: translateY(-1px);
}

[data-theme="dark"] .status-badge {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

[data-theme="dark"] .status-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
}

.status-badge .region-flag {
    font-size: 12px;
    line-height: 1;
}

.status-badge .uptime-value {
    font-weight: 700;
    font-size: 11px;
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.status-link:hover {
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.08);
}

.status-link i {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.status-link:hover i {
    transform: translateX(2px);
}

[data-theme="dark"] .status-link {
    color: #94a3b8;
}

[data-theme="dark"] .status-link:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
}

/* ============================================
   Quick Actions Grid
   ============================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-md);
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
}

.quick-action:hover {
    border-color: var(--hh-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.quick-action i {
    font-size: 1.5rem;
    color: var(--hh-primary);
}

.quick-action span {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================================
   Dropdown Menus
   ============================================ */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-sm) 0;
    z-index: 1000;
    display: none;
}

.dropdown.open .dropdown-menu,
.dropdown-menu.open,
.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    cursor: pointer;
}

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

.dropdown-item i {
    width: 16px;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-sm) 0;
}

/* ============================================
   Modals
   ============================================ */
/* Standard modal backdrop */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.modal-backdrop.open {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal-backdrop .modal,
.modal-backdrop .modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.95);
    transition: transform var(--transition-fast);
}

.modal-backdrop.open .modal,
.modal-backdrop.open .modal-content {
    transform: scale(1);
}

/* Alternative modal structure (container with overlay + content) */
.modal:not(.modal-backdrop) {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.modal:not(.modal-backdrop).open {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal .modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal .modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.95);
    transition: transform var(--transition-fast);
    z-index: 1;
}

.modal.open .modal-content {
    transform: scale(1);
}

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

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

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

.modal-body {
    padding: var(--space-lg);
}

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

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 13px;
    }
    
    .page-content {
        padding: var(--space-md);
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .topbar {
        padding: 0 var(--space-md);
    }
    
    .topbar-search {
        display: none;
    }
    
    .user-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .service-header {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .service-status {
        align-self: flex-start;
    }
}

/* ============================================
   Utilities
   ============================================ */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.truncate { 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
}
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }

/* Copy button */
.copy-btn {
    padding: 2px 6px;
    font-size: 0.7rem;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: var(--hh-primary);
    color: white;
    border-color: var(--hh-primary);
}

/* Code blocks */
code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-code);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: var(--hh-primary);
}

pre {
    background: var(--bg-code);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-body) 25%,
        var(--border-color) 50%,
        var(--bg-body) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

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

/* Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: var(--text-primary);
    color: var(--bg-card);
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
    margin-bottom: 6px;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}
