/* =============================================================
   InfraAtlas Premium Design System (Dark Theme, Responsive, Glassmorphic)
   ============================================================= */

:root {
    /* Color Palette */
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-glass: rgba(17, 24, 39, 0.45);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: #6366f1;
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.35);
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --success-glow: rgba(16, 185, 129, 0.3);
    
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --danger-hover: #dc2626;
    
    --info: #06b6d4;
    --info-bg: rgba(6, 182, 212, 0.15);

    /* Fonts & Radii */
    --font-sans: 'Inter', sans-serif;
    --font-title: 'Outfit', sans-serif;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    font-weight: 600;
    color: #ffffff;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
    color: inherit;
}

/* Utility Classes */
.hidden { display: none !important; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-right { text-align: right; }
.mt-3 { margin-top: 1rem; }
.divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }

/* Glassmorphism panel styling */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.btn i {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.btn-danger {
    background-color: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
    background-color: var(--danger);
    color: #ffffff;
}

.btn-success {
    background-color: var(--success-bg);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.25);
}
.btn-success:hover {
    background-color: var(--success);
    color: #ffffff;
}

.btn-info {
    background-color: var(--info-bg);
    color: var(--info);
    border-color: rgba(6, 182, 212, 0.25);
}
.btn-info:hover {
    background-color: var(--info);
    color: #ffffff;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--text-secondary);
}

.btn-full { width: 100%; }

.btn-icon-only {
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}
.btn-icon-only:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

/* -------------------------------------------------------------
   Auth Screen Overlay
   ------------------------------------------------------------- */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 8, 15, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .logo-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-glow);
    color: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
}

.auth-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* -------------------------------------------------------------
   Forms & Input Fields
   ------------------------------------------------------------- */
.form-group {
    margin-bottom: 1.25rem;
}

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

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

