/* ================================
   Mikrotik Manager - Professional Theme
   Design: Dark Elegant with Cyan Accents
================================ */

/* ================================
   Fonts & External Resources
================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* ================================
   CSS Variables - Dark Theme
================================ */
:root {
    /* Primary Colors */
    --primary: #00d4aa;
    --primary-dark: #00a88a;
    --primary-light: #33e0bd;
    --primary-glow: rgba(0, 212, 170, 0.3);
    
    /* Background Colors */
    --bg-darkest: #0a0e14;
    --bg-dark: #0f1419;
    --bg-card: #151b23;
    --bg-card-hover: #1a222c;
    --bg-input: #1e2733;
    
    /* Text Colors */
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    
    /* Status Colors */
    --success: #2ea043;
    --success-light: #238636;
    --success-glow: rgba(46, 160, 67, 0.4);
    --danger: #f85149;
    --danger-light: #da3633;
    --danger-glow: rgba(248, 81, 73, 0.4);
    --warning: #d29922;
    --warning-glow: rgba(210, 153, 34, 0.4);
    --info: #58a6ff;
    
    /* Borders & Shadows */
    --border-color: #21262d;
    --border-light: #30363d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--primary-glow);
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-darkest);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 170, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(88, 166, 255, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

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

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

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

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

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

/* ================================
   Login Page
================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: 
        radial-gradient(ellipse at 30% 0%, rgba(0, 212, 170, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 100%, rgba(88, 166, 255, 0.08) 0%, transparent 50%),
        var(--bg-darkest);
}

.login-container {
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.6s ease-out;
}

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

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

.login-logo .logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--info));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    color: var(--bg-darkest);
    box-shadow: var(--shadow-glow);
}

.login-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ================================
   Form Elements
================================ */
.form-group {
    margin-bottom: 20px;
}

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

.form-group label i {
    margin-right: 8px;
    color: var(--primary);
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: var(--transition);
}

.input-wrapper input:focus + i,
.input-wrapper input:not(:placeholder-shown) + i {
    color: var(--primary);
}

input, select, textarea {
    width: 100%;
    padding: 14px 16px;
    padding-left: 44px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

input:not(.input-wrapper input),
select,
textarea {
    padding-left: 16px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--bg-card);
}

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

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* ================================
   Buttons
================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--bg-darkest);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    color: var(--bg-darkest);
}

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

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

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-light));
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-light), #c22c25);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 20px var(--danger-glow);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-light));
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 20px var(--success-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--bg-darkest);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--border-radius-sm);
}

/* ================================
   App Layout with Sidebar
================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
}

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

.sidebar-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--info));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--bg-darkest);
    flex-shrink: 0;
}

.sidebar-brand {
    flex: 1;
    min-width: 0;
}

.sidebar-brand h1 {
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

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

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    margin-bottom: 4px;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.15), rgba(0, 212, 170, 0.05));
    color: var(--primary);
    border-left: 3px solid var(--primary);
    margin-left: -3px;
}

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

.nav-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

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

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--info));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-darkest);
    font-weight: 700;
    font-size: 0.95rem;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

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

/* Header */
.main-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
}

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

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

/* Page Content */
.page-content {
    flex: 1;
    padding: 24px;
}

/* ================================
   Stats Cards
================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: rgba(0, 212, 170, 0.15);
    color: var(--primary);
}

.stat-icon.success {
    background: rgba(46, 160, 67, 0.15);
    color: var(--success);
}

.stat-icon.danger {
    background: rgba(248, 81, 73, 0.15);
    color: var(--danger);
}

.stat-icon.warning {
    background: rgba(210, 153, 34, 0.15);
    color: var(--warning);
}

.stat-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 4px;
}

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

/* ================================
   Mikrotik Cards Grid
================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--primary);
}

.mikrotik-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    list-style: none;
}

.mikrotik-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.mikrotik-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
    transition: var(--transition);
}

.mikrotik-card.online::before {
    background: linear-gradient(90deg, var(--success), var(--primary));
}

.mikrotik-card.offline::before {
    background: linear-gradient(90deg, var(--danger), var(--warning));
}

.mikrotik-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.mikrotik-card.online:hover {
    box-shadow: var(--shadow-lg), 0 0 30px var(--success-glow);
}

.mikrotik-card.offline:hover {
    box-shadow: var(--shadow-lg), 0 0 30px var(--danger-glow);
}

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

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

.card-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-input);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.1rem;
}

.card-title h3 {
    font-size: 1rem;
    font-weight: 600;
}

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

.card-body {
    padding: 20px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row i {
    width: 18px;
    color: var(--text-muted);
}

.info-row .ip-address {
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
    font-size: 0.85rem;
}

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

.status-badge.online {
    background: rgba(46, 160, 67, 0.15);
    color: var(--success);
}

.status-badge.offline {
    background: rgba(248, 81, 73, 0.15);
    color: var(--danger);
}

.status-badge.testing {
    background: rgba(210, 153, 34, 0.15);
    color: var(--warning);
}

.status-badge i {
    font-size: 0.5rem;
}

.card-footer {
    padding: 16px 20px;
    background: var(--bg-input);
    border-top: 1px solid var(--border-color);
}

/* ================================
   Forms - Cards Style
================================ */
.form-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: 
        radial-gradient(ellipse at 30% 0%, rgba(0, 212, 170, 0.08) 0%, transparent 50%),
        var(--bg-darkest);
}

