
:root {
    --primary: #234b2b;
    --primary-2: #2f6d3b;
    --accent: #97bc62;
    --accent-2: #c7e28c;
    --bg: #f4f7f1;
    --surface: #ffffff;
    --text: #1d2a20;
    --muted: #6d7a71;
    --border: #dfe8da;
    --danger: #c84d4d;
    --shadow: 0 16px 40px rgba(24, 44, 25, 0.10);
    --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: linear-gradient(180deg, #eef5e9 0%, #f8fbf6 100%);
    color: var(--text);
}

a { color: inherit; }

.sidebar {
    width: 260px;
    min-height: 100vh;
    position: fixed;
    inset: 0 auto 0 0;
    background: linear-gradient(180deg, #16351d 0%, #234b2b 46%, #2f6d3b 100%);
    color: #fff;
    padding: 24px 18px;
    box-shadow: 10px 0 30px rgba(0,0,0,0.08);
}

.brand-box {
    text-align: center;
    padding: 14px 14px 18px;
    border-radius: 20px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.09);
    margin-bottom: 22px;
}

.brand-box img {
    width: 120px;
    max-width: 100%;
    display: block;
    margin: 0 auto 10px;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.18));
}

.brand-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.4px;
    margin: 0;
}

.brand-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.78);
    margin: 6px 0 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin: 8px 0;
    border-radius: 14px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.14);
    transform: translateX(3px);
}

.content {
    margin-left: 260px;
    min-height: 100vh;
    padding: 30px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.page-title {
    margin: 0;
    font-size: 30px;
    color: var(--primary);
}

.page-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.page-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: #edf6e5;
    color: var(--primary);
    font-weight: 700;
    border: 1px solid #d9e8cd;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(151,188,98,0.12);
}

.card + .card { margin-top: 18px; }

.hero-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 24px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f7fbf3 50%, #eff8e3 100%);
}

.hero-text h2,
.hero-text h3 { margin: 0 0 8px; color: var(--primary); }
.hero-text p { margin: 0; color: var(--muted); max-width: 720px; line-height: 1.6; }
.hero-logo img { width: 130px; max-width: 100%; }

.dashboard-grid,
.grid-2,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.dashboard-card {
    overflow: hidden;
}
.dashboard-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.dashboard-card .card-body {
    padding: 18px;
}
.dashboard-card h4 {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 22px;
}
.dashboard-card p {
    margin: 0 0 14px;
    color: var(--muted);
}

.stat-box {
    padding: 18px;
}
.stat-label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }

.table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}
.table th,
.table td {
    padding: 13px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table th {
    background: #f2f8eb;
    color: var(--primary);
    font-size: 14px;
}
.table tr:hover td { background: #fbfdf9; }

label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    color: var(--primary);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cfddc8;
    border-radius: 12px;
    background: #fff;
    outline: none;
    transition: 0.2s ease;
    font-size: 14px;
}
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(151,188,98,0.18);
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    transition: 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-main { background: linear-gradient(135deg, #88b94b, #2f6d3b); }
.btn-success { background: linear-gradient(135deg, #2f6d3b, #16351d); }
.btn-danger { background: linear-gradient(135deg, #d86a6a, #b43f3f); }
.btn-sm { padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.w-100 { width: 100%; }

.p-3 { padding: 22px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.mt-3 { margin-top: 18px; }
.text-center { text-align: center; }
.totals-box {
    margin-top: 18px;
    padding: 18px;
    border-radius: 16px;
    background: linear-gradient(180deg, #f6fbf0, #ffffff);
    border: 1px solid #e1ecd8;
}
.totals-box h5,
.totals-box h4 {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}
.totals-box h4 { color: var(--primary); }

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: radial-gradient(circle at top, rgba(151,188,98,0.22), transparent 32%), linear-gradient(180deg, #eef5e9, #f8fbf6);
}
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 28px;
}
.login-logo {
    width: 130px;
    display: block;
    margin: 0 auto 10px;
}
.login-title { text-align: center; margin: 0; color: var(--primary); font-size: 28px; }
.login-subtitle { text-align: center; color: var(--muted); margin: 8px 0 22px; }

.small-note { color: var(--muted); font-size: 13px; }
.section-title { margin: 0 0 16px; color: var(--primary); font-size: 22px; }

@media (max-width: 920px) {
    .sidebar {
        width: 100%;
        min-height: auto;
        position: static;
        border-radius: 0 0 20px 20px;
    }
    .content {
        margin-left: 0;
        padding: 18px;
    }
    .hero-card { flex-direction: column; align-items: flex-start; }
}


.btn-light {
    background: #eef4ea;
    color: var(--primary);
    border: 1px solid #d5e2cc;
}

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.custom-toast {
    min-width: 320px;
    max-width: 380px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    color: #fff;
    box-shadow: 0 18px 35px rgba(0,0,0,0.18);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s ease;
}

.custom-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    background: linear-gradient(135deg, #2f6d3b, #16351d);
}

.toast-error {
    background: linear-gradient(135deg, #d86a6a, #b43f3f);
}

.toast-warning {
    background: linear-gradient(135deg, #c6952d, #8b6115);
}

.toast-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.16);
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.toast-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255,255,255,0.92);
}

.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 20, 10, 0.48);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.confirm-modal-overlay.active {
    display: flex;
}

.confirm-modal-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 24px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 24px 50px rgba(0,0,0,0.16);
    border: 1px solid #e2ecdb;
}

.confirm-modal-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #f2f8eb, #deedd2);
    color: var(--primary);
    font-size: 32px;
    font-weight: 800;
}

.confirm-modal-box h3 {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 24px;
}

.confirm-modal-box p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.confirm-modal-actions {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 920px) {
    .toast-container {
        top: 16px;
        right: 16px;
        left: 16px;
    }

    .custom-toast {
        min-width: 0;
        max-width: none;
        width: 100%;
    }
}


.result-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 20, 10, 0.48);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.result-modal-overlay.active {
    display: flex;
}

.result-modal-box {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 24px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 24px 50px rgba(0,0,0,0.16);
    border: 1px solid #e2ecdb;
}

.result-modal-icon {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #2f6d3b, #16351d);
    color: #fff;
    font-size: 34px;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(35, 75, 43, 0.22);
}

.result-modal-box h3 {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 24px;
}

.result-modal-box p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.invoice-highlight {
    margin: 18px auto 0;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #edf6e5, #f8fbf6);
    border: 1px solid #dce9d2;
    color: var(--primary);
    font-weight: 800;
    letter-spacing: 0.4px;
    font-size: 16px;
}

.result-modal-actions {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.action-cell {
    white-space: nowrap;
}

.action-cell .btn {
    margin-right: 6px;
    margin-bottom: 6px;
}

.custom-item-card {
    background: linear-gradient(135deg, #ffffff 0%, #f7fbf3 100%);
}

.report-filter-form {
    align-items: end;
}
