* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #F5F5F2;
    color: #24241F;
}
a { color: inherit; text-decoration: none; }

.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: 220px;
    background: #1E2A2A;
    color: #D6D9D3;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.sidebar-brand { padding: 22px 20px; font-size: 18px; font-weight: 600; color: #fff; }
.sidebar-brand span { color: #5DCAA5; }
.sidebar nav { display: flex; flex-direction: column; padding: 10px 0; flex: 1; }
.sidebar nav a {
    padding: 12px 20px;
    font-size: 14px;
    color: #B7BCB4;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar nav a.active { background: rgba(93,202,165,0.12); color: #5DCAA5; border-left-color: #5DCAA5; }

.nav-group { display: flex; flex-direction: column; }
.nav-row { display: flex; align-items: center; }
.nav-row a { flex: 1; }
.nav-header-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px 4px; font-size: 11px; text-transform: uppercase;
    letter-spacing: .05em; color: #6B726B; cursor: pointer; user-select: none;
}
.nav-header-row .nav-toggle { padding: 0 20px 0 8px; }
.nav-icon { display: inline-block; width: 22px; text-align: center; margin-right: 6px; font-size: 14px; }
.nav-toggle {
    background: none; border: none; cursor: pointer; color: #6B726B;
    font-size: 15px; font-weight: 600; padding: 12px 20px 12px 8px; line-height: 1;
    flex: 0 0 auto; min-width: 32px;
}
.nav-toggle:hover { color: #B7BCB4; }
.nav-submenu {
    max-height: 0; overflow: hidden; display: flex; flex-direction: column;
    transition: max-height 0.25s ease;
}
.nav-submenu.open { max-height: 400px; }
.nav-submenu a { padding: 10px 20px 10px 36px; font-size: 13px; }
.sidebar-footer { padding: 16px 20px; font-size: 12px; color: #6B726B; border-top: 1px solid rgba(255,255,255,0.08); }

/* Main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 28px; background: #fff; border-bottom: 1px solid #E4E3DD;
}
.topbar h1 { font-size: 20px; font-weight: 600; }
.topbar-user { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #55564F; }
.btn-link { color: #0F6E56; font-weight: 500; }
.badge { padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; background: #E1F5EE; color: #085041; }
.badge.role-admin { background: #FAEEDA; color: #633806; }
.badge.role-finance { background: #E6F1FB; color: #0C447C; }
.badge.role-gm { background: #FBEAF0; color: #72243E; }

.content { padding: 28px; flex: 1; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #EAF3DE; color: #27500A; }
.alert-error { background: #FCEBEB; color: #791F1F; }

/* Cards / stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border: 1px solid #E4E3DD; border-radius: 12px; padding: 18px 20px; }
.stat-card .num { font-size: 26px; font-weight: 600; }
.stat-card .label { font-size: 13px; color: #767669; margin-top: 4px; }

.card { background: #fff; border: 1px solid #E4E3DD; border-radius: 12px; padding: 22px; margin-bottom: 20px; }
.card h2 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #ECEBE5; }
th { color: #767669; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #FAFAF7; }
.table-actions a { color: #0F6E56; font-size: 13px; margin-right: 10px; }
.table-actions a.danger { color: #A32D2D; }
.table-actions .btn-chip {
    display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 12px;
    font-weight: 500; margin-right: 6px; text-decoration: none; border: 1px solid transparent;
}
.table-actions .btn-chip.view { background: #EAF2FB; color: #1E4D8C; }
.table-actions .btn-chip.view:hover { background: #D9E9FA; }
.table-actions .btn-chip.edit { background: #F3F9F1; color: #0F6E56; }
.table-actions .btn-chip.edit:hover { background: #E3F2DE; }
.table-actions .btn-chip.delete { background: #FCEFEA; color: #A32D2D; }
.table-actions .btn-chip.delete:hover { background: #FADFD6; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 4px; }
.form-group.full { grid-column: 1 / -1; }
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: #45463F; }
input, select, textarea {
    width: 100%; padding: 9px 12px; border: 1px solid #D4D3CB; border-radius: 8px;
    font-size: 14px; font-family: inherit; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #0F6E56; }

.btn {
    display: inline-block; padding: 10px 18px; border-radius: 8px; border: none;
    background: #0F6E56; color: #fff; font-size: 14px; font-weight: 500; cursor: pointer;
}
.btn:hover { background: #085041; }
.btn.secondary { background: #fff; color: #24241F; border: 1px solid #D4D3CB; }
.btn.secondary:hover { background: #F5F5F2; }

.form-actions { margin-top: 20px; display: flex; gap: 10px; }

/* Login page */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #1E2A2A; }
.login-card { background: #fff; padding: 40px; border-radius: 14px; width: 360px; }
.login-card .sidebar-brand { padding: 0 0 24px; color: #1E2A2A; }
.login-card .sidebar-brand span { color: #0F6E56; }
.hint { font-size: 12px; color: #939486; margin-top: 16px; text-align: center; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.pill-active { background: #EAF3DE; color: #27500A; }
.pill-pending { background: #FAEEDA; color: #633806; }
.pill-inactive { background: #F1EFE8; color: #444441; }

.masked { letter-spacing: 2px; color: #939486; }

@media (max-width: 720px) {
    .sidebar { display: none; }
    .form-grid { grid-template-columns: 1fr; }
}