.input-wrapper i {
    position: absolute;
    left: 12px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.input-wrapper input {
    padding-left: 38px;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.875rem;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: #ffffff;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

select option {
    background-color: #111827;
    color: #ffffff;
    padding: 0.5rem;
}

input[type="file"] {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 0.4rem 0.8rem;
    margin-right: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

input[type="file"]::file-selector-button:hover {
    background-color: var(--primary-hover);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

/* Switches & Toggles */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

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

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

.switch-small {
    width: 38px;
    height: 20px;
}
.switch-small .slider:before {
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
}
input:checked + .switch-small .slider:before {
    transform: translateX(18px);
}

.checkboxes-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.25rem;
}

.checkbox-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.toggles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.toggle-control {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.toggle-label {
    display: flex;
    flex-direction: column;
}

.toggle-label strong {
    font-size: 0.9rem;
    color: #ffffff;
}

.toggle-label span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Alert styling */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.alert-danger {
    background-color: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

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

.sidebar {
    width: 260px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    border-top: 0;
    border-left: 0;
    border-bottom: 0;
}

.sidebar-brand {
    padding: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-glow);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--primary-glow);
}

.brand-name {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: 1.25rem;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.sidebar-menu {
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.menu-item i {
    width: 20px;
    height: 20px;
}

.menu-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}

.menu-item.active {
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-title);
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.user-role {
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.btn-logout {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}
.btn-logout:hover {
    color: var(--danger);
}

/* -------------------------------------------------------------
   Main Content Area
   ------------------------------------------------------------- */
.main-content {
    margin-left: 260px;
    padding: 2.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.25rem;
}

.content-header h1 {
    font-size: 2rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.indicator-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.content-body {
    flex-grow: 1;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* -------------------------------------------------------------
   Dashboard Metrics
   ------------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

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

.icon-primary { background: var(--primary-glow); color: var(--primary); }
.icon-success { background: var(--success-bg); color: var(--success); }
.icon-info { background: var(--info-bg); color: var(--info); }
.icon-danger { background: var(--danger-bg); color: var(--danger); }

.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 0.8125rem; color: var(--text-secondary); font-weight: 500; }
.stat-value { font-size: 1.625rem; font-weight: 700; color: #ffffff; line-height: 1.2; }

/* Resources meters */
.resources-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.25rem;
}

@media (max-width: 992px) {
    .resources-grid { grid-template-columns: 1fr; }
}

.resource-card {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.resource-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.resource-meters {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.meter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.meter-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.meter-info strong {
    color: #ffffff;
}

.meter-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease-out;
}
.fill-cpu { background: var(--primary); }
.fill-ram { background: var(--success); }
.fill-disk { background: var(--info); }
.fill-extradisk { background: var(--warning); }

.stats-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.mini-stat {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mini-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.mini-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.25rem;
}
.mini-label i { width: 12px; height: 12px; }

.alert-zone {
    max-height: 160px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
}

.alert-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    border-left: 3px solid transparent;
}
.alert-item-warning {
    background: rgba(245, 158, 11, 0.08);
    border-left-color: var(--warning);
    color: #fef3c7;
}
.alert-item-warning i { color: var(--warning); flex-shrink: 0; width: 16px; height: 16px; }

/* -------------------------------------------------------------
   Table Styling
   ------------------------------------------------------------- */
.card-section {
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-header h2 {
    font-size: 1.15rem;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.data-table th, .data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.015);
}

.sortable-col {
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.sortable-col:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.sort-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-left: 0.35rem;
    opacity: 0.6;
    transition: var(--transition);
}

.sortable-col:hover .sort-icon {
    opacity: 1;
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

.actions-col {
    width: 100px;
    text-align: right;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* -------------------------------------------------------------
   Clusters Panel
   ------------------------------------------------------------- */
.section-actions {
    margin-bottom: 1.5rem;
    text-align: right;
}

.clusters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.cluster-card {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cluster-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.cluster-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.cluster-card p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cluster-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.cluster-actions {
    display: flex;
    gap: 0.5rem;
}

/* -------------------------------------------------------------
   VM Filters & Page
   ------------------------------------------------------------- */
.filter-actions-bar {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    flex-grow: 1;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 280px;
    flex-grow: 1;
}

.search-box i {
    position: absolute;
    left: 12px;
    width: 16px;
    color: var(--text-muted);
}

.search-box input {
    padding-left: 36px;
}

.filter-dropdown {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 130px;
}

.filter-dropdown label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.filter-dropdown select {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

.vms-table-wrapper {
    padding: 0.5rem 0;
}

/* -------------------------------------------------------------
   Reports Page
   ------------------------------------------------------------- */
.report-controls {
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.report-controls h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.presets-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.presets-row .btn-outline {
    font-size: 0.8125rem;
    padding: 0.5rem 1rem;
}

.presets-row .btn-outline.active {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: #ffffff;
}

.report-options {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}

.report-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.report-actions {
    display: flex;
    gap: 0.75rem;
}

.report-results-wrapper {
    padding: 1.5rem;
}

/* -------------------------------------------------------------
   Settings Pane
   ------------------------------------------------------------- */
.settings-card {
    padding: 2rem;
}

.settings-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.settings-header i {
    width: 28px;
    height: 28px;
    color: var(--primary);
    margin-top: 0.25rem;
}

.settings-header h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

/* -------------------------------------------------------------
   Modal Dialogs
   ------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(5, 8, 15, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 1.5rem;
}

.modal-box {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    border-radius: var(--radius-md);
    animation: modalSlide 0.3s ease-out;
}

.modal-large {
    max-width: 780px;
}

.modal-alert {
    max-width: 440px;
    text-align: center;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

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

.btn-close {
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}
.btn-close:hover {
    color: #ffffff;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    gap: 1.5rem;
}

.modal-tab-btn {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.modal-tab-btn:hover {
    color: #ffffff;
}

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

.modal-tab-content {
    display: none;
}

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

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
}

.modal-body {
    padding: 1rem 0;
}

.alert-icon-large {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem auto;
    display: block;
}

/* -------------------------------------------------------------
   Responsive Design & Mobile Menu
   ------------------------------------------------------------- */
@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-radius: 0;
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    
    .menu-item span {
        display: none;
    }
    
    .sidebar-footer {
        padding: 0.75rem 1rem;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.25rem;
    }
    
    .content-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-box {
        padding: 1.25rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------------------------------------
   Print-Friendly Stylesheets
   ------------------------------------------------------------- */
@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-size: 10pt;
    }
    
    .sidebar,
    .content-header,
    .filter-actions-bar,
    .report-controls,
    .actions-col,
    .table-actions,
    .modal-overlay,
    #auth-overlay,
    .divider,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .report-results-wrapper {
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
    }
    
    .data-table {
        border-collapse: collapse !important;
    }
    
    .data-table th, .data-table td {
        border: 1px solid #000000 !important;
        color: #000000 !important;
        padding: 6px !important;
        background: transparent !important;
    }
    
    .badge {
        border: 1px solid #000000 !important;
        color: #000000 !important;
        background: transparent !important;
        padding: 2px 4px !important;
    }
}
