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

:root {
    --primary:      #2563eb;
    --primary-dark: #1d4ed8;
    --danger:       #dc2626;
    --success:      #16a34a;
    --warning:      #d97706;
    --option:       #3d30c9;
    --bg:           #f1f5f9;
    --surface:      #ffffff;
    --border:       #e2e8f0;
    --text:         #1e293b;
    --text-muted:   #64748b;
    --radius:       8px;
    --shadow:       0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ── */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
}

.nav-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    letter-spacing: -.3px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: .9rem;
}

.nav-links a { color: var(--text-muted); font-weight: 500; }
.nav-links a:hover { color: var(--primary); text-decoration: none; }

.nav-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--text);
    font-weight: 500;
}

.role-badge {
    font-size: .7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.role-admin   { background: #dbeafe; color: #1d4ed8; }
.role-manager { background: #d1fae5; color: #065f46; }
.role-cleaner { background: #fef9c3; color: #854d0e; }

.nav-account-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 500;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    transition: background .15s;
}
.nav-account-btn:hover { background: var(--border); text-decoration: none; }

/* ── Main / Container ── */
main { flex: 1; }

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

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

/* ── Card ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
}

/* ── Forms ── */
.form-group { margin-bottom: 1.1rem; }

label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    margin-bottom: .4rem;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .95rem;
    color: var(--text);
    background: var(--surface);
    transition: border-color .15s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: .55rem 1.25rem;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background .15s;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    width: 100%;
    padding: .65rem;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-sm {
    padding: .3rem .75rem;
    font-size: .8rem;
    width: auto;
}

.btn-danger  { background: var(--danger);  color: #fff; }
.btn-option  { background: var(--option);  color: #fff; }
.btn-success { background: var(--success); color: #fff; }

/* ── Alerts ── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .9rem;
    margin-bottom: 1rem;
}
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

/* ── Page header ── */
.page-header {
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}
.page-header p {
    color: var(--text-muted);
    margin-top: .25rem;
    font-size: .9rem;
}

/* ── Dashboard grid ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

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

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: .25rem;
    color: var(--primary);
}

/* ── Table ── */
.table-wrap { overflow-x: auto; }

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

th, td {
    padding: .65rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: var(--bg);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* ── Account page ── */
.account-option {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    transition: background .12s;
}
.account-option:last-child { border-bottom: none; }
.account-option:hover { background: var(--bg); text-decoration: none; }

.account-option-title { font-weight: 600; font-size: .95rem; }
.account-option-desc  { font-size: .825rem; color: var(--text-muted); margin-top: .15rem; }

.account-option-danger .account-option-title { color: var(--danger); }
.account-option-option .account-option-title { color: var(--option); }

/* ── Login page ── */
.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}
.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}
.login-logo p {
    color: var(--text-muted);
    font-size: .875rem;
    margin-top: .25rem;
}

/* ── Checklist ── */
.checklist-section { margin-bottom: 1.5rem; }

.checklist-divider {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
    padding: .4rem 0;
    margin-bottom: .5rem;
    border-bottom: 2px solid var(--border);
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .5rem;
    cursor: pointer;
    transition: background .12s;
    user-select: none;
}
.checklist-item:hover { background: #f8fafc; }
.checklist-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--primary);
}
.checklist-item span {
    flex: 1;
    font-size: .9rem;
    line-height: 1.5;
}
.checklist-item.completed span {
    text-decoration: line-through;
    color: var(--text-muted);
}

.checklist-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 .25rem;
    line-height: 1;
    flex-shrink: 0;
}
.checklist-delete:hover { color: var(--danger); }

.checklist-add {
    display: flex;
    gap: .5rem;
    margin-bottom: .75rem;
}
.checklist-add input {
    flex: 1;
}
.checklist-add .btn {
    width: auto;
    white-space: nowrap;
}

.cl-line {
    display: block;
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: .2rem;
}
.checklist-item.completed .cl-line { color: var(--text-muted); }

.cl-type {
    font-weight: 700;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 1px 6px;
    border-radius: 4px;
}
.cl-discharge { background: #fee2e2; color: var(--danger); }
.cl-arrival   { background: #dcfce7; color: var(--success); }

.checklist-empty {
    color: var(--text-muted);
    font-size: .9rem;
    padding: .5rem 0;
}

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 1.25rem;
    font-size: .8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--surface);
}
