/* Sunshine Landscaping — Styles */

:root {
    --primary: #2d6a4f;
    --primary-dark: #1b3a2a;
    --accent: #e0b062;
    --accent-soft: rgba(224, 176, 98, 0.12);
    --bg: #f8f6f3;
    --card: #ffffff;
    --text: #2c2c2c;
    --text-muted: #6b6b6b;
    --border: #e0ddd6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --danger: #c1121f;
    --success: #2d6a4f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

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

a:hover {
    text-decoration: underline;
}

/* Header */
header {
    background: var(--primary-dark);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.brand:hover {
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* Buttons */
.button {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.2s;
}

.button:hover {
    text-decoration: none;
}

.button-primary {
    background: var(--primary);
    color: white;
}

.button-primary:hover {
    background: var(--primary-dark);
}

.button-accent {
    background: var(--accent);
    color: var(--primary-dark);
}

.button-accent:hover {
    background: #d4a858;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary-dark), #0f281a);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
}

.hero .tagline {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

/* Sections */
.section {
    padding: 3rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

section h2 {
    font-size: 1.75rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

/* About */
.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

.about-text p {
    margin-bottom: 1rem;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat {
    background: var(--card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.service-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Contact */
.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contact-item {
    background: var(--card);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.contact-item strong {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contact-form {
    max-width: 600px;
}

.contact-form .form-group {
    margin-bottom: 1rem;
}

.contact-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: 2px solid var(--accent);
    border-color: var(--primary);
}

/* Why section */
.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.why-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.why-item h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 2px solid var(--accent);
    border-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Errors */
.errors {
    background: #fef2f2;
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.error {
    color: var(--danger);
    margin: 0.4rem 0;
    font-size: 0.95rem;
}

/* Admin section */
.admin {
    min-height: calc(100vh - 60px);
    padding: 2rem 0;
}

.admin-nav {
    background: var(--primary-dark);
    color: white;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.admin-nav-links {
    display: flex;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-wrap: wrap;
}

/* Grouped menu: each group is a details element, so it works with no script. */
.admin-nav-links details {
    position: relative;
}

.admin-nav-links summary {
    list-style: none;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    user-select: none;
}

.admin-nav-links summary::-webkit-details-marker {
    display: none;
}

.admin-nav-links summary::after {
    content: " ▾";
    font-size: 0.72em;
    opacity: 0.7;
}

.admin-nav-links summary:hover,
.admin-nav-links details[open] summary {
    background: rgba(255, 255, 255, 0.12);
}

.admin-nav-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 15rem;
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    z-index: 50;
}

/* The last group sits near the right edge: open its menu inwards so it never
   pushes a horizontal scrollbar. */
.admin-nav-links details:last-of-type .admin-nav-menu {
    left: auto;
    right: 0;
}

.admin-nav-links .admin-nav-menu a,
.admin-nav-links .admin-nav-menu a:visited {
    color: #1f2937;
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    font-size: 0.92rem;
}

.admin-nav-links .admin-nav-menu a:hover {
    background: #f1f5f9;
    text-decoration: none;
    color: #111827;
}

.admin-nav-links a {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
}

.admin-nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.admin-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.admin-section h2 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.admin-form {
    max-width: 600px;
}

.admin-form .form-group {
    margin-bottom: 1rem;
}

.admin-form select {
    width: 100%;
}

.orders-table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.admin-table th,
.admin-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    background: var(--primary-dark);
    color: white;
    font-weight: 600;
}

.admin-table tr:hover {
    background: #f5f5f5;
}

/* Confirmation */
.confirmation-box {
    background: #f0fdf4;
    border: 1px solid var(--success);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 600px;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-paid {
    background: #dcfce7;
    color: var(--success);
}

.badge-unpaid {
    background: #fef3c7;
    color: #92400e;
}

/* Flash messages */
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.flash.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--success);
}

.flash.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
}

/* Login page */
.admin-auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), #0f281a);
    padding: 1rem;
}

.admin-auth-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 400px;
}

.admin-auth-logo {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
}

.admin-auth-card h1 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.admin-login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-link {
    text-align: center;
    margin-top: 1rem;
}

/* Admin-specific overrides */
.admin-auth-card .form-group {
    margin-bottom: 1rem;
}

.admin-auth-card input {
    width: 100%;
}

/* Empty state */
.empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    background: var(--card);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

/* Active nav link and the owner login entry */
.nav-links a.active {
    background: rgba(255, 255, 255, 0.16);
    text-decoration: none;
}

.nav-links a.nav-login {
    border: 1px solid var(--accent);
    color: var(--accent);
    margin-left: 0.5rem;
}

.nav-links a.nav-login:hover {
    background: var(--accent);
    color: var(--primary-dark);
    text-decoration: none;
}

/* Footer */
footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.75);
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
    font-size: 0.9rem;
}

footer p {
    margin: 0;
    padding: 0 1rem;
}

.nav-links a,
.brand {
    white-space: nowrap;
}

/* Narrow screens: let the nav wrap instead of overflowing */
@media (max-width: 760px) {
    .nav-container {
        flex-wrap: wrap;
        gap: 0.35rem;
        padding: 0 0.75rem;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .nav-links a {
        padding: 0.35rem 0.5rem;
        font-size: 0.9rem;
    }

    .nav-links a.nav-login {
        margin-left: 0;
    }
}

/* Sign-out submit styled as a nav link */
.link-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font: inherit;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
}

.link-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

form.inline {
    display: inline;
    margin: 0;
}

/* ---------- Accounting pages ---------- */

main.admin {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1rem 0 2rem;
}

.card {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: var(--radius, 8px);
    padding: 1rem;
}

.card-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
}

.card-value {
    font-size: 1.9rem;
    font-weight: 600;
    margin: 0.25rem 0;
}

.card a {
    font-size: 0.85rem;
}

.panel {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: var(--radius, 8px);
    padding: 1rem 1.25rem;
    margin-bottom: 1.75rem;
}

.panel h2 {
    margin-top: 0;
    font-size: 1.05rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem 1rem;
}

.grid .wide {
    grid-column: span 2;
}

.filters {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

table.data {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin: 0.5rem 0 1.5rem;
    font-size: 0.92rem;
}

table.data th,
table.data td {
    border-bottom: 1px solid #ececec;
    padding: 0.45rem 0.6rem;
    text-align: left;
    vertical-align: top;
}

table.data thead th {
    background: #f6f6f6;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #555;
}

table.data td.num,
table.data th.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* A reminder that is past its date: the row itself says so, not just a badge. */
table.data tr.overdue td {
    background: #fff4f4;
}

table.data tr.total th,
table.data tr.total td,
table.data tfoot th,
table.data tfoot td {
    font-weight: 600;
    border-top: 2px solid #d0d0d0;
    background: #fafafa;
}

table.data input,
table.data select {
    width: 100%;
    box-sizing: border-box;
}

.muted {
    color: #6b6b6b;
}

.ok {
    color: #1c7c31;
    font-weight: 600;
}

.bad {
    color: #b3261e;
    font-weight: 600;
}

code {
    background: #f2f2f2;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
}

/* Inline button that reads as a link, used for row-level actions in tables. */
.link-button-inline {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: 0.85rem;
    color: #1a5fb4;
    cursor: pointer;
    text-decoration: underline;
}


/* ---------- Printable invoice ---------- */

.invoice-doc {
    background: #fff;
    padding: 2rem;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
}

.invoice-head {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    border-bottom: 2px solid #222;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.invoice-head h1 {
    margin: 0;
    font-size: 1.6rem;
}

.invoice-head-right {
    text-align: right;
    font-size: 0.9rem;
}

.invoice-head-right p {
    margin: 0.15rem 0;
}

.invoice-billto {
    margin-bottom: 1.5rem;
}

@media print {
    .admin-nav,
    footer,
    .flash,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
    }

    main.admin {
        max-width: none;
        padding: 0;
    }

    .invoice-doc {
        border: 0;
        padding: 0;
    }

    table.data {
        font-size: 11pt;
    }

    table.data thead th {
        background: #eee !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}



/* Getting Started — the five-screen first-run wizard.
   The progress list mirrors QuickBooks' EasyStep: finished screens are green,
   the current one is outlined, the rest are muted. */
.setup-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 1rem 0 1.5rem;
}

.setup-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.setup-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.8rem;
}

.setup-step-current {
    border-color: var(--primary);
    color: var(--text);
    box-shadow: var(--shadow);
}

.setup-step-current .setup-step-num {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.setup-step-done {
    color: var(--success);
    border-color: var(--success);
}

.setup-step-done .setup-step-num {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.req {
    color: var(--danger);
}

.setup-step-title { white-space: nowrap; }
