/* One Ummah Agro — admin panel (from docs/design_files, with compact sizes: 14px text, 36px controls) */
:root {
    --teal: #0F4C5C; --teal-ink: #072A33; --paddy: #8DB33A; --paddy-deep: #5E8A1E; --paddy-soft: #E7F0D2;
    --gold: #E3A72F; --gold-soft: #FBEFD2; --mist: #F4F7F2; --line: #DCE6E0; --ink: #11292F; --muted: #5B6F73;
    --red: #B3261E; --red-soft: #FBE3E0; --sky: #DCEEF0;
    --control: 36px; --control-sm: 30px; /* height of buttons, inputs, dropdowns and date pickers; phones: common.css */
}
* { box-sizing: border-box; }
body.admin { margin: 0; font-family: 'Anek Bangla', system-ui, sans-serif; font-size: 14px; line-height: 1.5; color: var(--ink); background: #EEF2EE; }
a { color: var(--teal); }
h1, h2 { font-family: 'Poppins', 'Anek Bangla', sans-serif; margin: 0; color: var(--teal-ink); }
h2 small, h1 small { font-weight: 500; color: var(--muted); font-size: .8em; }
code { background: var(--mist); padding: .05rem .35rem; border-radius: 6px; font-size: .88em; }
.icon { width: 1.4rem; height: 1.4rem; flex-shrink: 0; }
.icon--sm { width: 1.1rem; height: 1.1rem; }

/* layout */
.a-side { position: fixed; inset: 0 auto 0 0; width: 220px; display: flex; flex-direction: column; background: var(--teal-ink); color: rgb(255 255 255 / .8); padding: .85rem .6rem; z-index: 20; }
.a-brand { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-family: 'Poppins', sans-serif; font-weight: 600; margin: 0 .35rem .9rem; }
.a-brand small { display: block; font-family: 'Anek Bangla'; font-weight: 400; font-size: .75rem; color: var(--gold); }
.a-side nav { display: grid; gap: .1rem; }
.a-side a { display: flex; align-items: center; gap: .55rem; padding: .42rem .65rem; border-radius: 8px; color: inherit; text-decoration: none; }
.a-side a:hover { background: rgb(255 255 255 / .07); color: #fff; }
.a-side a.is-active { background: var(--teal); color: #fff; }
.a-side a.is-active .icon { color: var(--gold); }
.a-side nav b { margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 99px; background: var(--gold); color: var(--teal-ink); font-size: .75rem; text-align: center; }
.a-side__foot { margin-top: auto; display: grid; gap: .1rem; border-top: 1px solid rgb(255 255 255 / .1); padding-top: .5rem; }
.a-main { margin-left: 220px; min-height: 100vh; }
.a-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .75rem; min-height: 52px; padding: .4rem 1rem; background: rgb(238 242 238 / .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.a-top h1 { font-size: 1.1rem; }
.a-burger { display: none; border: 0; background: #fff; border-radius: 10px; padding: .4rem; color: var(--teal); }
.a-content { padding: .9rem 1rem 1.5rem; display: grid; gap: .75rem; align-content: start; }
.a-content > p { margin: 0; }

/* cards & grid */
.a-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem; box-shadow: 0 2px 10px rgb(7 42 51 / .04); min-width: 0; }
.a-card__head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; flex-wrap: wrap; }
.a-card__head h2 { font-size: .98rem; }
.a-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; align-items: start; }
.a-grid-2--wide { grid-template-columns: 1.5fr 1fr; }
.a-grid-2 > div { display: grid; gap: .75rem; }
.a-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.a-cards--3 { grid-template-columns: repeat(3, 1fr); }
.a-h2 { font-size: 1.05rem; margin-top: .3rem; }
.a-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.a-stat { display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border-radius: 12px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; }
.a-stat:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -15px rgb(7 42 51 / .3); }
.a-stat > .icon { width: 2.3rem; height: 2.3rem; padding: .5rem; border-radius: 10px; background: var(--paddy-soft); color: var(--paddy-deep); }
.a-stat span { display: grid; }
.a-stat small { color: var(--muted); }
.a-stat strong { font-family: 'Poppins', 'Anek Bangla'; font-size: 1.2rem; color: var(--teal-ink); line-height: 1.2; }

/* blog post form */
.post-form { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.post-form .trumbowyg-box { margin: 0; border-radius: 8px; }
.post-form .is-invalid .trumbowyg-box { border-color: var(--red); }
.cover-picker summary { margin-top: .4rem; color: var(--teal); font-size: .85rem; cursor: pointer; }
.cover-picker__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: .35rem; max-height: 220px; margin-top: .4rem; overflow-y: auto; }
.cover-picker__grid button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; cursor: pointer; aspect-ratio: 4 / 3; }
.cover-picker__grid button.is-active { border-color: var(--gold); }
.cover-picker__grid img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1100px) { .post-form { grid-template-columns: minmax(0, 1fr); } }

