/* ═══════════════════════════════════════════
   Operational OS "Munich Collection 2026"
   Design System – Light Mode Only
   Based on .gemini BaumEntscheid Standards
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ── */
:root {
    --teal: #003333;
    --teal-light: #004d4d;
    --teal-hover: #005c5c;
    --neon: #A4D152;
    --neon-dim: #93C146;
    --neon-glow: rgba(164, 209, 82, 0.35);

    --bg: #F5F5F3;
    --bg-card: #ffffff;
    --bg-card-hover: #fafbfa;
    --bg-sidebar: #003333;
    --bg-input: #f0f1f0;

    --text-primary: #1a1a2e;
    --text-secondary: #5a5f72;
    --text-muted: #8b8fa3;
    --text-inverse: #ffffff;

    --border: #e4e6e3;
    --border-focus: #003333;

    --success: #22c55e;
    --success-bg: #f0fdf4;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --urgent: #ff6b35;
    --urgent-bg: #fff5f0;
    --info: #3b82f6;
    --info-bg: #eff6ff;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.05);
    --shadow-neon: 0 4px 20px rgba(164, 209, 82, 0.25);

    --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 450ms cubic-bezier(0.4, 0, 0.2, 1);

    --font-heading: 'Archivo Black', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --sidebar-width: 260px;
}

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

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

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

/* ── Typography ── */
h1, h2, h3 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

.label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--teal);
    color: var(--text-inverse);
}
.btn-primary:hover {
    background: var(--teal-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-neon {
    background: var(--neon);
    color: var(--teal);
    font-weight: 700;
}
.btn-neon:hover {
    background: var(--neon-dim);
    transform: translateY(-1px);
    box-shadow: var(--shadow-neon);
}

.btn-outline {
    background: transparent;
    color: var(--teal);
    border: 2px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--teal);
    background: rgba(0, 51, 51, 0.04);
}

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

.btn-sm {
    padding: 7px 16px;
    font-size: 0.8rem;
    border-radius: var(--radius-full);
}

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

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.25rem;
    transition: all var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

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

/* ── Badges / Tags ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-success { background: var(--success-bg); color: #15803d; }
.badge-warning { background: var(--warning-bg); color: #b45309; }
.badge-danger { background: var(--danger-bg); color: #dc2626; }
.badge-urgent { background: var(--urgent-bg); color: var(--urgent); }
.badge-info { background: var(--info-bg); color: #2563eb; }
.badge-teal { background: rgba(0,51,51,0.08); color: var(--teal); }
.badge-neon { background: var(--neon); color: var(--teal); }

/* ── Form Elements ── */
.input, .select {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--bg-card);
}

.input:focus, .select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(0, 51, 51, 0.08);
}

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

textarea.input,
textarea {
    border-radius: var(--radius-lg) !important;
}

/* ── Status Indicator ── */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.live {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
    animation: pulse-dot 2s infinite;
}

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

/* ── Progress Bar ── */
.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--teal), var(--neon));
    transition: width var(--transition-slow);
}

/* ── Shift Card ── */
.shift-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    transition: all var(--transition);
    cursor: default;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.shift-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--teal);
    opacity: 0;
    transition: opacity var(--transition);
}

.shift-card:hover {
    border-color: var(--teal);
    box-shadow: var(--shadow);
}

.shift-card:hover::before {
    opacity: 1;
}

.shift-card.urgent {
    border-color: var(--urgent);
    background: var(--urgent-bg);
}

.shift-card.urgent::before {
    background: var(--urgent);
    opacity: 1;
}

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

.shift-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.shift-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.shift-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.shift-card-slots {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.slot {
    flex: 1;
    padding: 8px 10px;
    border-radius: var(--radius);
    font-size: 0.75rem;
    text-align: center;
    border: 2px dashed var(--border);
    color: var(--text-muted);
    transition: all var(--transition);
}

.slot.filled {
    border-style: solid;
    border-color: var(--teal);
    background: rgba(0, 51, 51, 0.04);
    color: var(--teal);
    font-weight: 600;
}

.slot.disabled {
    opacity: 0.35;
    pointer-events: none;
}

.slot.bookable:hover {
    border-color: var(--neon);
    background: rgba(204, 255, 0, 0.08);
    cursor: pointer;
}

/* ── Stat Cards ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.stat-card .stat-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    line-height: 1;
    color: var(--teal);
    margin: 0.5rem 0 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.stat-card .stat-change {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* ── Table ── */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead {
    background: var(--teal);
    color: var(--text-inverse);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

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

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

/* ── Modal / Overlay ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: block; /* Using block for more predictable scroll behavior */
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 2rem 1rem;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.98);
    transition: transform var(--transition);
    margin: 0 auto; /* Horizontal centering, allow vertical padding of parent to work */
    position: relative;
}

.modal-lg {
    max-width: 600px;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

/* ── Toast / Notifications ── */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: toast-in 0.3s ease;
}

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

@keyframes toast-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ── Spinner ── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 60vh;
    color: var(--text-muted);
}

/* ── Responsive Helpers ── */
.hide-mobile { display: block; }
.show-mobile { display: none; }

@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: block !important; }
    h1 { font-size: 1.35rem; }
    h2 { font-size: 1.15rem; }
}
