:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --text: #1a2332;
    --muted: #64748b;
    --border: #e2e8f0;
    --primary: #2d6a4f;
    --primary-hover: #1b4332;
    --accent: #d4a373;
    --danger: #b42318;
    --radius: 12px;
    --shadow: 0 12px 40px rgba(26, 35, 50, 0.08);
    --font: "DM Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Landing */
.landing-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 45%, #40916c 100%);
}
.landing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem;
}
.landing-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    width: 100%;
    align-items: center;
}
.landing-copy { color: #fff; }
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    opacity: 0.85;
    margin: 0 0 1rem;
}
.landing-copy h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    margin: 0 0 1rem;
    font-weight: 700;
}
.lead { font-size: 1.125rem; opacity: 0.92; max-width: 34rem; }
.feature-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
    display: grid;
    gap: 0.75rem;
}
.feature-list li {
    padding-left: 1.5rem;
    position: relative;
}
.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

.login-card {
    background: var(--surface);
    border-radius: calc(var(--radius) + 4px);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.login-card h2 { margin: 0 0 0.25rem; font-size: 1.5rem; }
.login-sub { color: var(--muted); margin: 0 0 1.5rem; }
.landing-centered { justify-content: center; }
.login-card-standalone { max-width: 420px; width: 100%; }
.brand-mini { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }

/* Admin layout */
.admin-body { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px;
    background: #152238;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    flex-shrink: 0;
    min-height: 100vh;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.5rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 1rem;
    flex-shrink: 0;
}
.sidebar-brand strong { display: block; font-size: 1rem; }
.sidebar-brand small { opacity: 0.65; font-size: 0.75rem; }
.brand-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #40916c);
    display: grid; place-items: center;
    font-weight: 700;
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-shrink: 0;
}
.sidebar-nav a {
    color: rgba(255,255,255,0.78);
    padding: 0.75rem 0.875rem;
    border-radius: 8px;
    text-decoration: none;
    line-height: 1.25;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.logout-link { color: rgba(255,255,255,0.6); font-size: 0.875rem; text-decoration: none; }
.logout-link:hover { color: #fff; }

.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 2rem;
}
.admin-header h1 { margin: 0; font-size: 1.5rem; }
.admin-content { padding: 1.5rem 2rem 2rem; flex: 1; }

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 8px;
    padding: 0.625rem 1rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; }
.btn-secondary { background: #e8f5e9; color: var(--primary); }
.btn-secondary:hover { background: #d8efe0; text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-danger { background: #fee4e2; color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.875rem; }

.form-stack, .form-grid { display: grid; gap: 1rem; }
.form-grid label, .form-stack label { display: grid; gap: 0.35rem; }
.form-grid label span, .form-stack label span { font-size: 0.875rem; font-weight: 600; }
input, select, textarea {
    font: inherit;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid rgba(45, 106, 79, 0.25);
    border-color: var(--primary);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.checkbox-label { display: flex !important; align-items: center; gap: 0.5rem; font-weight: 400 !important; }
.form-inline-upload { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.alert { padding: 0.875rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-error { background: #fef3f2; color: #912018; border: 1px solid #fecdca; }
.alert-success { background: #ecfdf3; color: #027a48; border: 1px solid #abefc6; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.card-highlight { border-color: #b7e4c7; background: #f8fff9; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-header h2 { margin: 0; font-size: 1.125rem; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.stat-label { display: block; color: var(--muted); font-size: 0.875rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; }
.stat-value-money { font-size: 1.35rem; line-height: 1.3; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 0.875rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: #fafbfc; }
.data-table tr:last-child td { border-bottom: none; }
.text-right { text-align: right !important; }
.text-muted { color: var(--muted); }
.actions { white-space: nowrap; }
.actions a, .inline-form { display: inline; }
.inline-form { margin-left: 0.75rem; }
.inline-action-form { display: inline; margin: 0; padding: 0; }
.link-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
}
.link-button:hover { color: var(--primary-hover); }
.link-danger { background: none; border: none; color: var(--danger); cursor: pointer; font: inherit; padding: 0; }
.empty-state { text-align: center; padding: 3rem 1rem; background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--border); }
.quick-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
.p-4 { padding: 1rem; }

/* Install */
.install-body { min-height: 100vh; background: #eef2f6; padding: 2rem 1rem; }
.install-wrap { max-width: 720px; margin: 0 auto; }
.install-steps {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    flex-wrap: wrap;
}
.install-steps li {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #dde3ea;
    font-size: 0.8125rem;
    color: var(--muted);
}
.install-steps li.active { background: var(--primary); color: #fff; }
.install-steps li.done { background: #d1fae5; color: #065f46; }
.install-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}
.check-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.check-list li { padding: 0.75rem 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; }
.check-list li.ok strong { color: #027a48; }
.check-list li.fail strong { color: var(--danger); }

@media (max-width: 900px) {
    .landing-grid { grid-template-columns: 1fr; }
    .admin-body { flex-direction: column; }
    .sidebar { width: 100%; }
}