/* dashboards */
.d-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.d-kpi { display: grid; gap: .05rem; min-width: 0; padding: .55rem .75rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 2px 10px rgb(7 42 51 / .04); color: inherit; text-decoration: none; }
.d-kpi:hover { border-color: var(--teal); }
.d-kpi small { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .8rem; }
.d-kpi small .icon { width: 1rem; height: 1rem; color: var(--paddy-deep); }
.d-kpi strong { overflow: hidden; font-family: 'Poppins', 'Anek Bangla'; font-size: 1.15rem; line-height: 1.3; color: var(--teal-ink); text-overflow: ellipsis; white-space: nowrap; }
.d-kpi span { overflow: hidden; color: var(--muted); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.d-up { color: var(--paddy-deep); font-weight: 600; }
.d-down { color: var(--red); font-weight: 600; }
.d-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: .6rem; }
.d-row--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.d-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.d-row > .a-card .a-card__head { margin-bottom: .35rem; }
.d-row > .a-card .a-card__head small { color: var(--muted); font-size: .78rem; }
.d-chart { min-height: 230px; margin: 0 -.35rem -.4rem; }
.d-task { display: flex; align-items: center; gap: .6rem; padding: .38rem 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.d-task:first-of-type { border-top: 0; }
.d-task b { min-width: 2.1rem; padding: .05rem .45rem; border-radius: 99px; background: var(--gold-soft); color: var(--teal-ink); font-size: .8rem; text-align: center; }
.d-task--urgent b { background: var(--red-soft); color: var(--red); }
.d-task span { flex: 1; min-width: 0; }
.d-task .icon { width: .95rem; height: .95rem; color: var(--muted); }
.d-task:hover span { color: var(--teal); }
.d-done { display: flex; align-items: center; gap: .4rem; margin: 0; padding: .4rem 0; color: var(--paddy-deep); }
@media (max-width: 1100px) {
    .d-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .d-row, .d-row--even, .d-row--3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .d-kpis { gap: .5rem; }
    .d-kpi { padding: .5rem .6rem; }
    .d-kpi strong { font-size: 1.05rem; }
    .d-kpi span { white-space: normal; }
}

/* tables */
.a-table-wrap { overflow-x: auto; }
.a-table { width: 100%; border-collapse: collapse; }
.a-table th, .a-table td { padding: .4rem .55rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.a-table thead th { font-size: .78rem; color: var(--muted); font-weight: 600; background: var(--mist); }
.a-table tbody tr[onclick] { cursor: pointer; }
.a-table tbody tr:hover td { background: #FAFCF9; }
.a-table td small { display: block; color: var(--muted); font-size: .78rem; }
.a-table .num { text-align: right; white-space: nowrap; }
.a-table tfoot td { border: 0; padding: .35rem .6rem; color: var(--muted); }
.a-table tfoot .total td { font-weight: 700; color: var(--teal-ink); font-size: 1.05rem; border-top: 2px solid var(--line); }
.a-table--edit input[type=number] { width: 110px; }
.a-table--edit select, .a-table--edit input { padding: .25rem .5rem; }
.a-thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; display: block; }
.a-thumb--lg { width: 110px; height: 110px; border-radius: 14px; }
.a-preview { width: 100%; max-width: 260px; border-radius: 14px; margin-bottom: .6rem; }
.a-msg { max-width: 420px; }

/* occupancy */
.a-occ { border-collapse: separate; border-spacing: 3px; font-size: .78rem; }
.a-occ th { font-weight: 600; color: var(--muted); text-align: center; padding: .2rem; }
.a-occ th small { display: block; font-weight: 400; font-size: .7rem; }
.a-occ thead th.we { color: var(--gold); }
.a-occ tbody th { text-align: left; white-space: nowrap; padding-right: .8rem; color: var(--teal-ink); }
.occ { width: 30px; height: 30px; text-align: center; border-radius: 6px; background: var(--mist); font-weight: 700; }
.occ--pending { background: var(--gold-soft); color: #8A5D07; }
.occ--confirmed { background: var(--paddy-soft); color: var(--paddy-deep); }
.occ--full { background: var(--teal); color: #fff; }
.a-legend { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--muted); }
.a-legend .occ { display: inline-block; width: 14px; height: 14px; margin-left: .5rem; }

/* forms */
.a-form { display: grid; gap: .6rem; }
.a-form label, .a-login label { display: grid; gap: .2rem; font-weight: 600; font-size: .82rem; color: var(--teal-ink); }
.a-form label small { font-weight: 400; color: var(--muted); }
.a-form input:not([type=checkbox]), .a-form select, .a-form textarea, .a-login input, .a-search input, .a-search select, .a-table--edit input, .a-table--edit select {
    font: inherit; font-size: .875rem; font-weight: 400; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; min-height: var(--control); padding: .35rem .6rem; width: 100%;
}
.a-form input:focus, .a-form select:focus, .a-form textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.a-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.a-row--3 { grid-template-columns: repeat(3, 1fr); }
.a-row--4 { grid-template-columns: repeat(4, 1fr); }
.a-check { display: flex !important; align-items: center; gap: .5rem; font-weight: 500 !important; }
.a-check input { width: 1.1rem; height: 1.1rem; accent-color: var(--teal); }
.a-media-row { display: flex; gap: .75rem; align-items: flex-start; }
.a-grow { flex: 1; display: grid; gap: .6rem; }

/* buttons */
.a-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: var(--control); padding: .25rem .75rem; font-size: .8125rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--teal); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.a-btn:hover { border-color: var(--teal); }
.a-btn--primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.a-btn--primary:hover { background: var(--teal-ink); }
.a-btn--wa { background: #1FAF5B; border-color: #1FAF5B; color: #fff; }
.a-btn--danger { color: var(--red); border-color: #F1C0BA; }
.a-btn--danger:hover { background: var(--red-soft); border-color: var(--red); }
.a-btn--sm { min-height: var(--control-sm); padding: .15rem .55rem; font-size: .8rem; }
.a-btn--block { width: 100%; }
.a-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }

/* toolbar */
.a-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.a-tabs { display: flex; flex-wrap: wrap; gap: .3rem; }
.a-tabs a { padding: .25rem .65rem; border-radius: 99px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--muted); font-size: .82rem; }
.a-tabs a b { color: var(--teal-ink); }
.a-tabs a.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }
.a-tabs a.is-active b { color: var(--gold); }
.a-search { display: flex; gap: .5rem; }
.a-search input { min-width: 220px; }
.a-pager { display: flex; gap: .3rem; margin-top: .6rem; }
.a-pager a { padding: .15rem .5rem; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; }
.a-pager a.is-active { background: var(--teal); color: #fff; }

/* misc */
.badge { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font-size: .74rem; font-weight: 700; background: var(--gold-soft); color: #8A5D07; white-space: nowrap; }
.badge--confirmed, .badge--approved, .badge--called, .badge--visited, .badge--processing, .badge--shipped, .badge--checked_in, .badge--contacted, .badge--quoted, .badge--verifying { background: var(--sky); color: var(--teal); }
.badge--delivered, .badge--completed, .badge--paid, .badge--active { background: var(--paddy-soft); color: var(--paddy-deep); }
.badge--cancelled, .badge--declined, .badge--refunded, .badge--closed { background: var(--red-soft); color: var(--red); }
.badge--unpaid { background: #F0F0F0; color: #555; }
.a-kv { display: grid; gap: .3rem; margin: 0; }
.a-kv > div { display: grid; grid-template-columns: 130px 1fr; gap: .6rem; padding-bottom: .3rem; border-bottom: 1px dashed var(--line); }
.a-kv dt { color: var(--muted); }
.a-kv dd { margin: 0; }
.a-kv .total dd { font-size: 1.1rem; }
.a-timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--line); display: grid; gap: .4rem; }
.a-timeline time { display: block; font-size: .76rem; color: var(--muted); }
.a-timeline em { color: var(--muted); font-size: .85rem; }
.a-alert { padding: .5rem .75rem; border-radius: 8px; background: var(--sky); color: var(--teal-ink); margin: 0; }
.a-alert--error { background: var(--red-soft); color: var(--red); }
.a-alert--warn { background: var(--gold-soft); color: #6B4A0B; }
.a-alert--info { background: var(--sky); }
.alert { padding: .8rem 1rem; border-radius: 12px; display: flex; gap: .5rem; align-items: center; }
.alert--success { background: var(--paddy-soft); color: var(--paddy-deep); }
.alert--error { background: var(--red-soft); color: var(--red); }
.a-empty { color: var(--muted); text-align: center; padding: 1.1rem 1rem; margin: 0; }
.a-list { margin: 0; padding-left: 1.1rem; display: grid; gap: .4rem; }

/* login */
.a-auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(800px 400px at 80% 0%, rgb(141 179 58 / .3), transparent 70%), linear-gradient(140deg, var(--teal-ink), var(--teal)); }
.a-login { width: min(100%, 400px); display: grid; gap: .75rem; padding: 1.6rem; border-radius: 16px; background: #fff; box-shadow: 0 40px 80px -30px rgb(0 0 0 / .5); text-align: center; }
.a-login img { margin: 0 auto; }
.a-login h1 { font-size: 1.4rem; }
.a-login p { margin: -.4rem 0 .4rem; color: var(--muted); font-size: .9rem; }
.a-login label { text-align: left; }
.a-login__back { font-size: .88rem; }

@media (max-width: 1100px) {
    .a-grid-2, .a-grid-2--wide, .a-cards, .a-cards--3 { grid-template-columns: 1fr; }
    .a-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
    .a-side { transform: translateX(-100%); transition: transform .3s; }
    .a-side.is-open { transform: none; box-shadow: 0 0 0 100vmax rgb(0 0 0 / .4); }
    .a-main { margin-left: 0; }
    .a-burger { display: grid; }
    .a-content { padding: .75rem; }
    .a-top { padding: .4rem .75rem; }
    .a-stats { grid-template-columns: 1fr; }
    .a-row, .a-row--3, .a-row--4 { grid-template-columns: 1fr; }
    .a-kv > div { grid-template-columns: 1fr; gap: .1rem; }
    .a-search { width: 100%; } .a-search input { min-width: 0; flex: 1; }
}
@media print {
    .a-side, .a-top, form.a-card, .a-actions, .a-content > p { display: none !important; }
    .a-main { margin: 0; }
    .a-grid-2 { display: block; }
}
.a-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .5rem; }
.a-gallery__item { display: grid; gap: .25rem; padding: .4rem; border: 1px solid var(--line); border-radius: 12px; font-size: .8rem; }
.a-gallery__item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.a-gallery__item .a-check { font-size: .8rem; }

/* ---------- polish (2026-11-28) ---------- */
.a-brand span { white-space: nowrap; font-size: .92rem; line-height: 1.25; }
.a-form input[type=file], .a-form input[type=file]:not([type=checkbox]) { padding: 3px; background: var(--mist); border-style: dashed; cursor: pointer; }
input[type=file]::file-selector-button { margin-right: .7rem; padding: .4rem .9rem; border: 0; border-radius: 8px; background: var(--teal); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--teal-ink); }
.a-gallery__item .a-check { font-size: .78rem; line-height: 1.3; align-items: flex-start; }
.a-table td { overflow-wrap: anywhere; }
.a-table td:first-child a { white-space: nowrap; }

@media (max-width: 800px) {
    .a-top h1 { font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
    .a-card { padding: .75rem; }
    .a-stats { grid-template-columns: 1fr 1fr; gap: .5rem; }
    .a-stat { gap: .55rem; padding: .6rem; }
    .a-stat > .icon { width: 2.2rem; height: 2.2rem; padding: .45rem; border-radius: 11px; }
    .a-stat small { font-size: .78rem; line-height: 1.3; }
    .a-stat strong { font-size: 1.2rem; }
    .a-toolbar { align-items: stretch; }
    .a-search { flex-wrap: wrap; }
    .a-search select { flex: 1 1 100%; }
    .a-search input { flex: 1 1 0; }
    .a-media-row { flex-direction: column; align-items: stretch; }
    .a-media-row .a-thumb--lg { width: 100%; height: 170px; }

    /* list tables → cards */
    .a-table--cards, .a-table--cards tbody, .a-table--cards tr, .a-table--cards td { display: block; width: 100%; }
    .a-table--cards thead { display: none; }
    .a-table--cards tr { margin-bottom: .5rem; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 12px; background: #FAFCF9; }
    .a-table--cards tbody tr:hover td { background: none; }
    .a-table--cards td { display: grid; grid-template-columns: 6.8rem 1fr; gap: .7rem; padding: .4rem 0; border-bottom: 1px dashed var(--line); text-align: left !important; }
    .a-table--cards td:last-child { border-bottom: 0; }
    .a-table--cards td::before { content: attr(data-label); font-size: .78rem; font-weight: 600; color: var(--muted); }
    .a-table--cards td[data-label] > * { grid-column: 2; }
    .a-table--cards td:not([data-label]) { grid-template-columns: 1fr; }
    .a-table--cards td:not([data-label])::before { display: none; }
    .a-table--cards td:first-child a { white-space: normal; }
    .a-table--cards input, .a-table--cards select { max-width: 100%; }
    .a-table--edit.a-table--cards input[type=number] { width: 100%; }
}
