:root {
    --bg: #f2edec;
    --panel: #ffffff;
    --ink: #102b2a;
    --muted: #6f6664;
    --line: #ded4d1;
    --primary: #0c3a39;
    --primary-dark: #082b2a;
    --danger: #b94141;
    --ok: #2e7d55;
    --warn: #a66a19;
    --shadow: 0 10px 30px rgba(12, 58, 57, .09);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
}

a { color: var(--primary); text-decoration: none; }
h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.15; letter-spacing: 0; }

.topbar {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 28px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 750;
}

.brand-logo {
    display: block;
    width: auto;
    height: 34px;
    max-width: 150px;
    object-fit: contain;
}

nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px;
}

nav a { color: #263f3e; font-weight: 650; }

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 32px auto 56px;
}

.auth-shell {
    min-height: calc(100vh - 160px);
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(300px, 420px);
    align-items: center;
    gap: 48px;
}

.auth-brand img {
    display: block;
    width: min(240px, 70vw);
    height: auto;
    margin-bottom: 34px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 22px;
}

.table-panel { overflow-x: auto; padding: 0; }

.split-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.narrow { max-width: 760px; margin: 0 auto; }
.muted { color: var(--muted); margin: 0; }
.small { color: var(--muted); font-size: 13px; }

label {
    display: grid;
    gap: 7px;
    margin-bottom: 15px;
    color: #263f3e;
    font-weight: 650;
}

input, select, textarea {
    width: 100%;
    border: 1px solid #d2c6c2;
    border-radius: 6px;
    padding: 11px 12px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}

textarea { resize: vertical; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.five { grid-template-columns: 1fr 1fr 1.4fr .8fr auto; align-items: start; }

.button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 9px 14px;
    background: #fff;
    color: #203836;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.button.primary, button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.button.primary:hover, button.primary:hover { background: var(--primary-dark); }
.button.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.button-row { display: flex; gap: 10px; }

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th, td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: #faf7f6;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--muted);
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.status.pending { background: #fff4df; color: var(--warn); }
.status.approved, .status.active { background: #e1f0ea; color: var(--ok); }
.status.rejected, .status.disabled { background: #f8e1e1; color: var(--danger); }
.status.cancelled { background: #e7eaed; color: #59666f; }

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.inline-actions input { width: 190px; min-height: 40px; }
.compact-form { margin-bottom: 18px; }

.flash {
    border-radius: 8px;
    padding: 13px 16px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    background: white;
}

.flash-success { border-color: #add8c1; background: #edf8f2; }
.flash-danger { border-color: #e4b7b7; background: #fff1f1; }
.flash-warning { border-color: #e1c486; background: #fff8e8; }
.empty { text-align: center; color: var(--muted); padding: 34px; }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    border: 1px solid var(--line);
    background: var(--line);
    gap: 1px;
    overflow-x: auto;
    border-radius: 8px;
}

.calendar-head, .calendar-cell {
    background: #fff;
    min-width: 120px;
}

.calendar-head {
    padding: 10px;
    font-weight: 800;
    color: var(--muted);
    text-align: center;
}

.calendar-cell {
    min-height: 126px;
    padding: 9px;
}

.calendar-cell.outside { background: #faf7f6; color: #9b908d; }
.day-number { font-weight: 800; margin-bottom: 8px; }
.event {
    padding: 6px 8px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    line-height: 1.3;
    background: #edf6f4;
    border-left: 3px solid var(--primary);
}
.event.pending { background: #fff7e8; border-left-color: var(--warn); }
.event.approved { background: #e8f5ef; border-left-color: var(--ok); }

@media (max-width: 760px) {
    .topbar { align-items: flex-start; flex-direction: column; padding: 14px 18px; }
    nav { justify-content: flex-start; }
    .auth-shell, .grid.two, .grid.five { grid-template-columns: 1fr; }
    .split-head { align-items: flex-start; flex-direction: column; }
    h1 { font-size: 25px; }
}
