:root {
    --brand-primary: #0f3d2e;
    --brand-secondary: #d4af37;
    --brand-dark: #08251c;
    --brand-light: #f4f7f5;
    --brand-card: #ffffff;
    --brand-text: #111827;
    --brand-muted: #6b7280;
    --brand-border: #e5e7eb;
    --danger: #dc2626;
    --blue: #2563eb;
}

body {
    margin: 0;
    font-family: Arial, Tahoma, sans-serif;
    background: var(--brand-light);
    color: var(--brand-text);
}

.topbar {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand-primary));
    color: white;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    box-shadow: 0 6px 22px rgba(15,61,46,.22);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    font-weight: 800;
    line-height: 1.15;
}

.brand img {
    height: 48px;
    width: auto;
    background: white;
    padding: 6px;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(0,0,0,.18);
}

.brand small {
    color: #f5e6a8;
    font-weight: 600;
}

.nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    font-size: 14px;
    font-weight: 700;
}

.nav a:hover {
    background: var(--brand-secondary);
    color: var(--brand-dark);
}

.container {
    max-width: 1200px;
    margin: 22px auto;
    padding: 0 14px;
}

.card {
    background: var(--brand-card);
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 10px 28px rgba(15,61,46,.09);
    border: 1px solid var(--brand-border);
}

.card h2 {
    margin-top: 0;
    color: var(--brand-primary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.section-title {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #eaf6ef, #fff8dc);
    color: var(--brand-primary);
    font-weight: 900;
    padding: 12px 14px;
    border-radius: 14px;
    border-left: 5px solid var(--brand-secondary);
    margin-top: 8px;
}

.field label {
    display: block;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--brand-dark);
}

.field input,
.field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    padding: 12px;
    font-size: 15px;
    background: #fff;
}

.field input[readonly] {
    background: #eef3ef;
    color: var(--brand-primary);
    font-weight: 800;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.btn {
    border: 0;
    border-radius: 14px;
    padding: 11px 16px;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--brand-primary);
    color: white;
}

.btn-blue {
    background: var(--blue);
    color: white;
}

.btn-light {
    background: #fff8dc;
    color: var(--brand-dark);
    border: 1px solid #ead27a;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.alert {
    padding: 13px 15px;
    border-radius: 14px;
    margin-bottom: 14px;
    font-weight: 800;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.report-table,
.list-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 16px;
}

.report-table th,
.list-table th {
    background: var(--brand-primary);
    color: white;
    padding: 12px;
    text-align: right;
}

.report-table th:first-child,
.report-table td:first-child,
.list-table th:first-child,
.list-table td:first-child {
    text-align: left;
}

.report-table td,
.list-table td {
    padding: 12px;
    border-bottom: 1px solid var(--brand-border);
    text-align: right;
}

.balance-row {
    background: #fff8dc;
    color: var(--brand-dark);
    font-weight: 900;
}

.site-footer {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand-primary));
    color: white;
    margin-top: 34px;
    padding: 34px 15px 16px;
    border-top: 4px solid var(--brand-secondary);
}

.footer-wrap {
    max-width: 1250px;
    margin: auto;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1.2fr 1fr;
    gap: 18px;
}

.footer-card {
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 20px;
    padding: 20px;
}

.footer-logo-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-logo {
    width: 88px;
    height: 70px;
    object-fit: contain;
    background: white;
    border-radius: 16px;
    padding: 6px;
}

.footer-card h3,
.footer-brand h2 {
    color: white;
    margin-top: 0;
}

.footer-desc,
.footer-info p {
    color: #eef7f1;
    line-height: 1.7;
}

.footer-info strong {
    color: #f5e6a8;
    font-size: 12px;
    text-transform: uppercase;
}

.footer-info.arabic {
    direction: rtl;
    text-align: right;
}

.footer-badges span {
    display: inline-block;
    background: var(--brand-secondary);
    color: var(--brand-dark);
    padding: 7px 10px;
    border-radius: 999px;
    font-weight: 900;
    margin: 4px 4px 0 0;
}

.footer-contact a {
    display: flex;
    gap: 12px;
    align-items: center;
    color: white;
    text-decoration: none;
    background: rgba(255,255,255,.12);
    padding: 12px;
    border-radius: 16px;
    margin-bottom: 10px;
}

.footer-bottom {
    max-width: 1250px;
    margin: 20px auto 0;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.20);
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    color: #eaf6ef;
    font-size: 13px;
}

@media (max-width: 800px) {
    .topbar {
        display: block;
    }

    .nav {
        margin-top: 14px;
    }

    .nav a {
        flex: 1;
        text-align: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .footer-wrap {
        grid-template-columns: 1fr;
    }

    .report-table,
    .list-table {
        font-size: 13px;
    }
}

@media print {
    .topbar,
    .site-footer,
    .no-print,
    .actions {
        display: none !important;
    }

    body {
        background: white;
    }

    .card {
        box-shadow: none;
        border: none;
    }
}
.card-spaced {
    margin-top: 18px;
}

.field-full {
    grid-column: 1 / -1;
}

.inline-form {
    display: inline;
}

.help-text {
    color: var(--brand-muted);
    font-weight: 600;
    line-height: 1.6;
}

.success-text {
    color: #166534;
}

.print-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.print-head img {
    height: 64px;
    width: auto;
    background: #fff;
    padding: 7px;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
}

.print-head h1 {
    margin: 0;
    color: var(--brand-primary);
}

.print-head p {
    margin: 5px 0 0;
    color: var(--brand-muted);
    font-weight: 700;
}

.field select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    padding: 12px;
    font-size: 15px;
    background: #fff;
}

.is-hidden {
    display: none !important;
}

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

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.stat h3 {
    margin: 0 0 10px;
    color: var(--brand-primary);
}

.stat .num {
    font-size: 24px;
    font-weight: 900;
    color: var(--brand-dark);
}

@media (max-width: 800px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .print-head {
        align-items: flex-start;
    }

    .print-head img {
        height: 54px;
    }
}

@media print {
    .print-head {
        display: flex !important;
    }

    .print-head img {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
