:root {
    --ink: #17211d;
    --muted: #66736d;
    --line: #dfe6e2;
    --surface: #ffffff;
    --canvas: #f4f6f4;
    --cream: #f5efdf;
    --bean: #296a4a;
    --bean-dark: #174e34;
    --bean-soft: #e2f0e8;
    --lime: #b7dd72;
    --danger: #ad3434;
    --warning: #a86216;
    --shadow: 0 15px 45px rgba(23, 33, 29, .08);
    --radius: 18px;
    --font: "Graphik Web", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--canvas);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .button { -webkit-tap-highlight-color: transparent; }

.app-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 25px 18px 18px;
    color: #f7faf8;
    background: var(--bean-dark);
    z-index: 20;
}
.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 10px 24px;
    color: #fff;
    font-size: 21px;
    font-weight: 750;
    text-decoration: none;
    letter-spacing: -.4px;
}
.brand-mark { position: relative; width: 25px; height: 26px; display: inline-block; }
.brand-mark span { position: absolute; display: block; width: 14px; height: 20px; border-radius: 55% 45% 50% 50%; background: var(--lime); transform: rotate(35deg); }
.brand-mark span:last-child { right: 0; bottom: 0; background: #f3c969; transform: rotate(-30deg); }
.main-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 43px;
    padding: 10px 13px;
    border-radius: 11px;
    color: rgba(255,255,255,.72);
    font-weight: 580;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.075); }
