/**
 * Event Manager - Main Stylesheet
 * Modern, clean design with light blue theme
 * Mobile-First Optimized
 */

:root {
    --primary-color: #4A90E2;
    --primary-dark: #357ABD;
    --primary-light: #6BA3E8;
    --secondary-color: #E8F4FD;
    --success-color: #5CB85C;
    --warning-color: #F0AD4E;
    --danger-color: #D9534F;
    --info-color: #5BC0DE;
    --light-color: #F8F9FA;
    --dark-color: #343A40;
    --border-color: #DEE2E6;
    --text-color: #333333;
    --text-muted: #6C757D;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    
    /* Mobile Touch Targets - min 44px für Apple/Google Guidelines */
    --touch-target-min: 44px;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

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

html {
    /* Prevent font scaling in landscape while allowing user zoom */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #E8F4FD 0%, #FFFFFF 100%);
    min-height: 100vh;
    /* Prevent horizontal scroll on mobile */
    overflow-x: hidden;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

/* Header */
header {
    background: white;
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 1.8rem;
}

/* Navigation */
nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

nav a.active {
    color: var(--primary-color);
}

/* Main Content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--secondary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 0.5rem 0;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    min-height: var(--touch-target-min);
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

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

.btn-success:hover:not(:disabled) {
    background: #4cae4c;
}

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

.btn-danger:hover:not(:disabled) {
    background: #c9302c;
}

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

.btn-warning:hover:not(:disabled) {
    background: #ec971f;
}

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

.btn-light:hover:not(:disabled) {
    background: #e2e6ea;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    min-height: 38px;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Button Group - Mobile optimiert */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

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

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

.form-label.required::after {
    content: " *";
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    /* 16px minimum verhindert iOS Zoom bei Fokus */
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: border-color 0.3s, box-shadow 0.3s;
    min-height: var(--touch-target-min);
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-control:disabled {
    background: var(--light-color);
    cursor: not-allowed;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

.form-help {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

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

.form-control.is-valid {
    border-color: var(--success-color);
}

/* Checkbox and Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    min-height: var(--touch-target-min);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin: 0;
}

.form-check label {
    cursor: pointer;
    user-select: none;
    flex: 1;
    padding: 0.5rem 0;
}

/* Tables */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: 
        linear-gradient(to right, white 30%, rgba(255,255,255,0)),
        linear-gradient(to right, rgba(255,255,255,0), white 70%) 0 100%,
        radial-gradient(farthest-side at 0% 50%, rgba(0,0,0,.1), rgba(0,0,0,0)),
        radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.1), rgba(0,0,0,0)) 0 100%;
    background-repeat: no-repeat;
    background-color: white;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-position: 0 0, 100%, 0 0, 100%;
    background-attachment: local, local, scroll, scroll;
}

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

table thead {
    background: var(--secondary-color);
}

table th {
    padding: 0.875rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

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

table tbody tr:hover {
    background: var(--light-color);
}

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

.table-actions {
    display: flex;
    gap: 0.25rem;
    flex-wrap: nowrap;
}

.table-actions .btn {
    padding: 0.375rem 0.5rem;
    min-height: 36px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35em 0.65em;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: white;
    text-align: center;
    white-space: nowrap;
    border-radius: 4px;
}

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

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

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

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Footer */
footer {
    background: white;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--touch-target-min);
    padding: 0.5rem 0;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.col { flex: 1; padding: 0 0.75rem; }
.col-auto { flex: 0 0 auto; padding: 0 0.75rem; }
.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 0.75rem; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0 0.75rem; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 0.75rem; }
.col-3 { flex: 0 0 25%; max-width: 25%; padding: 0 0.75rem; }

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

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.stat-icon.blue { background: var(--primary-color); }
.stat-icon.green { background: var(--success-color); }
.stat-icon.yellow { background: var(--warning-color); }
.stat-icon.red { background: var(--danger-color); }
.stat-icon.purple { background: #9B59B6; }

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* Auth Pages */
.auth-container {
    max-width: 450px;
    margin: 3rem auto;
}

.auth-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

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

.auth-header h1 {
    margin: 1rem 0 0.5rem;
    font-size: 1.75rem;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active { display: flex; }

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

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

.modal-header h3 { margin: 0; font-size: 1.25rem; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover { color: var(--text-color); }
.modal-body { padding: 1.5rem; }

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

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
    padding: 0.875rem 1.25rem;
    text-decoration: none;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
    min-height: var(--touch-target-min);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

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

/* Progress Bar */
.progress {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

.progress-bar.success { background: var(--success-color); }
.progress-bar.warning { background: var(--warning-color); }
.progress-bar.danger { background: var(--danger-color); }

/* Contact Person Box */
.contact-person-box {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.25rem;
    background: var(--secondary-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.contact-person-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.contact-person-info { flex: 1; min-width: 0; }
.contact-person-info h3 { margin: 0 0 0.5rem 0; font-size: 1.25rem; }
.contact-person-info p { margin: 0 0 1rem 0; color: var(--text-muted); }

.contact-person-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-person-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.5rem 0;
    min-height: var(--touch-target-min);
}

.contact-person-link:hover { text-decoration: underline; }
.contact-person-link i { width: 20px; flex-shrink: 0; }

/* Mobile Navigation Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

/* Form Builder */
.form-builder {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.field-list,
.preview-area {
    min-height: 400px;
}

/* =====================================================
   RESPONSIVE - TABLETS (max-width: 992px)
   ===================================================== */
@media (max-width: 992px) {
    .container { padding: 0 15px; }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .form-builder { grid-template-columns: 1fr; }
    
    table { font-size: 0.9rem; }
    table th, table td { padding: 0.625rem; }
    
    .col-4 { flex: 0 0 50%; max-width: 50%; }
    .col-3 { flex: 0 0 50%; max-width: 50%; }
}

/* =====================================================
   RESPONSIVE - MOBILE (max-width: 768px)
   ===================================================== */
@media (max-width: 768px) {
    body { font-size: 15px; }
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.35rem; }
    h3 { font-size: 1.15rem; }
    
    .container, .container-fluid { padding: 0 12px; }
    
    header { padding: 0.75rem 0; }
    .header-content { position: relative; }
    
    .logo {
        font-size: 1.15rem;
        max-width: calc(100% - 60px);
    }
    
    .logo i { font-size: 1.4rem; flex-shrink: 0; }
    
    /* Mobile Navigation */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    nav {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        background: white;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1rem;
        transition: right 0.3s ease-out;
    }
    
    nav.active { display: block; right: 0; }
    nav::before { content: ''; display: block; height: 50px; }
    
    nav ul {
        flex-direction: column;
        gap: 0;
        padding-bottom: 2rem;
    }
    
    nav ul li { border-bottom: 1px solid var(--border-color); }
    
    nav ul li a {
        display: flex;
        padding: 1rem 0.75rem;
        width: 100%;
        min-height: var(--touch-target-min);
        font-size: 1rem;
    }
    
    nav ul li a i { width: 24px; text-align: center; }
    
    nav ul li:last-child {
        border-bottom: none;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 2px solid var(--border-color);
    }
    
    nav ul li[style*="margin-left"] {
        margin-left: 0 !important;
        padding-left: 0 !important;
        border-left: none !important;
        padding: 1rem 0.75rem;
    }
    
    nav ul li[style*="margin-left"] span {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
    }
    
    main { padding: 1rem 0; }
    
    .card { padding: 1rem; margin-bottom: 1rem; }
    
    .card-header {
        font-size: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .card-header h2 {
        font-size: 1.1rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .card-header .btn { width: 100%; }
    
    .btn { padding: 0.75rem 1rem; font-size: 0.95rem; }
    .btn-sm { padding: 0.5rem 0.75rem; font-size: 0.875rem; }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn { width: 100%; }
    
    .form-control { padding: 0.75rem 1rem; min-height: 48px; }
    textarea.form-control { min-height: 120px; }
    .form-group { margin-bottom: 1rem; }
    
    .table-container {
        margin: 0 -12px;
        padding: 0 12px;
    }
    
    table { font-size: 0.85rem; min-width: 500px; }
    table th, table td { padding: 0.625rem 0.5rem; }
    
    .dashboard-stats { grid-template-columns: 1fr; gap: 0.75rem; }
    
    .stat-card { padding: 1rem; gap: 1rem; }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        border-radius: 10px;
    }
    
    .stat-info h3 { font-size: 1.5rem; }
    .stat-info p { font-size: 0.8rem; }
    
    .row { margin: 0; }
    
    .col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0;
        margin-bottom: 1rem;
    }
    
    footer { padding: 1.5rem 0; margin-top: 2rem; }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .footer-links { flex-direction: column; gap: 0; }
    .footer-links a { justify-content: center; }
    
    .auth-container { margin: 1rem auto; padding: 0; }
    
    .auth-card {
        padding: 1.25rem;
        border-radius: 8px;
        margin: 0 -12px;
    }
    
    .auth-header h1 { font-size: 1.5rem; }
    
    .modal { padding: 0.5rem; align-items: flex-end; }
    
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        max-height: 90dvh;
        border-radius: 16px 16px 0 0;
    }
    
    .modal-header, .modal-body, .modal-footer { padding: 1rem; }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
    }
    
    .modal-footer .btn { width: 100%; }
    
    .tabs { margin: 0 -12px 1.5rem; padding: 0 12px; }
    .tab { padding: 0.75rem 1rem; font-size: 0.9rem; }
    
    .contact-person-box {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1rem;
    }
    
    .contact-person-icon {
        margin: 0 auto;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .contact-person-info h3 { font-size: 1.1rem; }
    .contact-person-links { align-items: center; }
    
    .alert { padding: 0.875rem; font-size: 0.9rem; }
    .alert i { font-size: 1.1rem; }
    
    .badge { font-size: 0.7rem; padding: 0.3em 0.55em; }
    
    .progress { height: 10px; border-radius: 5px; }
    
    .field-list, .preview-area { min-height: 300px; }
    
    .text-right { text-align: left; }
}

/* =====================================================
   RESPONSIVE - SMALL MOBILE (max-width: 480px)
   ===================================================== */
@media (max-width: 480px) {
    body { font-size: 14px; }
    .container, .container-fluid { padding: 0 10px; }
    .logo { font-size: 1rem; }
    .card { padding: 0.875rem; border-radius: 6px; }
    .card-header h2 { font-size: 1rem; }
    .btn { padding: 0.625rem 0.875rem; font-size: 0.9rem; }
    
    .stat-card { flex-direction: row; text-align: left; }
    .stat-icon { width: 45px; height: 45px; font-size: 1.25rem; }
    .stat-info h3 { font-size: 1.35rem; }
    
    nav { width: 100%; max-width: 100%; }
    
    .contact-person-box { padding: 0.875rem; }
    .modal-content { border-radius: 12px 12px 0 0; }
    
    .tabs { margin-left: -10px; margin-right: -10px; padding: 0 10px; }
    
    table { font-size: 0.8rem; }
    table th, table td { padding: 0.5rem 0.375rem; }
    .table-actions .btn { padding: 0.3rem 0.4rem; font-size: 0.75rem; }
}

/* =====================================================
   LANDSCAPE MOBILE
   ===================================================== */
@media (max-width: 768px) and (orientation: landscape) {
    nav { width: 50%; max-width: 320px; }
    
    .modal { align-items: center; }
    .modal-content { max-height: 85dvh; border-radius: 12px; }
    
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================
   SAFE AREA INSETS (iPhone Notch)
   ===================================================== */
@supports (padding: env(safe-area-inset-bottom)) {
    footer { padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
    nav { padding-bottom: env(safe-area-inset-bottom); }
}

/* =====================================================
   TOUCH DEVICE OPTIMIZATIONS
   ===================================================== */
@media (hover: none) and (pointer: coarse) {
    .btn:hover:not(:disabled) { transform: none; }
    .stat-card:hover { transform: none; }
    table tbody tr:hover { background: transparent; }
    
    .btn:active:not(:disabled) { transform: scale(0.98); opacity: 0.9; }
    .stat-card:active { transform: scale(0.98); }
    
    .form-check input[type="checkbox"],
    .form-check input[type="radio"] { width: 22px; height: 22px; }
}

/* =====================================================
   REDUCED MOTION (Accessibility)
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    nav { transition: none; }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    header, footer, nav, .btn, .mobile-menu-toggle, .session-timer {
        display: none !important;
    }
    
    body { background: white; font-size: 12pt; }
    .card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
    .table-container { overflow: visible; }
    table { font-size: 10pt; }
    a { text-decoration: none; color: inherit; }
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */
.d-mobile-only { display: none !important; }

@media (max-width: 768px) {
    .d-mobile-only { display: block !important; }
    .d-desktop-only { display: none !important; }
    .d-none-mobile { display: none !important; }
}
