/* --- Modern Dark Theme (Default) --- */
:root {
    /* Custom Purple */
    --primary-color: #3F2392; 
    --primary-hover: #5230b5;
    --secondary-color: #4b5563;
    
    /* Dark Mode Backgrounds */
    --bg-body: #000000; 
    --bg-card: #121212; 
    --bg-input: #1f1f1f;
    --border-color: #2e2e2e;
    
    /* Text Colors */
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    
    /* Status Colors */
    --status-green-bg: #064e3b;
    --status-green-text: #34d399;
    --status-yellow-bg: #451a03;
    --status-yellow-text: #fbbf24;
    --status-red-bg: #450a0a;
    --status-red-text: #f87171;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    margin: 0;
    display: flex;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
}

/* --- Mobile Menu Toggle (Default HIDDEN on Desktop) --- */
#mobile-menu-toggle {
    display: none; /* Strictly hidden on large screens */
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    margin-bottom: 1rem;
}

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

.sidebar-header {
    padding: 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.logo-img { height: 32px; margin-right: 12px; }

.sidebar-nav { list-style: none; padding: 1rem; margin: 0; }
.nav-item { margin-bottom: 4px; }
.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-link:hover { background-color: #1f1f1f; color: var(--text-main); }
.nav-link.active { 
    color: #c4b5fd; 
    background-color: rgba(63, 35, 146, 0.2);
    border-left: 3px solid var(--primary-color);
}

/* --- Main Content --- */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
    max-width: 1600px;
    margin-right: auto;
    width: calc(100% - 260px);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.header h1 { font-size: 2rem; font-weight: 700; margin: 0; }

/* --- Cards --- */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.card-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.card-body { padding: 1.25rem; flex-grow: 1; }
.card-footer {
    padding: 1rem 1.25rem;
    background-color: #1a1a1a;
    border-top: 1px solid var(--border-color);
}

/* --- Calendar / Scheduling --- */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-card);
}
.day-header {
    padding: 10px;
    text-align: center;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    background-color: #1a1a1a;
}
.day-header:last-child { border-right: none; }
.calendar-days { display: contents; }
.day-cell {
    min-height: 140px;
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    position: relative;
}
.day-cell:nth-child(7n) { border-right: none; }
.day-cell.other-month { background-color: #0a0a0a; opacity: 0.5; }
.day-number { font-weight: bold; margin-bottom: 8px; display: block; }
.shift-entry {
    font-size: 0.75rem;
    background-color: #2d2d2d;
    border-left: 3px solid var(--primary-color);
    color: var(--text-main);
    padding: 6px;
    border-radius: 4px;
    margin-bottom: 4px;
}
.shift-entry strong { color: #c4b5fd; display: block; }
.crew-needed { color: var(--status-yellow-text); font-weight: bold; }
.shift-entry-link { display: block; text-decoration: none; color: inherit; margin-bottom: 0.25rem; }
.shift-entry-link .shift-entry { transition: transform 0.2s ease, box-shadow 0.2s ease; margin-bottom: 0; }
.shift-entry-link:hover .shift-entry { transform: scale(1.03); box-shadow: 0 4px 6px rgba(0,0,0,0.3); background-color: #333; }

/* --- Settings Tabs --- */
.tab-nav { display: flex; border-bottom: 1px solid var(--border-color); margin-bottom: 1.5rem; gap: 20px; }
.tab-link {
    background: none; border: none; padding: 10px 0; font-size: 1rem; color: var(--text-muted); cursor: pointer;
    border-bottom: 2px solid transparent; transition: all 0.2s;
}
.tab-link:hover { color: var(--text-main); }
.tab-link.active { color: #c4b5fd; border-bottom: 2px solid var(--primary-color); }

/* --- Forms & Inputs --- */
.form-grid { display: grid; gap: 1.25rem; }
.form-grid-2-col { grid-template-columns: 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-group-checkbox { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
label { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
input, select, textarea {
    background-color: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-main);
    padding: 12px; border-radius: 8px; font-size: 1rem; width: 100%; box-sizing: border-box;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-color); }

/* --- Buttons --- */
.btn {
    padding: 10px 18px; border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer;
    text-decoration: none; display: inline-block; border: 1px solid transparent; transition: all 0.2s;
}
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: transparent; border-color: var(--border-color); color: var(--text-main); }
.btn-secondary:hover { background-color: #2a2a2a; }
.btn-danger { background-color: rgba(239, 68, 68, 0.1); color: #ef4444; border-color: rgba(239, 68, 68, 0.2); }
.btn-danger:hover { background-color: rgba(239, 68, 68, 0.2); }
.btn-success { background-color: rgba(16, 185, 129, 0.1); color: #10b981; border-color: rgba(16, 185, 129, 0.2); }
.btn-success:hover { background-color: rgba(16, 185, 129, 0.2); }

/* --- Tables --- */
.table-container { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 12px 16px; color: var(--text-muted); border-bottom: 1px solid var(--border-color); }
.data-table td { padding: 16px; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }

/* --- Flags & Misc --- */
.employee-flags span { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 12px; margin-top: 4px; margin-right: 4px; }
.flag-last-option { background-color: var(--status-yellow-bg); color: var(--status-yellow-text); }
.flag-union { background-color: #2d2d2d; border: 1px solid var(--border-color); color: var(--text-muted); }
.shift-location { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }
.unassigned-slot { color: var(--text-muted); font-style: italic; opacity: 0.5; }
.crew-list { list-style: none; padding: 0; margin: 0; }
.crew-list-item { padding: 10px; border-radius: 6px; margin-bottom: 4px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.crew-list-item:hover { background-color: #1f1f1f; }
.crew-list-item.unavailable { text-decoration: line-through; color: var(--text-muted); cursor: not-allowed; }
.assignment-columns-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }
.add-crew-footer { padding-top: 1rem; border-top: 1px solid var(--border-color); text-align: center; }
.add-crew-footer a { display: block; width: 100%; }
.role-entry { display: grid; grid-template-columns: 1fr 100px 50px; gap: 0.75rem; align-items: center; margin-bottom: 0.75rem; }
.crew-note { font-style: italic; color: var(--text-muted); font-size: 0.85rem; margin-left: 5px; }
.note-input { background: #2d2d2d; border: 1px solid #444; color: white; padding: 4px 8px; border-radius: 4px; margin-left: 8px; width: 120px; }
/* ... existing input rules ... */

/* FIX: Prevent checkboxes from stretching to 100% width */
input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

/* Ensure the container aligns them correctly */
.form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
/* --- Modal --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.modal-content { background-color: var(--bg-card); border-radius: 12px; width: 90%; max-width: 600px; border: 1px solid var(--border-color); padding: 0; max-height: 85vh; display: flex; flex-direction: column; }
.modal-header { padding: 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; }
.modal-body { padding: 1.5rem; overflow-y: auto; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }

/* --- MOBILE MEDIA QUERY --- */
@media (max-width: 768px) {
    /* Show Hamburger ONLY here */
    #mobile-menu-toggle {
        display: block;
        align-self: flex-start;
        margin-left: -0.5rem;
        margin-bottom: 0.5rem;
    }
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.active { transform: translateX(0); }
    
    .main-content { margin-left: 0; width: 100%; padding: 1rem; }
    .form-grid-2-col { grid-template-columns: 1fr; }
    .assignment-columns-3 { grid-template-columns: 1fr; }
    
    /* Mobile Header */
    .header { flex-direction: column; align-items: stretch; gap: 1rem; }
    .header-actions { display: flex; flex-direction: column; gap: 0.75rem; }
    .header-actions .btn, .header-actions a.btn { width: 100%; text-align: center; margin: 0 !important; }
    
    /* Mobile Calendar */
    .calendar-grid { display: block; border: none; background: transparent; }
    .day-header { display: none; }
    .calendar-days { display: flex; flex-direction: column; gap: 1rem; }
    .day-cell { border: 1px solid var(--border-color); border-radius: 8px; background-color: var(--bg-card); min-height: auto; padding: 1rem; }
    .day-cell.other-month { display: none; }
    
    /* Mobile Tables */
    td .btn { display: block; width: 100%; margin-bottom: 0.5rem; text-align: center; margin-left: 0 !important; }
}/* --- Project Info Grid Layout Fix --- */
.info-item {
    align-items: flex-start; /* Align icon to top */
}

.info-item-content {
    display: flex;
    flex-direction: column; /* Stacks the Header and Value */
    gap: 0.25rem; /* Adds a small space between them */
}

.info-item-content strong {
    color: var(--text-muted); /* Makes the label ("Client:") subtle */
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item-content span {
    color: var(--text-main); /* Makes the value ("ABC Corp") bright white */
    font-size: 1rem;
}

/* --- Fix Table Text Colors --- */
/* Force Shift Names to be White */
.data-table strong {
    color: #ffffff !important;
    font-weight: 700;
}/* --- Map Container (Restored) --- */
.map-container {
    grid-column: 1 / -1; /* Spans full width of the info card */
    width: 100%;
    height: 350px;
    background-color: #1e1e1e; /* Placeholder dark grey */
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}/* --- Position Rate Overrides --- */
.position-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.position-row:last-child {
    border-bottom: none;
}

.position-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-grow: 1;
}

.position-rate-input {
    width: 100px !important; /* Override default width */
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    /* Hide by default, show when checked (handled via JS or just always show) */
}

.checkbox-group {
    max-height: 300px;
    overflow-y: auto;
    background-color: var(--bg-input);
}/* --- Small Buttons for Tables --- */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
    height: fit-content;
    align-self: center;
}

/* Flex container for Time Input + Button */
.time-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}/* --- Time Entry Action Buttons --- */
.btn-clock-in {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981; /* Green */
    border-color: rgba(16, 185, 129, 0.2);
}
.btn-clock-in:hover {
    background-color: rgba(16, 185, 129, 0.2);
}

.btn-clock-out {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444; /* Red */
    border-color: rgba(239, 68, 68, 0.2);
}
.btn-clock-out:hover {
    background-color: rgba(239, 68, 68, 0.2);
}