.form-container {
    width: 100%;
    max-width: 520px;
    animation: fadeInUp 0.5s ease-out;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

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

.form-card-header h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.35rem;
}

.form-card-header h2 i {
    color: var(--primary);
}

.form-card-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 8px;
}

.form-card-body {
    padding: 24px;
}

.form-card-footer {
    padding: 20px 24px;
    background: var(--bg-input);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

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

/* ================================
   Wizard Steps
================================ */
.wizard-steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-input);
    color: var(--text-muted);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.wizard-step.active .step-number {
    background: var(--primary);
    color: var(--bg-darkest);
    border-color: var(--primary);
}

.wizard-step.completed .step-number {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.step-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.wizard-step.active .step-label {
    color: var(--primary);
}

.step-connector {
    width: 40px;
    height: 2px;
    background: var(--border-color);
}

.wizard-step.completed + .step-connector,
.step-connector.completed {
    background: var(--success);
}

/* ================================
   Action Grid (for Mikrotik actions)
================================ */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.action-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.action-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.action-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 12px;
    display: block;
}

.action-card h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

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

/* ================================
   Alerts & Messages
================================ */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    animation: fadeInUp 0.3s ease-out;
}

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

.alert-success {
    background: rgba(46, 160, 67, 0.15);
    border: 1px solid rgba(46, 160, 67, 0.3);
    color: var(--success);
}

.alert-danger {
    background: rgba(248, 81, 73, 0.15);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: var(--danger);
}

.alert-warning {
    background: rgba(210, 153, 34, 0.15);
    border: 1px solid rgba(210, 153, 34, 0.3);
    color: var(--warning);
}

.alert-info {
    background: rgba(88, 166, 255, 0.15);
    border: 1px solid rgba(88, 166, 255, 0.3);
    color: var(--info);
}

/* ================================
   Modal
================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

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

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.modal-header h3 i.danger {
    color: var(--danger);
}

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

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    color: var(--text-secondary);
    line-height: 1.7;
}

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

/* ================================
   Tables
================================ */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

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

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

th, td {
    padding: 14px 20px;
    text-align: left;
}

th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

td {
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

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

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

/* ================================
   Empty State
================================ */
.empty-state {
    text-align: center;
    padding: 60px 24px;
}

.empty-state i {
    font-size: 4rem;
    color: var(--border-light);
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ================================
   Loading States
================================ */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

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

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

@media (max-width: 768px) {
    :root {
        --sidebar-width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mikrotik-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-card-footer {
        flex-direction: column;
    }
    
    .form-card-footer .btn {
        width: 100%;
    }
    
    .wizard-steps {
        flex-wrap: wrap;
    }
    
    .step-connector {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-content {
        padding: 16px;
    }
    
    .login-box {
        padding: 24px;
    }
}

/* ================================
   Utilities
================================ */
.hidden { display: none !important; }
.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; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-full { width: 100%; }

/* Scroll styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

/* Selection */
::selection {
    background: var(--primary);
    color: var(--bg-darkest);
}

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

/* Print styles */
@media print {
    .sidebar,
    .header-actions,
    .card-actions,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ================================
   Responsive Scaling for Different Resolutions
================================ */

/* 1920px and above - Full HD */
@media (min-width: 1920px) {
    html { font-size: 16px; }
}

/* 1600px - Large screens */
@media (max-width: 1919px) {
    html { font-size: 15px; }
}

/* 1366px - Medium screens / Laptops */
@media (max-width: 1599px) {
    html { font-size: 14px; }
    :root {
        --sidebar-width: 240px;
    }
}

/* 1280px - Small laptops */
@media (max-width: 1365px) {
    html { font-size: 13px; }
    :root {
        --sidebar-width: 220px;
    }
}

/* 1024px - Tablets landscape */
@media (max-width: 1279px) {
    html { font-size: 13px; }
    :root {
        --sidebar-width: 200px;
    }
    .sidebar-brand h1 {
        font-size: 1rem;
    }
    .nav-item span {
        font-size: 0.85rem;
    }
}

/* 900px - Tablets */
@media (max-width: 1023px) {
    :root {
        --sidebar-width: 70px;
    }
    .sidebar-brand h1,
    .sidebar-brand span,
    .nav-section-title,
    .nav-item span,
    .user-info {
        display: none;
    }
    .sidebar-logo {
        margin: 0 auto;
    }
    .nav-item {
        justify-content: center;
        padding: 14px;
    }
    .nav-item i {
        font-size: 1.2rem;
    }
    .user-avatar {
        margin: 0 auto;
    }
}

/* 768px and below - Mobile */
@media (max-width: 899px) {
    html { font-size: 14px; }
    :root {
        --sidebar-width: 260px;
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 1000;
        transition: transform 0.3s ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-brand h1,
    .sidebar-brand span,
    .nav-section-title,
    .nav-item span,
    .user-info {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .main-header {
        padding: 12px 16px;
    }
    .page-content {
        padding: 16px;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}
.sidebar.open ~ .sidebar-overlay {
    display: block;
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 998;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--bg-darkest);
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
}
@media (max-width: 899px) {
    .mobile-menu-btn {
        display: flex;
    }
}