.nav-item.active { color: #153c2a; background: var(--lime); }
.nav-label { padding: 25px 13px 8px; color: rgba(255,255,255,.4); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: 1.2px; }
.nav-soon { padding: 2px 6px; border-radius: 20px; color: rgba(255,255,255,.58); background: rgba(255,255,255,.08); font-size: 10px; }
.nav-item.active .nav-soon { color: #315d45; background: rgba(255,255,255,.45); }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 13px 9px 2px; border-top: 1px solid rgba(255,255,255,.12); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; color: var(--bean-dark); background: var(--cream); font-weight: 750; }
.sidebar-user-copy { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.sidebar-user-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.sidebar-user-copy small { color: rgba(255,255,255,.5); font-size: 11px; }
.signout { color: rgba(255,255,255,.55); text-decoration: none; font-size: 20px; }
.app-main { min-width: 0; }
.page { width: min(1440px, 100%); margin: 0 auto; padding: 44px clamp(28px, 4vw, 66px) 70px; }
.mobile-header { display: none; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 30px; }
.page-heading h1 { margin: 2px 0 5px; font-size: clamp(30px, 3.2vw, 44px); line-height: 1.06; letter-spacing: -1.5px; }
.page-heading p { max-width: 720px; margin: 0; color: var(--muted); font-size: 16px; }
.eyebrow { color: var(--bean); font-size: 12px; font-weight: 800; letter-spacing: 1.25px; text-transform: uppercase; }
.page-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #fff;
    background: var(--bean);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.button:hover { background: var(--bean-dark); box-shadow: 0 7px 20px rgba(23,78,52,.16); transform: translateY(-1px); }
.button.secondary { color: var(--ink); background: #fff; border-color: var(--line); box-shadow: none; }
.button.secondary:hover { background: #f9fbfa; }
.button.danger { background: var(--danger); }
.button.small { min-height: 34px; padding: 7px 12px; border-radius: 9px; font-size: 13px; }
.text-link { color: var(--bean); font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.grid { display: grid; gap: 20px; }
.grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card, .card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 1px 0 rgba(23,33,29,.015);
}
.stat-card { padding: 22px; }
.stat-card .label { color: var(--muted); font-size: 13px; font-weight: 650; }
.stat-card strong { display: block; margin-top: 8px; font-size: 31px; line-height: 1; letter-spacing: -1px; }
.stat-card small { display: block; margin-top: 9px; color: var(--muted); }
.card { padding: 25px; }
.card + .card { margin-top: 20px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.card-heading h2, .card-heading h3 { margin: 0; font-size: 20px; letter-spacing: -.45px; }
.card-heading p { margin: 4px 0 0; color: var(--muted); }
.section-title { margin: 34px 0 14px; font-size: 19px; letter-spacing: -.3px; }

.table-card { overflow: hidden; padding: 0; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 17px; border-bottom: 1px solid var(--line); color: var(--muted); background: #f9fbfa; font-size: 11px; font-weight: 780; letter-spacing: .75px; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 16px 17px; border-bottom: 1px solid #edf1ef; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfdfc; }
.cell-main { display: block; color: var(--ink); font-weight: 700; text-decoration: none; }
.cell-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.actions-cell { text-align: right; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 99px; color: #315a43; background: var(--bean-soft); font-size: 11px; font-weight: 750; text-transform: capitalize; }
.badge.grey { color: #66716c; background: #edf0ee; }
.badge.amber { color: #855011; background: #f9e9cf; }
.badge.red { color: #923434; background: #f9dddd; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #44a56c; }

.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.toolbar-group { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.search-box { min-width: 280px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.form-field { min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label, .form-label { display: block; margin-bottom: 7px; color: #35443d; font-size: 13px; font-weight: 670; }
.form-field input:not([type=checkbox]):not([type=radio]), .form-field select, .form-field textarea, .input {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #cdd6d1;
    border-radius: 10px;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.form-field textarea { min-height: 125px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, .input:focus { border-color: #70a98a; box-shadow: 0 0 0 4px rgba(41,106,74,.1); }
.form-field small, .field-help { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; }
.check-row input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--bean); }
.check-row label { margin: 0; }
.day-checks { display: flex; gap: 7px; flex-wrap: wrap; }
.day-checks label { position: relative; }
.day-checks input { position: absolute; opacity: 0; }
.day-checks span { display: grid; place-items: center; min-width: 42px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; cursor: pointer; font-size: 12px; font-weight: 700; }
.day-checks input:checked + span { color: var(--bean-dark); border-color: #95bd9f; background: var(--bean-soft); }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-error { margin: 0 0 20px; padding: 13px 15px; border: 1px solid #efcaca; border-radius: 10px; color: #8a2929; background: #fff0f0; }
.field-section { padding-top: 5px; }
.field-section + .field-section { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.field-section-header { margin-bottom: 19px; }
.field-section-header h2 { margin: 0; font-size: 21px; }
.field-section-header p { margin: 3px 0 0; color: var(--muted); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 70px !important; }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 6px 8px; border: 0; color: var(--bean); background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }

.alert { margin: 0 0 20px; padding: 13px 15px; border: 1px solid; border-radius: 11px; font-weight: 620; }
.alert-success { color: #1f623e; border-color: #b9ddc8; background: #ecf8f1; }
.alert-error { color: #862d2d; border-color: #efcaca; background: #fff0f0; }
.alert-warning { color: #805016; border-color: #edd1a5; background: #fff7e8; }
.empty-state { padding: 55px 25px; text-align: center; }
.empty-state .empty-beans { position: relative; width: 55px; height: 40px; margin: 0 auto 15px; }
.empty-state .empty-beans:before, .empty-state .empty-beans:after { content: ""; position: absolute; width: 24px; height: 35px; border-radius: 55% 45% 52% 48%; background: var(--bean-soft); transform: rotate(35deg); }
.empty-state .empty-beans:after { right: 4px; bottom: 0; background: var(--cream); transform: rotate(-28deg); }
.empty-state h3 { margin: 0 0 5px; font-size: 19px; }
.empty-state p { max-width: 520px; margin: 0 auto 18px; color: var(--muted); }

.auth-body { display: grid; min-height: 100vh; place-items: center; padding: 25px; background: radial-gradient(circle at 20% 10%, #e6f2e9 0, transparent 34%), var(--cream); }
.auth-card { width: min(470px, 100%); padding: 38px; border: 1px solid rgba(23,78,52,.13); border-radius: 24px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 30px; color: var(--bean-dark); font-size: 22px; font-weight: 780; }
.auth-card h1 { margin: 0 0 6px; font-size: 31px; letter-spacing: -1px; }
.auth-card > p { margin: 0 0 24px; color: var(--muted); }
.auth-card .form-field { margin-bottom: 17px; }
.auth-card .button { width: 100%; margin-top: 5px; }
.auth-note { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.progress-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.progress-row:last-child { border-bottom: 0; }
.progress-row strong { display: block; }
.progress-row small { color: var(--muted); }
.callout { display: flex; gap: 13px; padding: 17px; border-radius: 13px; color: #254b36; background: var(--bean-soft); }
.callout strong { display: block; margin-bottom: 2px; }
.callout p { margin: 0; color: #527260; }
.truncate { max-width: 350px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1050px) {
    .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; left: 0; top: 0; width: 270px; transform: translateX(-102%); transition: transform .18s ease; box-shadow: 15px 0 45px rgba(0,0,0,.18); }
    .sidebar.open { transform: translateX(0); }
    .mobile-header { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(244,246,244,.92); backdrop-filter: blur(12px); }
    .menu-button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 700; }
    .mobile-brand { color: var(--bean-dark); font-weight: 780; }
    .page { padding: 28px 18px 55px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .form-grid, .grid.two { grid-template-columns: 1fr; }
    .form-field.full { grid-column: auto; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .search-box { min-width: 0; width: 100%; }
}
@media (max-width: 520px) {
    .grid.stats { grid-template-columns: 1fr; }
    .auth-card { padding: 29px 22px; }
    .page-actions, .form-actions { width: 100%; }
    .page-actions .button, .form-actions .button { flex: 1; }
}

