/* ─── GEI Team Portal — Mobile-First Styles ──────────────── */

:root {
    --red:       #9A0000;
    --red-dark:  #6e0000;
    --red-light: #f9e8e6;
    --gray-50:   #f8f9fa;
    --gray-100:  #f0f0f0;
    --gray-200:  #e0e0e0;
    --gray-400:  #9e9e9e;
    --gray-600:  #616161;
    --gray-800:  #212121;
    --white:     #ffffff;
    --green:     #2e7d32;
    --green-bg:  #e8f5e9;
    --amber:     #e65100;
    --amber-bg:  #fff3e0;
    --blue:      #1565c0;
    --blue-bg:   #e3f2fd;
    --radius:    10px;
    --shadow:    0 2px 12px rgba(0,0,0,.10);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ─── Login ──────────────────────────────────────────────── */
.login-page {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 16px 60px;
    background: var(--gray-100);
    min-height: 100vh;
}

.login-wrap {
    width: 100%;
    max-width: 420px;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-img {
    width: 260px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.logo-sub {
    font-size: 12px;
    color: var(--gray-400);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 8px;
}

.login-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.login-form h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--gray-800);
}

.admin-toggle-wrap {
    text-align: center;
    padding: 8px 0;
}

.admin-form { margin-top: 0; }
.hidden { display: none !important; }

/* ─── Fields ─────────────────────────────────────────────── */
.field-group {
    margin-bottom: 16px;
}

.field-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.field-group input[type="text"],
.field-group input[type="password"],
.field-group input[type="date"],
.field-group input[type="datetime-local"] {
    width: 100%;
    padding: 13px 14px;
    font-size: 16px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--gray-800);
    outline: none;
    transition: border-color .15s;
    -webkit-appearance: none;
}

.field-group input:focus {
    border-color: var(--red);
}

.hint {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, transform .08s;
    -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(.97); }

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

.btn-secondary { background: var(--gray-200); color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-400); color: var(--white); }

.btn-warning   { background: var(--amber-bg); color: var(--amber); border: 1.5px solid var(--amber); }
.btn-danger    { background: var(--red-light); color: var(--red); border: 1.5px solid var(--red); }

.btn-full { width: 100%; margin-top: 10px; }

.btn-link {
    background: none;
    border: none;
    color: var(--red);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    padding: 4px 0;
}

.btn-link:hover { text-decoration: underline; }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 500;
}

