/* =====================================================================
   AL DIYAR - "Soft Lime" theme  (modern, light, glass cards)
   Load this LAST in <head>, after the page's own <style> block:
       <link href="css/theme.css" rel="stylesheet">
   To adjust the look, change the values in :root only.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --th-ink:           #1c1d1a;   /* near-black: text, primary buttons, hero cards */
    --th-ink-soft:      #3a3b37;
    --th-muted:         #6e706a;   /* secondary text, labels */
    --th-line:          #e6e8e2;   /* borders */
    --th-line-soft:     #f0f1ec;
    --th-surface:       rgba(255, 255, 255, 0.86);   /* glass cards */
    --th-surface-solid: #ffffff;
    --th-subtle:        #f6f7f3;   /* table heads, filter row */
    --th-lime:          #d6ec9a;   /* accent */
    --th-lime-strong:   #b9da5c;
    --th-lime-ink:      #3f5a0d;   /* text on lime */
    --th-radius-lg:     28px;
    --th-radius:        18px;
    --th-radius-sm:     12px;
    --th-shadow:        0 20px 50px rgba(28, 29, 26, 0.06), 0 2px 6px rgba(28, 29, 26, 0.04);

    /* Chart series (validated: colour-blind safe, 3:1 contrast) */
    --th-series-sketch: #6f9a1f;   /* Sketch payments: olive lime */
    --th-series-visit:  #5577b8;   /* Site visit payments: dusty blue */
}

/* ===== BOOTSTRAP 5 HELPERS =====
   css/bootstrap.css is Bootstrap 4, which lacks these Bootstrap 5 classes
   used by the pages. Values match Bootstrap 5, so this is safe after an upgrade too. */
