/* ============================================
   Aero Design Variables & Theme Base
   ============================================ */

:root {
    --primary: #1e83ec;
    --primary-dark: #0053a0;
    --primary-light: #72b9ff;
    --secondary: #4a6886;
    --success: #2eaf3e;
    --danger: #e23636;
    --warning: #f1a500;
    --info: #00a0e9;
    
    /* Aero Glass Base Colors */
    --aero-glass-bg: rgba(230, 242, 255, 0.45);
    --aero-glass-border: rgba(255, 255, 255, 0.7);
    --aero-glass-inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 0 10px rgba(255, 255, 255, 0.5);
    
    --bg-primary: #dbeaf7;
    --bg-secondary: rgba(255, 255, 255, 0.75);
    --bg-tertiary: rgba(220, 235, 252, 0.6);
    
    --text-primary: #0f2438;
    --text-secondary: #335270;
    --text-muted: #6482a0;
    
    --border: rgba(180, 205, 230, 0.8);
    --border-dark: rgba(120, 155, 190, 0.9);
    
    --shadow-sm: 0 2px 4px rgba(0, 30, 60, 0.15);
    --shadow: 0 4px 10px rgba(0, 30, 60, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    --shadow-md: 0 8px 20px rgba(0, 30, 60, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    --shadow-lg: 0 15px 30px rgba(0, 20, 50, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    
    --radius: 6px;
    --radius-lg: 10px;
    
    --transition: all 0.25s cubic-bezier(0.1, 0.9, 0.2, 1);
}

[data-theme="dark"] {
    --primary: #3b9cff;
    --primary-dark: #1e70c9;
    --primary-light: #99ccff;
    --secondary: #6e8fae;
    --success: #3cd451;
    --danger: #f85252;
    --warning: #ffbd2e;
    --info: #38c3ff;
    
    /* Dark Aero Glass Colors */
    --aero-glass-bg: rgba(12, 24, 38, 0.65);
    --aero-glass-border: rgba(255, 255, 255, 0.25);
    --aero-glass-inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 0 12px rgba(0, 100, 200, 0.2);
    
    --bg-primary: #0a131d;
    --bg-secondary: rgba(18, 32, 48, 0.8);
    --bg-tertiary: rgba(28, 48, 70, 0.6);
    
    --text-primary: #e6f2ff;
    --text-secondary: #b0ccde;
    --text-muted: #7193b0;
    
    --border: rgba(60, 95, 125, 0.6);
    --border-dark: rgba(90, 135, 170, 0.8);
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.6) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(114, 185, 255, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #cbe0f5 0%, #e8f3fc 50%, #b3d5f7 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

[data-theme="dark"] body {
    background-image: 
    url('../images/bg_dark.webp');
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
        /*radial-gradient(circle at 20% 20%, rgba(70, 130, 180, 0.2) 0%, transparent 40%),*/
        /*radial-gradient(circle at 80% 80%, rgba(0, 50, 100, 0.4) 0%, transparent 50%),*/
        /*linear-gradient(135deg, #060c14 0%, #101c2b 50%, #0a1522 100%);*/
}

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

a:hover {
    color: var(--primary-dark);
    text-shadow: 0 0 8px rgba(114, 185, 255, 0.6);
}

/* ============================================
   Custom Modal (Aero Glass Dialog)
   ============================================ */

#modal-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

#modal-container.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 45, 0.4);
    backdrop-filter: blur(8px);
}

.modal-dialog {
    position: relative;
    background: var(--aero-glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--aero-glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), var(--aero-glass-inner-glow);
    width: 100%;
    max-width: 420px;
    margin: 1rem;
    z-index: 1;
    overflow: hidden;
    animation: modalSlideIn 0.25s cubic-bezier(0.1, 0.9, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.modal-close {
    background: linear-gradient(180deg, #f8a5a5 0%, #d93636 50%, #b81414 100%);
    border: 1px solid #8d0b0b;
    border-radius: 3px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: var(--transition);
}

.modal-close:hover {
    background: linear-gradient(180deg, #fca5a5 0%, #ee4444 50%, #cc1111 100%);
    box-shadow: 0 0 8px rgba(238, 68, 68, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.modal-body {
    padding: 1.25rem;
    color: var(--text-primary);
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.3);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(180deg, rgba(235, 245, 255, 0.4) 0%, rgba(200, 225, 250, 0.6) 100%);
    border-top: 1px solid var(--border);
}

.modal-footer .btn {
    min-width: 80px;
}

/* ============================================
   Navigation (Aero Glass Toolbar)
   ============================================ */

.navbar {
    background: var(--aero-glass-bg);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border-bottom: 1px solid var(--aero-glass-border);
    padding: 0.625rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow), var(--aero-glass-inner-glow);
}

.navbar-admin {
    background: linear-gradient(180deg, rgba(30, 131, 236, 0.8) 0%, rgba(0, 83, 160, 0.85) 100%);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.navbar-admin a {
    color: white;
}

.navbar-admin a:hover {
    color: var(--primary-light);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.nav-brand a {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.nav-brand-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 80, 160, 0.3));
}

.nav-search {
    flex: 1;
    max-width: 400px;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form input {
    flex: 1;
    padding: 0.4rem 0.875rem;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.search-form input:focus {
    background: #ffffff;
    box-shadow: 0 0 8px var(--primary-light), inset 0 1px 2px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
    outline: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.4rem 0.875rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: var(--transition);
}

.nav-links a:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(210, 235, 255, 0.5) 100%);
    border-color: var(--aero-glass-border);
    color: var(--text-primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.nav-links a.active {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 50%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary-dark);
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-center {
    margin: 0 auto;
}

.doc-status {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.doc-status.unsaved {
    color: #8a5700;
    background: linear-gradient(180deg, #fff9e6 0%, #ffe399 100%);
    border-color: #f1a500;
}

/* ============================================
   Container & Layout
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.auth-card {
    background: var(--aero-glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--aero-glass-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg), var(--aero-glass-inner-glow);
}

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

.auth-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
}

/* ============================================
   Forms & Controls
   ============================================ */

.form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-light), inset 0 1px 1px rgba(0, 0, 0, 0.1);
}

.form-group input:disabled,
.form-group select:disabled {
    background: rgba(220, 230, 240, 0.5);
    cursor: not-allowed;
    color: var(--text-muted);
}

.form-group small {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.inline-form {
    display: inline;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============================================
   Buttons (Aero Glass Gel Buttons)
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    
    /* Standard Aero Glossy Button Gradient */
    background: linear-gradient(180deg, #ffffff 0%, #f0f5fa 48%, #d8e5f2 52%, #c2d7ec 100%);
    border: 1px solid #7092b0;
    color: var(--text-primary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 3px rgba(0, 0, 0, 0.15);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.btn:hover {
    background: linear-gradient(180deg, #ffffff 0%, #e8f3fc 48%, #c8e0f8 52%, #a8ccf0 100%);
    border-color: #3c7fb1;
    box-shadow: 0 0 8px rgba(114, 185, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    color: #000;
}

.btn:active {
    background: linear-gradient(180deg, #d0e0f0 0%, #b8d0e8 100%) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    transform: translateY(1px) !important;
}

.nav-links a:active {
    background: linear-gradient(180deg, #d0e0f0 0%, #b8d0e8 100%) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    transform: translateY(1px) !important;
}

.btn-primary {
    background: linear-gradient(180deg, #8bc4ff 0%, #3b95f5 48%, #1371db 52%, #0555b7 100%);
    border: 1px solid #003c82;
    color: white;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #a3d2ff 0%, #52a4f7 48%, #2882e6 52%, #0e67d6 100%);
    border-color: #002d62;
    box-shadow: 0 0 10px rgba(59, 149, 245, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    color: white;
}
/* Primary (Blue) Button Press */
.btn-primary:active {
    background: linear-gradient(180deg, #0555b7 0%, #1371db 48%, #3b95f5 100%) !important;
    border-color: #002d62 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 -1px 0 rgba(255, 255, 255, 0.2) !important;
    transform: translateY(1px);
}

.btn-secondary {
    background: linear-gradient(180deg, #ffffff 0%, #e6ecf2 48%, #d0dadf 52%, #bc2c6 100%);
    border: 1px solid #8ca0b3;
    color: var(--text-primary);
}

.btn-danger {
    background: linear-gradient(180deg, #fca5a5 0%, #ef4444 48%, #dc2626 52%, #991b1b 100%);
    border: 1px solid #7f1d1d;
    color: white;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(180deg, #fecaca 0%, #f87171 48%, #e11d48 52%, #b91c1c 100%);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    color: white;
}

.btn-sm {
    padding: 0.3rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    text-shadow: none;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.4);
    border-color: var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ============================================
   Alerts
   ============================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: linear-gradient(180deg, #e6f9ed 0%, #c3f1d0 100%);
    color: #115e25;
    border: 1px solid #72d993;
}

.alert-error {
    background: linear-gradient(180deg, #ffebeb 0%, #fccaca 100%);
    color: #881313;
    border: 1px solid #f87171;
}

.alert-warning {
    background: linear-gradient(180deg, #fffbeb 0%, #fde68a 100%);
    color: #78350f;
    border: 1px solid #fbbf24;
}

/* ============================================
   Cards & Content Windows
   ============================================ */

.card {
    background: var(--aero-glass-bg);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid var(--aero-glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow), var(--aero-glass-inner-glow);
    transition: var(--transition);
}

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

.card-header h2, .card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* ============================================
   Tables
   ============================================ */

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.table th {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(210, 230, 245, 0.8) 100%);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-dark);
}

.table tr {
    background: rgba(255, 255, 255, 0.4);
}

.table tr:hover {
    background: linear-gradient(180deg, rgba(230, 245, 255, 0.7) 0%, rgba(200, 230, 255, 0.7) 100%);
}

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

.nav-links a {
}

[data-theme="dark"] .nav-links a {
    color: white;
}


/* Dark Theme Overrides */
[data-theme="dark"] .table th {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(30, 50, 70, 0.8) 100%);
}

[data-theme="dark"] .table tr {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .table tr:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(40, 70, 100, 0.6) 100%);
}

/* ============================================
   Document Cards Grid
   ============================================ */

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

.section-header h1 {
    font-size: 1.75rem;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.doc-card {
    display: flex;
    flex-direction: column;
    background: var(--aero-glass-bg);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border: 1px solid var(--aero-glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow), var(--aero-glass-inner-glow);
    transition: all 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
}

.doc-card:hover {
    box-shadow: var(--shadow-md), 0 0 15px rgba(114, 185, 255, 0.5), var(--aero-glass-inner-glow);
    border-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-3px);
}

.doc-card-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.doc-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.doc-title a {
    color: var(--text-primary);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.doc-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.doc-excerpt {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.doc-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.875rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

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

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

/* Badges (Glass Pills) */
.privacy-badge,
.permission-badge,
.role-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.privacy-public, .status-badge.active, .perm-edit {
    background: linear-gradient(180deg, #dcfce7 0%, #86efac 100%);
    color: #14532d;
    border-color: #4ade80;
}

.privacy-link_only, .perm-view {
    background: linear-gradient(180deg, #dbeafe 0%, #93c5fd 100%);
    color: #1e3a8a;
    border-color: #60a5fa;
}

.privacy-editors_only {
    background: linear-gradient(180deg, #f3e8ff 0%, #c4b5fd 100%);
    color: #581c87;
    border-color: #a78bfa;
}

.privacy-me_only, .status-badge.inactive {
    background: linear-gradient(180deg, #fee2e2 0%, #fca5a5 100%);
    color: #7f1d1d;
    border-color: #f87171;
}

.permission-badge, .perm-owner {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    border-color: var(--primary-dark);
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
}

/* ============================================
   Editor Page
   ============================================ */

.editor-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

.editor-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.doc-title-input {
    flex: 1;
    font-size: 1.75rem;
    font-weight: 600;
    border: none;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    border: 1px solid transparent;
}

.doc-title-input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-light);
}

#editor-container {
    min-height: 500px;
    background: white;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.ql-toolbar.ql-snow {
    position: sticky;
    top: 60px;
    z-index: 1000;
    background: linear-gradient(180deg, #ffffff 0%, #e8f2fc 100%) !important;
    border-bottom: 1px solid var(--border-dark) !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* ============================================
   Document View Window
   ============================================ */

.document-view {
    background: var(--aero-glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--aero-glass-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    max-width: 90%;
    margin: 0 auto;
    box-shadow: var(--shadow-lg), var(--aero-glass-inner-glow);
}

.doc-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.doc-header h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.doc-content pre {
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.doc-content code {
    background: rgba(220, 235, 250, 0.8);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* ============================================
   Stats Cards (Aero Gadget Style)
   ============================================ */

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

.stat-card {
    background: var(--aero-glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--aero-glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow), var(--aero-glass-inner-glow);
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md), 0 0 12px rgba(114, 185, 255, 0.4);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Toast Notifications (Glass Popups)
   ============================================ */

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 380px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--aero-glass-bg);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid var(--aero-glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg), var(--aero-glass-inner-glow);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
}

.toast-show {
    transform: translateX(0);
    opacity: 1;
}

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

/* ============================================
   Loading Overlay
   ============================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 25, 45, 0.4);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    background: var(--aero-glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--aero-glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg), var(--aero-glass-inner-glow);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   User Avatar
   ============================================ */

.user-avatar, .owner-avatar, .nav-user-avatar {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 50%, var(--primary-dark) 100%);
    color: white;
    border: 1px solid var(--primary-dark);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 2px 4px rgba(0, 0, 0, 0.2);
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
}

/* ============================================
   Quill Dark Mode Exclusions
   ============================================ */

[data-theme="dark"] #editor-container,
[data-theme="dark"] #editor-container .ql-editor,
[data-theme="dark"] #editor-container .ql-toolbar,
[data-theme="dark"] #editor-container .ql-container {
    background: #ffffff !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
}

[data-theme="dark"] #editor-container .ql-toolbar {
    background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%) !important;
}

[data-theme="dark"] .btn,
[data-theme="dark"] .btn-sm,
[data-theme="dark"] .btn-secondary {
    color: #000000 !important;
    border-color: #cbd5e1 !important;
}

[data-theme="dark"] .btn-ghost {
    color: #ffffff !important;
}


.doc-meta-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.theme-switch svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

/* ============================================
   Navbar Theme Switcher Size & Visibility Fix
   ============================================ */

.theme-switch {
    /* Prevent the button from collapsing inside flex containers */
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    /* Enforce explicit dimensions and touch target */
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 0.875rem !important;
    margin: 0 0.25rem !important;

    /* Aero Glass Button Styling */
    background: linear-gradient(180deg, #ffffff 0%, #f0f5fa 48%, #d8e5f2 52%, #c2d7ec 100%) !important;
    border: 1px solid #7092b0 !important;
    border-radius: var(--radius) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 3px rgba(0, 0, 0, 0.15) !important;

    /* Typography & Visibility */
    color: var(--text-primary) !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.theme-switch:hover {
    background: linear-gradient(180deg, #ffffff 0%, #e8f3fc 48%, #c8e0f8 52%, #a8ccf0 100%) !important;
    border-color: #3c7fb1 !important;
    box-shadow: 0 0 8px rgba(114, 185, 255, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    color: #000000 !important;
}

.theme-switch:active {
    background: linear-gradient(180deg, #d0e0f0 0%, #b8d0e8 100%) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    transform: translateY(1px);
}

/* Dark theme specific adjustments */
[data-theme="dark"] .theme-switch {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%) !important;
    border-color: var(--aero-glass-border) !important;
    color: var(--text-primary) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .theme-switch:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.15) 100%) !important;
    box-shadow: 0 0 10px rgba(114, 185, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

.logo {
            /* Adjust max-width based on how large you want the image */
            max-width: 100px; 
            height: auto;
            margin-bottom: 10px;
        }
     
     
     
     
     
     

.nav-user {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%) !important;
    border-color: var(--aero-glass-border) !important;
    color: var(--text-primary) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6) !important;
}

.nav-user:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.15) 100%) !important;
    box-shadow: 0 0 10px rgba(114, 185, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}   

.nav-user:active {
    background: linear-gradient(180deg, #d0e0f0 0%, #b8d0e8 100%) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    transform: translateY(1px);
}


/* Dark theme specific adjustments */
[data-theme="dark"] .nav-user {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%) !important;
    border-color: var(--aero-glass-border) !important;
    color: var(--text-primary) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .nav-user:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.15) 100%) !important;
    box-shadow: 0 0 10px rgba(114, 185, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}




@media print {
  /* Hide navigation, buttons, and sidebars when printing */
  .navbar,
  .btn,
  button,
  aside,
  .site-banner,
  .theme-toggle {
    display: none !important;
  }

  /* Expand main document area to full width */
  .main-content,
  .document-view {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important; /* Removes card drop-shadow */
  }
}


/*.doc-container {*/
/*max-width: 100% !important;*/
/*    width: 100% !important;*/
/*    margin: 0 !important;*/
    /*padding: 0 !important;*/
/*}*/



/* ============================================
   Collaborators & Recent Activity Sidebar Styling
   ============================================ */

.collaborators-section,
.activity-section {
    background: var(--aero-glass-bg);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border: 1px solid var(--aero-glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow), var(--aero-glass-inner-glow);
}

.collaborators-section h3,
.activity-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Reset Unordered Lists */
.collaborator-list,
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Collaborator Items */
.collaborator-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* Activity Items */
.activity-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.84375rem;
    background: rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius);
}

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

/* Activity Text Elements */
.activity-action {
    font-weight: 600;
    color: var(--primary);
}

.activity-user {
    color: var(--text-primary);
    font-weight: 500;
}

.activity-time {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
}


/* Fix icon buttons without changing HTML */
.nav-links a.nav-user[style*="gap:0"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.nav-links a.nav-user[style*="gap:0"] svg {
    display: block !important;
    margin: auto !important;
}

.role-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
}








/* ULTRA-COMPACT FIXED FOOTER */
footer.site-footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    z-index: 9999 !important;
    
    /* Drastically reduced padding and height */
    padding: 0.4rem 1.5rem !important;
    margin: 0 !important;
    box-sizing: border-box !important;

    /* Theme Styling */
    background: var(--aero-glass-bg, rgba(255, 255, 255, 0.75)) !important;
    backdrop-filter: blur(12px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(180%) !important;
    border-top: 1px solid var(--aero-glass-border, rgba(255, 255, 255, 0.4)) !important;
}

/* Single-line flex row layout */
footer.site-footer .footer-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 15px !important;
}

footer.site-footer .footer-brand {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    max-width: none !important;
}

footer.site-footer .footer-logo {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
}

footer.site-footer .footer-desc {
    font-size: 0.72rem !important;
    margin: 0 !important;
    opacity: 0.8 !important;
    line-height: 1 !important;
}

/* Inline contacts & hide extra headers */
footer.site-footer .footer-contacts h4 {
    display: none !important; /* Hides "Contact & Compliance" header to save vertical space */
}

footer.site-footer .contact-list {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 0.72rem !important;
}

footer.site-footer .contact-list li {
    display: inline-flex !important;
    gap: 4px !important;
}

/* Compact copyright line inline */
footer.site-footer .footer-bottom {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 0.7rem !important;
    opacity: 0.6 !important;
}


/* SITE BANNER STYLING */
.site-banner {
    width: 100%;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 0.6rem 1.2rem;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease-in-out;
}


[data-theme="dark"] .site-banner {
    width: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 0.6rem 1.2rem;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease-in-out;
}

.site-banner-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #2c3e50;
    font-weight: 500;
}


[data-theme="dark"] .site-banner-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #dbedff;
    font-weight: 500;
}

.banner-badge {
    background: #0078d4;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 120, 212, 0.3);
}

.banner-text {
    line-height: 1.3;
    text-align: center;
}

/* ============================================
   Mobile & Tablet Responsivity Enhancements
   ============================================ */

/* Prevent horizontal viewport overflow & handle rich content safely */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.document-view,
.doc-content,
.doc-header h1,
.doc-title,
.card,
.collaborators-section,
.activity-section {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.doc-content img,
.doc-content video,
.doc-content iframe,
.doc-content embed,
.doc-content object {
    max-width: 100% !important;
    height: auto !important;
}

.doc-content pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.doc-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Tablet & Small Laptop Breakpoint (<= 1024px) */
@media screen and (max-width: 1024px) {
    .navbar {
        padding: 0.625rem 1.25rem;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .container {
        padding: 1.5rem;
    }

    .document-view {
        max-width: 96%;
        padding: 2rem;
    }

    .editor-page {
        padding: 1rem 1.25rem;
    }
}

/* Mobile & Phablet Breakpoint (<= 768px) */
@media screen and (max-width: 768px) {
    /* Navbar: Wrap cleanly without needing HTML changes or hamburger JS */
    .navbar {
        padding: 0.625rem 0.875rem;
        gap: 0.625rem;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .nav-brand a {
        font-size: 1.125rem;
    }

    .logo {
        max-width: 80px;
        margin-bottom: 0;
    }

    /* Search bar spans full row cleanly when present */
    .nav-search {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
    }

    .search-form {
        width: 100%;
    }

    /* Navigation links & action buttons wrap neatly */
    .nav-links {
        order: 4;
        flex: 1 1 100%;
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.4rem;
        padding-top: 0.4rem;
        border-top: 1px solid var(--border);
    }

    .nav-links a,
    .nav-links .btn {
        padding: 0.375rem 0.65rem;
        font-size: 0.8125rem;
    }

    /* Remove hard left margin on inline-styled report buttons so wrapped rows align */
    .nav-links button[style*="margin-left"],
    .activity-section button[style*="margin-left"] {
        margin-left: 0 !important;
        margin-top: 0.25rem;
    }

    .nav-center {
        order: 2;
        margin: 0;
    }

    /* Site Banner */
    .site-banner,
    [data-theme="dark"] .site-banner {
        padding: 0.5rem 0.75rem;
    }

    .site-banner-content,
    [data-theme="dark"] .site-banner-content {
        flex-wrap: wrap;
        gap: 6px;
        font-size: 0.8rem;
        text-align: center;
    }

    /* Main Container & Cards */
    .container {
        padding: 1rem 0.75rem 4rem 0.75rem;
    }

    .card {
        padding: 1.125rem;
        margin-bottom: 1rem;
    }

    .card-header,
    .section-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .section-header h1 {
        font-size: 1.4rem;
    }

    /* Document Grid & Cards */
    .document-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .doc-card {
        padding: 1rem;
    }

    .doc-card-header,
    .doc-card-footer,
    .doc-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Document View Page (view.php) */
    .document-view {
        max-width: 100%;
        width: 100%;
        padding: 1.25rem 1rem;
    }

    .doc-header {
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
    }

    .doc-header h1 {
        font-size: 1.5rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }

    .doc-meta {
        flex-wrap: wrap;
        gap: 0.5rem 0.875rem;
        font-size: 0.78rem;
    }

    /* Collaborators & Activity Sidebars */
    .collaborators-section,
    .activity-section {
        padding: 1rem;
        margin-top: 1rem;
    }

    .collaborator-list li,
    .activity-list li {
        flex-wrap: wrap;
        gap: 0.375rem 0.5rem;
    }

    .activity-time {
        margin-left: 0;
        width: 100%;
        font-size: 0.72rem;
    }

    /* Editor Page */
    .editor-page {
        padding: 0.75rem;
    }

    .editor-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .doc-title-input {
        width: 100%;
        flex: 1 1 100%;
        font-size: 1.25rem;
    }

    #editor-container {
        min-height: 360px;
    }

    .ql-toolbar.ql-snow {
        position: static;
    }

    /* Tables: Scroll horizontally instead of breaking layout */
    .table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table th,
    .table td {
        padding: 0.625rem 0.75rem;
        white-space: nowrap;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.875rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-number {
        font-size: 1.75rem;
    }

    /* Auth Pages */
    .auth-card {
        padding: 1.5rem 1.25rem;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    /* Forms & Modals */
    .form-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .form-actions .btn {
        flex: 1 1 auto;
    }

    .modal-dialog {
        margin: 0.75rem;
        max-width: calc(100vw - 1.5rem);
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-footer {
        flex-wrap: wrap;
    }

    #report-modal > div {
        width: 92% !important;
        padding: 1.25rem !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* Toast Notifications */
    .toast-container {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 1rem;
        max-width: calc(100vw - 1.5rem);
    }

    /* Compact Fixed Footer on Mobile */
    footer.site-footer {
        position: static !important;
        width: 100% !important;
        padding: 0.75rem 1rem !important;
    }

    footer.site-footer .footer-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    footer.site-footer .footer-brand {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.25rem !important;
    }

    footer.site-footer .contact-list {
        flex-direction: column !important;
        gap: 0.25rem !important;
    }
}

/* Small Smartphone Breakpoint (<= 480px) */
@media screen and (max-width: 480px) {
    .navbar {
        padding: 0.5rem 0.625rem;
    }

    .nav-links {
        justify-content: space-between;
    }

    .nav-links a,
    .nav-links .btn {
        flex: 1 1 auto;
        text-align: center;
        justify-content: center;
        padding: 0.35rem 0.5rem;
        font-size: 0.78rem;
    }

    .theme-switch {
        margin-left: auto !important;
    }

    .container {
        padding: 0.75rem 0.5rem 2.5rem 0.5rem;
    }

    .document-view {
        padding: 1rem 0.75rem;
        border-radius: var(--radius);
    }

    .doc-header h1 {
        font-size: 1.25rem;
    }

    .doc-meta {
        font-size: 0.75rem;
        gap: 0.375rem 0.625rem;
    }

    .collaborators-section,
    .activity-section {
        padding: 0.875rem 0.75rem;
        border-radius: var(--radius);
    }

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

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 0.875rem;
    }
}






















/* Fullscreen Loading Overlay */
        #loading-overlay {
            position: fixed; top: 0; left: 0; width: 100%; height: 100%;
            background: rgba(0, 0, 0, 0.6);
            z-index: 10000; display: none; /* Hidden by default */
            justify-content: center; align-items: center;
            backdrop-filter: blur(2px); /* Fits the Aero aesthetic */
        }
        .spinner {
            border: 5px solid rgba(255, 255, 255, 0.3); border-top: 5px solid #fff;
            border-radius: 50%; width: 50px; height: 50px;
            animation: spin 1s linear infinite;
        }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

        /* Graceful Toast Notifications */
        #toast-container {
            position: fixed; bottom: 30px; right: 30px; z-index: 10001;
            display: flex; flex-direction: column; gap: 10px;
        }
        /* True Aero Glass Toast */
        .toast {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.3) 100%);
            backdrop-filter: blur(10px) saturate(150%);
            -webkit-backdrop-filter: blur(10px) saturate(150%);
            color: #111; /* Dark text for readability */
            padding: 15px 25px; 
            border-radius: 6px;
            border: 1px solid rgba(255, 255, 255, 0.5);
            border-top: 1px solid rgba(255, 255, 255, 0.9); /* Top glass highlight */
            box-shadow: 0 8px 24px rgba(0,0,0,0.15), inset 0 1px 1px rgba(255, 255, 255, 0.8);
            font-family: "Segoe UI", Tahoma, sans-serif; 
            font-size: 14px;
            font-weight: 500;
            text-shadow: 0 1px 2px rgba(255,255,255,0.8);
            opacity: 0; transform: translateX(50px);
            transition: opacity 0.4s ease, transform 0.4s ease;
        }
        .toast.show { opacity: 1; transform: translateX(0); }
        
        
        
        /* Inline kód blokkok javítása sötét módban */
        [data-theme="dark"] .ql-editor code,
        [data-theme="dark"] code {
            background-color: rgba(255, 255, 255, 0.1) !important;
            color: #e0e0e0 !important;
            border: 1px solid rgba(255, 255, 255, 0.2) !important;
        }