.alert-error   { background: var(--red-light);  color: var(--red-dark); border: 1px solid #e6b0ab; }
.alert-success { background: var(--green-bg);   color: var(--green);    border: 1px solid #a5d6a7; }
.alert-warning { background: var(--amber-bg);   color: var(--amber);    border: 1px solid #ffcc80; }

/* ─── Portal Header ──────────────────────────────────────── */
.portal-header,
.admin-header {
    background: var(--white);
    border-bottom: 3px solid var(--red);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 6px rgba(0,0,0,.08);
}

.header-brand {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.brand-gei {
    font-size: 22px;
    font-weight: 900;
    color: var(--red);
    letter-spacing: 2px;
}

.brand-team {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

.logout-link {
    font-size: 13px;
}

/* ─── Portal Main ─────────────────────────────────────────── */
.portal-main,
.admin-main {
    padding: 16px;
    max-width: 700px;
    margin: 0 auto;
}

.date-bar {
    font-size: 13px;
    color: var(--gray-400);
    text-align: center;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: .8px;
}

/* ─── Status Bar ─────────────────────────────────────────── */
.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: .2px;
}

.status-bar-icon { font-size: 11px; }

.status-bar-in    { background: var(--green-bg);  color: var(--green);   border: 1.5px solid #a5d6a7; }
.status-bar-lunch { background: var(--amber-bg);  color: var(--amber);   border: 1.5px solid #ffcc80; }
.status-bar-done  { background: var(--gray-100);  color: var(--gray-600); border: 1.5px solid var(--gray-200); }
.status-bar-out   { background: var(--gray-100);  color: var(--gray-600); border: 1.5px solid var(--gray-200); }

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

.card-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-600);
    margin-bottom: 16px;
    border-bottom: 1px solid var(--gray-100);
    padding-bottom: 10px;
}

/* ─── Event Log ──────────────────────────────────────────── */
.event-log {
    margin-bottom: 16px;
}

.event-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

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

.event-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-start_day    { background: var(--green); }
.dot-lunch_out    { background: var(--amber); }
.dot-lunch_in     { background: var(--blue); }
.dot-job_transfer { background: #7b1fa2; }
.dot-end_day      { background: var(--gray-400); }

.event-label { font-weight: 600; flex: 1; }
.event-job   { color: var(--gray-600); font-size: 13px; }
.event-time  { color: var(--gray-400); font-size: 13px; margin-left: auto; }

/* ─── Status Badges ──────────────────────────────────────── */
.status-badge {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 12px;
}

.status-working { background: var(--green-bg);   color: var(--green); }
.status-lunch   { background: var(--amber-bg);   color: var(--amber); }
.status-done    { background: var(--gray-100);   color: var(--gray-600); }

.clock-prompt {
    color: var(--gray-600);
    margin-bottom: 8px;
    font-size: 15px;
}

.clock-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ─── Forms Grid ─────────────────────────────────────────── */
.forms-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.form-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    border-radius: 8px;
    background: var(--gray-50);
    color: var(--gray-800);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background .12s;
    border: 1px solid var(--gray-100);
}

.form-tile:hover,
.form-tile:active {
    background: var(--red-light);
    color: var(--red-dark);
    border-color: var(--red);
}

.form-tile-arrow {
    width: 18px;
    height: 18px;
    color: var(--gray-400);
    flex-shrink: 0;
}

.form-tile:hover .form-tile-arrow { color: var(--red); }

/* ─── Modal ──────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    padding: 0;
}

.modal {
    background: var(--white);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius) var(--radius) 0 0;
    max-height: 92vh;
    overflow-y: auto;
    animation: slide-up .2s ease;
}

@keyframes slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@media (min-width: 540px) {
    .modal-overlay { align-items: center; padding: 16px; }
    .modal { border-radius: var(--radius); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--gray-100);
}

.modal-footer .btn { flex: 1; }

/* ─── Checkbox group ─────────────────────────────────────── */
.check-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
}

.check-label:last-child { border-bottom: none; }

.check-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--red);
    cursor: pointer;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 15px;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--red);
}

.modal-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 16px 0 8px;
}

.modal-section-title:first-child { margin-top: 0; }

/* ─── Admin Table ─────────────────────────────────────────── */
.admin-page .portal-main { max-width: 100%; }
.admin-header .header-brand { gap: 8px; }

.filter-bar {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 16px;
    background: var(--white);
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.filter-bar label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-bar input[type="date"] {
    padding: 9px 12px;
    font-size: 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    outline: none;
}

.filter-bar input[type="date"]:focus { border-color: var(--red); }

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    font-size: 13px;
}

.admin-table th {
    background: var(--gray-800);
    color: var(--white);
    padding: 11px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
}

.admin-table tbody tr:hover { background: var(--gray-50); }
.row-flagged td { background: #fff0ef !important; }
.row-flagged:hover td { background: #fde8e6 !important; }

.equip-cell {
    font-size: 12px;
    color: var(--gray-600);
    max-width: 180px;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.tag-start_day    { background: var(--green-bg);  color: var(--green); }
.tag-lunch_out    { background: var(--amber-bg);  color: var(--amber); }
.tag-lunch_in     { background: var(--blue-bg);   color: var(--blue); }
.tag-job_transfer { background: #f3e5f5; color: #7b1fa2; }
.tag-end_day      { background: var(--gray-100);  color: var(--gray-600); }
.tag-yes          { background: var(--green-bg);  color: var(--green); }
.tag-hv           { background: var(--amber-bg);  color: var(--amber); }

.empty-state {
    text-align: center;
    color: var(--gray-400);
    padding: 48px 16px;
    font-size: 15px;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (min-width: 600px) {
    .clock-actions { flex-direction: row; flex-wrap: wrap; }
    .clock-actions .btn-full { width: auto; flex: 1; }
    .forms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
}
