:root {
    --green: #0d5c46;
    --green-dark: #083f31;
    --green-light: #eaf5f1;
    --gold: #c9a45c;
    --ink: #1e2c28;
    --muted: #687672;
    --line: #dfe7e4;
    --paper: #ffffff;
    --bg: #f6f9f8;
    --danger: #a72b2b;
    --success: #1b6b48;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
}

a { color: var(--green); text-decoration: none; }

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.nav-wrap {
    min-height: 74px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

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

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--green);
    color: white;
    font-weight: 800;
    letter-spacing: -1px;
}

.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); }

nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

nav a { color: var(--ink); font-weight: 700; }

.nav-button {
    background: var(--green);
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
}

.page-shell { padding: 42px 0 70px; }

.hero-card {
    min-height: 420px;
    padding: clamp(34px, 7vw, 82px);
    display: flex;
    align-items: center;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(13,92,70,.96), rgba(8,63,49,.90)),
        #0d5c46;
    color: white;
    box-shadow: 0 18px 50px rgba(0,0,0,.08);
}

.hero-card > div { max-width: 650px; }

.hero-card h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.05;
    margin: 10px 0 18px;
}

.hero-card p { font-size: 1.1rem; max-width: 600px; }

.eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .78rem;
    font-weight: 800;
    color: var(--gold);
}

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.btn {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9px;
    padding: 11px 18px;
    font-weight: 800;
    cursor: pointer;
    font-size: .95rem;
}

.btn-primary { background: var(--green); color: white; }
.hero-card .btn-primary { background: var(--gold); color: #1f261f; }
.btn-secondary { background: white; color: var(--green); border: 1px solid var(--line); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.auth-card,
.form-panel,
.table-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: clamp(22px, 4vw, 38px);
    box-shadow: 0 12px 34px rgba(23,57,47,.05);
}

.auth-card { max-width: 650px; margin: 0 auto; }
.payment-card { max-width: 850px; }

.section-heading h1,
.dashboard-header h1 {
    margin: 5px 0 8px;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
}

.section-heading p,
.dashboard-header p { color: var(--muted); }

.form-grid {
    display: grid;
    gap: 18px;
    margin-top: 26px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

input, select, textarea {
    width: 100%;
    border: 1px solid #cdd9d5;
    border-radius: 9px;
    padding: 12px 13px;
    font: inherit;
    background: white;
    color: var(--ink);
}

input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(13,92,70,.12);
    border-color: var(--green);
}

.full-width { width: 100%; }

.form-footer { margin: 22px 0 0; text-align: center; color: var(--muted); }

.alert {
    padding: 13px 15px;
    border-radius: 9px;
    margin: 18px 0;
}

.alert-error { background: #fff0f0; color: var(--danger); border: 1px solid #f2c7c7; }
.alert-success { background: #edf8f1; color: var(--success); border: 1px solid #cbe7d5; }

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

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.dash-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 25px;
    color: var(--ink);
    transition: transform .15s ease, box-shadow .15s ease;
}

.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(23,57,47,.08);
}

.accent-card {
    border-top: 4px solid var(--gold);
}

.dash-icon { font-size: 1.8rem; }
.dash-card h2 { font-size: 1.15rem; margin: 13px 0 7px; }
.dash-card p { color: var(--muted); margin: 0; font-size: .94rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
}

.stat-card span { display: block; color: var(--muted); font-size: .9rem; }
.stat-card strong { display: block; font-size: 1.7rem; margin-top: 5px; }

.table-card { overflow: hidden; }
.table-card h2 { margin-top: 0; }
.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }

.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
}
.status-unpaid { background: #fff3d9; color: #7c5a0a; }
.status-paid { background: #e7f5ed; color: #17613f; }
.status-cancelled { background: #f0f0f0; color: #666; }

.empty-state {
    text-align: center;
    padding: 30px 18px;
    border: 1px dashed #cad8d3;
    border-radius: 12px;
    color: var(--muted);
    background: #fbfdfc;
}

.invoice-options { display: grid; gap: 12px; margin-top: 22px; }

.invoice-pay-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 18px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.invoice-pay-row span { display: block; color: var(--muted); margin-top: 4px; }
.invoice-pay-row .amount { font-size: 1.05rem; font-weight: 800; }

.notice {
    padding: 13px 15px;
    border-radius: 10px;
    margin: 18px 0;
    background: var(--green-light);
    color: var(--green-dark);
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(280px, .85fr) minmax(420px, 1.4fr);
    gap: 20px;
}

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: white;
    text-align: center;
    padding: 20px 0;
}

.admin-header { border-top: 4px solid var(--gold); }

@media (max-width: 900px) {
    .dashboard-grid,
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split-layout { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
    .nav-wrap { align-items: flex-start; flex-direction: column; padding: 14px 0; }
    nav { gap: 12px; }
    .page-shell { padding-top: 26px; }
    .dashboard-grid,
    .stats-grid { grid-template-columns: 1fr; }
    .invoice-pay-row { grid-template-columns: 1fr; }
}

/* Prepared quotations */
.quote-item { display: flex; gap: 10px; margin: 8px 0; align-items: center; }
.quote-item input:first-child { flex: 2; }
.quote-item input:nth-child(2) { flex: 1; }
.quote-item .btn { white-space: nowrap; }
.quote-toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.quote-paper { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 42px; margin-bottom: 22px; line-height: 1.6; }
.quote-heading, .quote-addresses, .quote-signatures { display: flex; justify-content: space-between; gap: 30px; }
.quote-heading { border-bottom: 2px solid var(--green); margin-bottom: 22px; }
.quote-heading > div:last-child { text-align: right; }
.quote-addresses > div { flex: 1; }
.quote-paper h2 { margin-top: 22px; }
.quote-paper h3 { margin-top: 26px; }
.quote-signatures { margin-top: 50px; }
.quote-status-form { margin-bottom: 30px; }
@media (max-width: 650px) { .quote-item, .quote-heading, .quote-addresses, .quote-signatures { flex-direction: column; align-items: stretch; } .quote-paper { padding: 20px; } .quote-heading > div:last-child { text-align: left; } }
@media print { .site-header, .site-footer, .quote-toolbar, .quote-status-form { display: none !important; } body { background: white; } .page-shell { max-width: none; padding: 0; } .quote-paper { border: 0; padding: 0; margin: 0; } .table-scroll { overflow: visible; } table { min-width: 0; } }
