/* =====================================================
   CATERING TEMPS PORTAL
   Brand colors from logo: Dark slate #3d4f5f, White
   ===================================================== */

:root {
    --brand-dark: #3d4f5f;
    --brand-darker: #2d3a45;
    --brand-darkest: #1e272e;
    --brand-light: #4a6072;
    --white: #ffffff;
    --off-white: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #868e96;
    --text: #2d3a45;
    --text-light: #6c757d;
    --success: #40c057;
    --warning: #fab005;
    --danger: #fa5252;
    --shadow: 0 2px 8px rgba(61, 79, 95, 0.12);
    --shadow-lg: 0 8px 24px rgba(61, 79, 95, 0.15);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--brand-dark);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* =====================================================
   HEADER - Matches logo style
   ===================================================== */

.header {
    background: var(--brand-darkest);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 0.75rem 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo img {
    height: 50px;
    width: auto;
}

.logo-text {
    color: var(--white);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.logo-text span {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 2px;
    opacity: 0.7;
    margin-top: 2px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
}

/* =====================================================
   BUTTONS
   ===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: var(--white);
    color: var(--brand-dark);
    border-color: var(--white);
}
.btn-primary:hover {
    background: transparent;
    color: var(--white);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-color: rgba(255,255,255,0.2);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}
.btn-outline:hover {
    background: var(--white);
    color: var(--brand-dark);
}

.btn-success {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}
.btn-success:hover {
    background: #37a34a;
    border-color: #37a34a;
}

.btn-dark {
    background: var(--brand-dark);
    color: var(--white);
    border-color: var(--brand-dark);
}
.btn-dark:hover {
    background: var(--brand-darker);
    border-color: var(--brand-darker);
}

.btn-ghost {
    background: transparent;
    color: var(--brand-dark);
    border-color: var(--gray-300);
}
.btn-ghost:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

/* White/light button for dark backgrounds (header nav) */
.btn-light {
    background: transparent;
    color: var(--white);
    border-color: rgba(255,255,255,0.4);
}
.btn-light:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.6);
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* =====================================================
   CARDS
   ===================================================== */

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    background: var(--brand-dark);
    color: var(--white);
}

.card-header-light {
    padding: 1rem 1.5rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 1.5rem;
    background: var(--white);
}

/* =====================================================
   FORMS
   ===================================================== */

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

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

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: all 0.2s;
    background: var(--white);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--brand-dark);
    box-shadow: 0 0 0 3px rgba(61, 79, 95, 0.1);
}

.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.8rem; color: var(--text-light); margin-top: 6px; }

/* =====================================================
   LANDING PAGE
   ===================================================== */

.landing {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--brand-dark);
}

.landing-card {
    max-width: 440px;
    width: 100%;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}

.landing-card .card-body {
    padding: 2.5rem;
}

.landing-logo {
    width: 120px;
    height: auto;
    margin-bottom: 1.5rem;
}

.landing-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--brand-dark);
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.landing-subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.landing-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.landing-divider {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid var(--gray-200);
}

.landing-links h3 {
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1rem;
}

.landing-links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */

.login-container {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--brand-dark);
}

.login-card {
    max-width: 400px;
    width: 100%;
    border: 1px solid rgba(255,255,255,0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-header img {
    width: 80px;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.25rem;
    color: var(--brand-dark);
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.tab-btn:hover { color: var(--brand-dark); }
.tab-btn.active { color: var(--brand-dark); }
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand-dark);
}

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

/* Light tabs for filters */
.tabs-light {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    border: none;
    padding: 0.5rem;
    background: var(--gray-100);
    border-radius: var(--radius);
}

.tabs-light .tab-btn {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 8px 16px;
    font-size: 0.8rem;
}

.tabs-light .tab-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.tabs-light .tab-btn.active {
    background: var(--brand-dark);
    color: var(--white);
    border-color: var(--brand-dark);
}

.tabs-light .tab-btn.active::after {
    display: none;
}

/* =====================================================
   ALERTS
   ===================================================== */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error { background: #fff5f5; color: #c92a2a; border: 1px solid #ffc9c9; }
.alert-success { background: #ebfbee; color: #2b8a3e; border: 1px solid #b2f2bb; }
.alert-warning { background: #fff9db; color: #e67700; border: 1px solid #ffec99; }

/* =====================================================
   DASHBOARD
   ===================================================== */

.dashboard {
    min-height: calc(100vh - 70px);
    background: var(--gray-100);
    padding: 2rem 0;
}

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

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 1.75rem;
    color: var(--brand-dark);
    margin-bottom: 0.25rem;
}

.dashboard-header p {
    color: var(--text-light);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .dashboard-grid { grid-template-columns: 500px 1fr; }
}

@media (min-width: 1200px) {
    .dashboard-grid { grid-template-columns: 580px 1fr; }
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand-dark);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* =====================================================
   TABLES
   ===================================================== */

.table-container { overflow-x: auto; }

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

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

th {
    background: var(--gray-100);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

td { font-size: 0.9rem; }
tr:hover { background: var(--gray-50); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending { background: #fff3bf; color: #e67700; }
.badge-open { background: #d3f9d8; color: #2b8a3e; }
.badge-closed { background: var(--gray-200); color: var(--text-light); }

.action-buttons { display: flex; gap: 6px; flex-wrap: wrap; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* =====================================================
   MODAL
   ===================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

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

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.2s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--brand-dark);
    color: var(--white);
}

.modal-header h2 { font-size: 1rem; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    line-height: 1;
}
.modal-close:hover { color: var(--white); }

.modal-body { padding: 1.5rem; }

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

/* =====================================================
   LOADING
   ===================================================== */

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--brand-dark);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--brand-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-overlay .spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
    border-color: rgba(255,255,255,0.2);
    border-top-color: var(--white);
}

.loading-overlay p {
    margin-top: 1rem;
    color: rgba(255,255,255,0.7);
}

/* =====================================================
   FOOTER
   ===================================================== */

.footer {
    text-align: center;
    padding: 1.5rem;
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    background: var(--brand-darkest);
}

.footer-light {
    background: var(--gray-100);
    color: var(--text-light);
    border-top: 1px solid var(--gray-200);
}

/* =====================================================
   UTILITIES
   ===================================================== */

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
}

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

/* =====================================================
   SHIFT ROWS
   ===================================================== */

.shift-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.shift-row.day-off {
    background: var(--gray-200);
    opacity: 0.7;
}

.shift-row .shift-date {
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 55px;
}

.shift-row .shift-day {
    font-size: 0.75rem;
    color: var(--text-light);
    min-width: 30px;
}

.shift-row .shift-type {
    width: 100px;
    padding: 0.4rem;
    font-size: 0.85rem;
}

.shift-row .shift-times {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.85rem;
}

.shift-row .shift-start,
.shift-row .shift-end {
    width: 90px;
    padding: 0.4rem;
    font-size: 0.85rem;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
    .header-content { flex-direction: column; gap: 1rem; }
    .user-email { display: none; }
    .landing-links-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    th, td { padding: 10px 12px; font-size: 0.8rem; }
    .action-buttons { flex-direction: column; }
    
    .shift-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .shift-row .shift-times {
        flex-wrap: wrap;
    }
}
