/* BMS Timesheet – simple, clean styles */
:root {
    --bg: #f5f5f5;
    --surface: #fff;
    --border: #ddd;
    --text: #222;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --error: #b91c1c;
    --success: #15803d;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0.75rem 1rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.logo { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 0.5rem; }
.logo-img { height: 2rem; width: auto; }
.nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav .user { color: #666; margin-right: 0.5rem; }
.main { max-width: 1200px; margin: 0 auto; padding: 1rem; }

.flashes { list-style: none; padding: 0; margin: 0 0 1rem; }
.flash { padding: 0.5rem 0.75rem; border-radius: 4px; margin-bottom: 0.25rem; }
.flash.error { background: #fef2f2; color: var(--error); }
.flash.success { background: #f0fdf4; color: var(--success); }
.flash.info { background: #eff6ff; color: var(--primary); }

/* Forms */
.form { max-width: 400px; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 4px; font-size: 1rem; }
.form-group .help { display: block; margin-top: 0.25rem; font-size: 0.875rem; color: #666; }
.readonly-input { background: #f1f5f9; }
.btn { display: inline-block; padding: 0.5rem 1rem; border: none; border-radius: 4px; font-size: 1rem; cursor: pointer; background: var(--border); color: var(--text); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn.disabled { opacity: 0.6; cursor: default; pointer-events: none; }

.login-box { max-width: 360px; margin: 2rem auto; padding: 2rem; background: var(--surface); border-radius: 8px; border: 1px solid var(--border); }
.login-box h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.login-subtitle { color: #666; margin: 0 0 1.5rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 4px; overflow: hidden; }
th, td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f8fafc; font-weight: 600; }
tr:hover { background: #f8fafc; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.page-title { margin: 0 0 1rem; font-size: 1.5rem; }
.toolbar { margin-bottom: 1rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* Filters */
.filters { display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: flex-end; }
.filters .form-group { margin-bottom: 0; }
.filters label { margin-right: 0.25rem; }

.timesheet-grid input[type="number"] { width: 4rem; }
.timesheet-grid .day-col { min-width: 5rem; }
.timesheet-grid .weekend { background: #fff7ed; }
.timesheet-grid th.day-col.day-over-limit { background: #fef2f2; border-bottom: 2px solid #dc2626; }
.timesheet-grid td.day-over-limit { background: #fef2f2; }
.timesheet-grid td.overtime-disabled { background: #f1f5f9; }
.timesheet-grid td.overtime-disabled input { background: #e2e8f0; color: #64748b; cursor: not-allowed; }
.timesheet-grid .holiday-label { display: block; font-size: 0.75rem; color: var(--primary); font-weight: normal; }
.timesheet-grid .readonly { color: #666; }
.timesheet-grid .leave-row { background: #f8fafc; }

.reject-form { display: inline-flex; gap: 0.5rem; align-items: center; }
.rejection-input { width: 200px; padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 4px; font-size: 0.9rem; }

.review-submission { margin-bottom: 2rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.review-submission-header { margin-bottom: 0.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.review-actions { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.review-timesheet-grid { margin-top: 0; }

.leave-balances { padding: 0.5rem 0.75rem; margin-bottom: 1rem; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 4px; font-size: 0.95rem; }
.timesheet-section { margin-bottom: 1.5rem; }
.section-title { margin: 0 0 0.5rem; font-size: 1.1rem; }
.timesheet-section .help { margin-bottom: 0.5rem; color: #666; font-size: 0.9rem; }
.leave-days { display: flex; flex-wrap: wrap; gap: 1rem; }
.leave-day { display: inline-flex; align-items: center; gap: 0.35rem; }
.timesheet-grid .row-project { min-width: 180px; }
.timesheet-grid .row-type { min-width: 90px; }
.timesheet-grid .row-type-dash { color: #94a3b8; }
.timesheet-grid .row-option { min-width: 180px; }
.timesheet-grid .row-label { min-width: 180px; font-weight: 500; }
.timesheet-grid .row-type-label { min-width: 90px; color: #475569; }
.timesheet-grid .row-hours { width: 4rem; }

/* Team timesheet status */
.week-badge { display: inline-block; padding: 0.2rem 0.5rem; margin: 0.1rem 0.2rem 0.1rem 0; background: #fef2f2; border: 1px solid #fecaca; border-radius: 4px; font-size: 0.875rem; }
.status-badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.8rem; white-space: nowrap; }
.status-approved { background: #dcfce7; color: #166534; }
.status-submitted { background: #dbeafe; color: #1e40af; }
.status-rejected { background: #fee2e2; color: #b91c1c; }
.status-draft { background: #f1f5f9; color: #475569; }
.status-missing { background: #fef3c7; color: #92400e; }
.status-na { background: #f1f5f9; color: #94a3b8; }
.team-status-grid .week-col { min-width: 6rem; font-size: 0.85rem; }
.team-status-grid .status-cell { vertical-align: middle; }
.muted { color: #64748b; }