.form-label {
    display: inline-block;
    margin-bottom: .4rem;
}
.form-select {
    display: block;
    width: 100%;
    padding: .375rem 2.25rem .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--th-ink);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%231c1d1a' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 14px 10px;
    border: 1px solid var(--th-line);
    border-radius: var(--th-radius-sm);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.form-select-sm {
    padding-top: .25rem;
    padding-bottom: .25rem;
    padding-left: .6rem;
    font-size: .875rem;
}
.form-control {
    height: auto;
}
.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.row.g-2 { margin-top: -.5rem; margin-left: -.25rem; margin-right: -.25rem; }
.row.g-2 > * { padding-left: .25rem; padding-right: .25rem; margin-top: .5rem; }
.row.g-3 { margin-top: -1rem; margin-left: -.5rem; margin-right: -.5rem; }
.row.g-3 > * { padding-left: .5rem; padding-right: .5rem; margin-top: 1rem; }
.ms-1 { margin-left: .25rem !important; }
.ms-2 { margin-left: .5rem !important; }
.ms-auto { margin-left: auto !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.me-auto { margin-right: auto !important; }
.text-end { text-align: right !important; }
.text-start { text-align: left !important; }
.fw-normal { font-weight: 400 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.btn-close {
    box-sizing: content-box;
    width: 12px;
    height: 12px;
    padding: 6px;
    border: 0;
    border-radius: 50%;
    opacity: .6;
    cursor: pointer;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%231c1d1a'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center / 12px auto no-repeat;
}
.btn-close:hover { opacity: 1; }
.alert-dismissible { position: relative; padding-right: 3rem; }
.alert-dismissible .btn-close { position: absolute; top: 50%; right: .75rem; transform: translateY(-50%); }

/* ===== PAGE ===== */
html, body {
    min-height: 100%;
}
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif !important;
    color: var(--th-ink);
    background:
        radial-gradient(1100px 600px at 0% 0%, #e4f1c4 0%, rgba(228, 241, 196, 0) 60%),
        radial-gradient(900px 500px at 55% 0%, #f5e6ea 0%, rgba(245, 230, 234, 0) 55%),
        radial-gradient(1000px 700px at 100% 100%, #dce5f1 0%, rgba(220, 229, 241, 0) 60%),
        #f2f3ef !important;
    background-attachment: fixed !important;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 {
    color: var(--th-ink);
    letter-spacing: -0.01em;
}
.text-muted {
    color: var(--th-muted) !important;
}

/* ===== GLASS CONTAINER ===== */
.page-wrap {
    background: var(--th-surface) !important;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--th-radius-lg) !important;
    box-shadow: var(--th-shadow) !important;
    /* No backdrop-filter here: it would trap Bootstrap modals under their overlay */
}

/* ===== NAVBAR (nav.php) ===== */
.navbar-main {
    background: rgba(255, 255, 255, 0.65) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 rgba(28, 29, 26, 0.04);
}
.main-menu .nav-item {
    background: transparent !important;
}
.main-menu .nav-link {
    background: transparent !important;
    color: var(--th-ink) !important;
    font-weight: 500 !important;
    border-radius: 999px !important;
    padding: 9px 16px !important;
    transition: background .15s ease;
}
.main-menu .nav-link:hover {
    background: rgba(28, 29, 26, 0.06) !important;
}
.main-menu .nav-link.active {
    background: var(--th-ink) !important;
    color: #fff !important;
}
.logout-btn,
.logout-btn .nav-link {
    background: transparent !important;
}
.logout-btn .nav-link,
.main-menu .logout-btn {
    color: #b0443a !important;
}
.logout-btn .nav-link:hover,
a.nav-link.logout-btn:hover {
    background: #f8e5e2 !important;
}
.menu-toggle {
    background: var(--th-ink) !important;
    color: #fff !important;
    border-radius: 12px !important;
}
@media (max-width: 768px) {
    .main-menu {
        background: var(--th-surface-solid) !important;
        border: 1px solid var(--th-line);
        border-radius: var(--th-radius) !important;
        box-shadow: var(--th-shadow);
    }
}

/* ===== PAGE HEADER ===== */
.topbar {
    background: transparent !important;
    color: var(--th-ink) !important;
    padding: 34px 32px 10px !important;
}
.topbar h2 {
    color: var(--th-ink) !important;
    font-size: 34px !important;
    font-weight: 500 !important;
    letter-spacing: -0.02em;
}
.topbar p {
    color: var(--th-muted) !important;
    opacity: 1 !important;
    font-size: 15px;
}
.content-area {
    padding: 22px 32px 32px !important;
}

/* Dark pill (e.g. a date tag): <span class="pill-dark">Sunday, 15 November</span> */
.pill-dark {
    display: inline-block;
    background: var(--th-ink);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
}

/* ===== BUTTONS ===== */
.btn {
    border-radius: var(--th-radius-sm) !important;
    font-weight: 500;
    background-image: none !important;
}
.btn-primary,
.btn-deep-purple {
    background-color: var(--th-ink) !important;
    border-color: var(--th-ink) !important;
    color: #fff !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-deep-purple:hover {
    background-color: var(--th-ink-soft) !important;
    border-color: var(--th-ink-soft) !important;
}
.btn-secondary,
.btn-outline-secondary {
    background: var(--th-surface-solid) !important;
    border: 1px solid var(--th-line) !important;
    color: var(--th-ink) !important;
}
.btn-secondary:hover,
.btn-outline-secondary:hover {
    background: var(--th-subtle) !important;
    border-color: #d5d8cf !important;
}
.btn-warning {
    background: var(--th-lime) !important;
    border-color: var(--th-lime) !important;
    color: var(--th-lime-ink) !important;
}
.btn-warning:hover {
    background: var(--th-lime-strong) !important;
    border-color: var(--th-lime-strong) !important;
}
.btn-danger {
    background: #fbe7e4 !important;
    border-color: #f3cfc9 !important;
    color: #a53a2f !important;
}
.btn-danger:hover {
    background: #f6d4ce !important;
}
.btn-success {
    background: var(--th-lime) !important;
    border-color: var(--th-lime) !important;
    color: var(--th-lime-ink) !important;
}

/* ===== FORMS ===== */
.form-label,
.filter-row label {
    color: var(--th-ink-soft) !important;
    font-weight: 500 !important;
    font-size: 13.5px;
}
.form-control,
.form-select {
    border: 1px solid var(--th-line);
    border-radius: var(--th-radius-sm) !important;
    background-color: var(--th-surface-solid);
    color: var(--th-ink);
}
.form-control:not(.form-control-sm),
.form-select:not(.form-select-sm) {
    padding-top: .6rem;
    padding-bottom: .6rem;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--th-ink) !important;
    box-shadow: 0 0 0 4px rgba(214, 236, 154, 0.55) !important;
}
.form-control[readonly] {
    background: var(--th-subtle) !important;
    color: var(--th-ink-soft) !important;
    font-weight: 500;
}
.form-check-input:checked,
input[type=checkbox]:checked {
    accent-color: var(--th-ink);
}
.required::after {
    color: #b0443a !important;
}
.help-text,
.meta-text {
    color: var(--th-muted) !important;
}

/* ===== SECTIONS / PANELS ===== */
.form-section,
.panel {
    background: var(--th-surface-solid);
    border: 1px solid var(--th-line) !important;
    border-radius: var(--th-radius) !important;
    box-shadow: 0 1px 2px rgba(28, 29, 26, 0.03);
}
.form-section-title,
.panel-title {
    background: transparent !important;
    color: var(--th-ink) !important;
    font-weight: 600 !important;
    font-size: 15.5px !important;
    padding: 16px 20px 12px !important;
    border-bottom: 1px solid var(--th-line-soft);
}
.form-section-body,
.panel-body {
    padding: 18px 20px !important;
}
.filter-row {
    background: var(--th-surface-solid) !important;
    border: 1px solid var(--th-line) !important;
    border-radius: var(--th-radius) !important;
}
.sketch-box {
    background: var(--th-subtle) !important;
    border: 1px dashed #d5d8cf !important;
    border-radius: var(--th-radius-sm) !important;
}
.section-heading {
    color: var(--th-ink) !important;
}
hr {
    border-color: var(--th-line);
    opacity: 1;
}

/* ===== TABLES ===== */
.table {
    --bs-table-border-color: var(--th-line-soft);
    border-color: var(--th-line-soft);
}
.table-bordered > :not(caption) > * > * {
    border-color: var(--th-line-soft);
}
.table thead th {
    background: var(--th-subtle) !important;
    color: var(--th-muted) !important;
    font-weight: 600 !important;
    font-size: 12.5px !important;
    letter-spacing: .02em;
}
.table td {
    color: var(--th-ink);
}
.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: #fafbf7;
}
.table-light,
.table-light > td {
    --bs-table-bg: var(--th-subtle);
}
.table-responsive {
    border-radius: var(--th-radius-sm);
}
.link-plain {
    color: var(--th-ink) !important;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--th-lime-strong);
    text-underline-offset: 3px;
}
.link-plain:hover {
    text-decoration-color: var(--th-ink);
}

/* ===== KPI / SUMMARY CARDS ===== */
.kpi,
.pay-card {
    background: var(--th-surface-solid) !important;
    border: 1px solid var(--th-line) !important;
    border-radius: var(--th-radius) !important;
}
.kpi .kpi-label,
.pay-card .pay-label {
    color: var(--th-muted) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 500 !important;
    font-size: 13px !important;
}
.kpi .kpi-value,
.pay-card .pay-value {
    color: var(--th-ink) !important;
    font-weight: 600 !important;
    letter-spacing: -0.02em;
}
.kpi .kpi-sub {
    color: var(--th-muted) !important;
}
/* Hero card: black with lime */
.kpi.hero,
.pay-card.total {
    background: var(--th-ink) !important;
    border-color: var(--th-ink) !important;
}
.kpi.hero .kpi-label,
.kpi.hero .kpi-sub,
.pay-card.total .pay-label {
    color: rgba(255, 255, 255, 0.7) !important;
}
.kpi.hero .kpi-value,
.kpi.hero .kpi-unit,
.pay-card.total .pay-value {
    color: #fff !important;
}
.kpi.hero .kpi-value {
    color: var(--th-lime) !important;
}
/* Due / settled cards */
.pay-card.due {
    background: #fdf1ef !important;
    border-color: #f3d3cd !important;
}
.pay-card.due .pay-label,
.pay-card.due .pay-value {
    color: #a53a2f !important;
}
.pay-card.settled {
    background: #f1f8e1 !important;
    border-color: #dcebb4 !important;
}
.pay-card.settled .pay-label,
.pay-card.settled .pay-value {
    color: var(--th-lime-ink) !important;
}
/* Progress */
.pay-progress,
.act-row .act-track {
    background: var(--th-line-soft) !important;
    height: 8px !important;
}
.pay-progress .progress-bar {
    background: var(--th-ink) !important;
}

/* ===== BADGES ===== */
.badge-status {
    font-weight: 600 !important;
    border-radius: 999px !important;
}
.status-approved,
.pay-received,
.act-approved     { background: #eaf5d3 !important; color: #3f5a0d !important; }
.status-not-approved,
.pay-not-received,
.act-not-approved { background: #fbe7e4 !important; color: #a53a2f !important; }
.status-revisit,
.pay-partial,
.act-revisit      { background: #fbf1d3 !important; color: #7a5b0f !important; }
.status-other,
.act-other,
.st-info          { background: #eeefeb !important; color: #4b4d47 !important; }
.st-critical      { background: #fbe7e4 !important; color: #a53a2f !important; }
.st-serious       { background: #fdeadb !important; color: #8f4a14 !important; }
.st-warning       { background: #fbf1d3 !important; color: #7a5b0f !important; }
.type-advance,
.src-sketch       { background: #eef5dc !important; color: #4a6612 !important; }
.type-balance,
.src-visit        { background: #e6edf8 !important; color: #34508a !important; }
.badge-extra      { background: var(--th-ink) !important; color: #fff !important; }
.fill-approved    { background: var(--th-lime-strong) !important; }
.fill-not         { background: #d97a6c !important; }
.fill-revisit     { background: #e3c060 !important; }
.fill-pending     { background: #b8bab3 !important; }

/* ===== ALERTS (Bootstrap) ===== */
.alert {
    border-radius: var(--th-radius-sm);
    border: 1px solid transparent;
}
.alert-success { background: #f1f8e1; border-color: #dcebb4; color: #3f5a0d; }
.alert-danger  { background: #fdf1ef; border-color: #f3d3cd; color: #8f2f25; }
.alert-warning { background: #fdf7e4; border-color: #f1e2b0; color: #6f5310; }

/* ===== DASHBOARD ALERT TABS (pill style) ===== */
.alert-tabs {
    border-bottom: 0 !important;
    gap: 6px;
}
.alert-tabs .nav-link {
    border: 1px solid var(--th-line) !important;
    border-radius: 999px !important;
    color: var(--th-ink) !important;
    background: var(--th-surface-solid);
    font-weight: 500 !important;
    padding: 7px 14px;
}
.alert-tabs .nav-link:hover {
    background: var(--th-subtle);
}
.alert-tabs .nav-link.active {
    background: var(--th-ink) !important;
    border-color: var(--th-ink) !important;
    color: #fff !important;
}
.alert-tabs .count {
    background: var(--th-line-soft) !important;
    color: var(--th-ink) !important;
}
.alert-tabs .nav-link.active .count {
    background: var(--th-lime) !important;
    color: var(--th-lime-ink) !important;
}

/* ===== BAR GRAPHS ===== */
.seg-sketch,
.dot-sketch { background: var(--th-series-sketch) !important; }
.seg-visit,
.dot-visit  { background: var(--th-series-visit) !important; }
.kpi.hero .dot-sketch { background: var(--th-lime) !important; }
.kpi.hero .dot-visit  { background: #b9c9ea !important; }
.bcol:hover,
.bcol:focus { background: var(--th-subtle) !important; }
.bcol.is-hl { background: #f1f8e1 !important; }
.bchart-x .is-hl,
.bchart-tip .tip-title { color: var(--th-ink) !important; }
.bchart-tip {
    border: 1px solid var(--th-line) !important;
    border-radius: var(--th-radius-sm) !important;
}

/* ===== MODALS ===== */
.modal-content {
    border: 0;
    border-radius: 22px;
    box-shadow: 0 30px 70px rgba(28, 29, 26, 0.18);
}
.modal-header {
    background: transparent !important;
    color: var(--th-ink) !important;
    border-bottom: 1px solid var(--th-line-soft);
    padding: 18px 22px;
}
.modal-header .modal-title {
    font-weight: 600;
}
.modal-header .btn-close {
    filter: none !important;
    box-sizing: content-box;
    width: 14px;
    height: 14px;
    padding: 8px;
    border: 0;
    border-radius: 50%;
    opacity: .6;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%231c1d1a'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center / 14px auto no-repeat !important;
}
.modal-header .btn-close:hover {
    opacity: 1;
    background-color: var(--th-subtle) !important;
}
/* Modals always above their dark overlay */
.modal-backdrop { z-index: 1050; }
.modal          { z-index: 1055; }
.modal-body {
    padding: 20px 22px;
}
.modal-footer {
    border-top: 1px solid var(--th-line-soft);
}

/* ===== CLAIM FORM (claimform.php: mdb / style.css classes) ===== */
.wrapper-bg {
    background: transparent !important;
}
.claim-form-cover {
    background: var(--th-surface) !important;
    border-radius: var(--th-radius-lg) !important;
    box-shadow: var(--th-shadow) !important;
}
.claim-form-hd {
    background: transparent !important;
    color: var(--th-ink) !important;
}
.claim-form-hd h2 {
    color: var(--th-ink) !important;
    font-weight: 500 !important;
}
.card-form {
    border: 1px solid var(--th-line) !important;
    border-radius: var(--th-radius) !important;
    box-shadow: none !important;
    overflow: hidden;
}
.card-form .card-header {
    background: var(--th-subtle) !important;
    color: var(--th-ink) !important;
    border-bottom: 1px solid var(--th-line-soft) !important;
}
.card-form .card-header h3,
.card-form .card-header h4 {
    color: var(--th-ink) !important;
    font-weight: 600 !important;
}
.signature-view {
    border: 1.5px dashed #c9ccc2 !important;
    border-radius: var(--th-radius-sm);
    background: #fff;
}

/* ===== CLIENT LIST ===== */
.alert-card {
    border: 1px solid var(--th-line) !important;
    border-radius: var(--th-radius) !important;
    background: var(--th-surface-solid) !important;
}
.alert-card.active {
    border-color: var(--th-ink) !important;
    box-shadow: 0 0 0 1.5px var(--th-ink) inset !important;
}
.mini-bar {
    background: var(--th-line-soft) !important;
}
.mini-bar span {
    background: var(--th-ink) !important;
}
.st-done {
    background: #eaf5d3 !important;
    color: #3f5a0d !important;
}
tr.row-urgent > td:first-child {
    box-shadow: inset 3px 0 0 #d97a6c !important;
}

/* ===== VISIT FORMS LIST (claimlist.php) ===== */
.visit-no {
    background: var(--th-line-soft) !important;
    color: var(--th-ink) !important;
}
tr.is-today > td:first-child {
    box-shadow: inset 3px 0 0 var(--th-lime-strong) !important;
}
.alert-card:focus {
    outline: none;
}
.alert-card:focus-visible {
    outline: 2px solid var(--th-ink);
    outline-offset: 2px;
}
.alert-card:not(.active):focus {
    box-shadow: none;
}