:root{
  --bg:#f7f8fb;
  --card:#ffffff;
  --text:#101828;
  --muted:#475467;
  --border:#eaecf0;
  --primary:#175cd3;
  --primary-2:#0b4abf;
  --success:#12b76a;
  --warn:#f79009;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
}

a{color:inherit;text-decoration:none}
a:hover{text-decoration:underline}
.container{max-width:1100px;margin:0 auto;padding:18px}

.header{
  position:sticky;top:0;z-index:20;
  background:rgba(247,248,251,0.92);
  backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid var(--border);
}
.navbar{display:flex;align-items:center;gap:14px;justify-content:space-between}
.brand{display:flex;align-items:center;gap:10px;font-weight:800}
.brandMark{
  width:34px;height:34px;border-radius:10px;
  background:var(--primary);
  display:grid;place-items:center;color:#fff;font-weight:900;
  box-shadow:0 6px 18px rgba(23,92,211,0.25);
}
.navLinks{display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.navLinks a{padding:8px 10px;border-radius:10px;color:var(--muted)}
.navLinks a.active, .navLinks a:hover{background:#eef4ff;color:var(--primary)}
.navActions{display:flex;gap:10px;align-items:center}

.btn{
  display:inline-flex;align-items:center;justify-content:center;
  gap:8px;
  padding:10px 14px;border-radius:12px;
  border:1px solid var(--border);
  background:#fff;color:var(--text);
  font-weight:700;cursor:pointer;
}
.btn.primary{background:var(--primary);border-color:var(--primary);color:#fff}
.btn.primary:hover{background:var(--primary-2);border-color:var(--primary-2)}
.btn.ghost{background:transparent}
.btn:disabled{opacity:0.6;cursor:not-allowed}

.mobileToggle{display:none}
@media (max-width: 820px){
  .mobileToggle{display:inline-flex}
  .navLinks{
    display:none;
    width:100%;
    padding-top:12px;
    border-top:1px solid var(--border);
  }
  .navLinks.open{display:flex;flex-direction:column;align-items:flex-start}
  .navbar{flex-wrap:wrap}
}

.grid{display:grid;gap:14px}
.grid.two{grid-template-columns:1fr 1fr}
.grid.three{grid-template-columns:repeat(3,1fr)}
@media (max-width: 920px){.grid.three{grid-template-columns:1fr}}
@media (max-width: 820px){.grid.two{grid-template-columns:1fr}}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:16px;
  box-shadow:0 1px 2px rgba(16,24,40,0.06);
}
.card h2,.card h3{margin:0 0 10px}
.muted{color:var(--muted)}
.small{font-size:13px;color:var(--muted)}
.kpi{display:flex;flex-direction:column;gap:4px}
.kpi .value{font-size:22px;font-weight:900}

.hero{padding:22px 0 10px}
.heroWrap{display:grid;gap:16px;grid-template-columns:1.3fr 0.7fr;align-items:stretch}
@media (max-width: 920px){.heroWrap{grid-template-columns:1fr}}
.heroTitle{font-size:36px;line-height:1.1;margin:0 0 10px}
.heroP{margin:0 0 14px;color:var(--muted);max-width:62ch}
.badges{display:flex;flex-wrap:wrap;gap:10px}
.badge{
  display:inline-flex;align-items:center;gap:8px;
  padding:8px 10px;border-radius:999px;
  background:#f2f4f7;border:1px solid var(--border);
  font-weight:700;font-size:13px;color:#344054;
}
.dot{width:8px;height:8px;border-radius:50%;background:var(--success)}
.dot.warn{background:var(--warn)}

.table{width:100%;border-collapse:separate;border-spacing:0}
.table th, .table td{padding:12px 10px;text-align:left;border-bottom:1px solid var(--border)}
.table th{font-size:12px;letter-spacing:0.06em;text-transform:uppercase;color:#667085}
.table tr:hover td{background:#fafbff}
.table .actions{white-space:nowrap}

.fieldRow{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:820px){.fieldRow{grid-template-columns:1fr}}
label{display:block;font-weight:700;margin-bottom:6px}
input, select, textarea{
  width:100%;padding:10px 12px;border-radius:12px;
  border:1px solid var(--border);background:#fff;
  outline:none;
}
textarea{min-height:110px;resize:vertical}
input:focus, select:focus, textarea:focus{border-color:#b2ccff;box-shadow:0 0 0 3px rgba(178,204,255,0.4)}

.sectionTitle{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-bottom:10px}
.sectionTitle h2{margin:0}
.pills{display:flex;gap:8px;flex-wrap:wrap}
.pill{
  padding:6px 10px;border-radius:999px;border:1px solid var(--border);
  background:#fff;color:#344054;font-weight:800;font-size:12px;
}
.pill.ok{background:#ecfdf3;border-color:#abefc6;color:#027a48}
.pill.open{background:#eff8ff;border-color:#b2ddff;color:#175cd3}
.pill.closed{background:#fff7ed;border-color:#fed7aa;color:#9a3412}

.split{
  display:grid;grid-template-columns:0.7fr 1.3fr;gap:14px;
}
@media (max-width:920px){.split{grid-template-columns:1fr}}

.footer{
  border-top:1px solid var(--border);
  padding:22px 0;color:var(--muted);
}
.footerLinks{display:flex;gap:14px;flex-wrap:wrap}
hr.sep{border:none;border-top:1px solid var(--border);margin:14px 0}
.notice{
  border:1px solid var(--border);
  background:#fff;
  border-left:4px solid var(--primary);
  padding:12px 12px;border-radius:14px;
}
.timer{
  font-variant-numeric: tabular-nums;
  font-size:32px;font-weight:900;
  letter-spacing:0.02em;
}
/* Seller dashboard header mobile fix */
.dashTitleRow{align-items:flex-start}
.dashTitleRight{
    display:flex;
    gap:10px;
    align-items:flex-start;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.dashPills{justify-content:flex-end}
.dashLogoutForm{margin:0}

/* Prevent long SACCO names from breaking layout */
.dashPills .pill{
    max-width: 220px;
    white-space: normal;
    word-break: break-word;
    text-align:center;
}
/* Table wrapper usability */
.tableWrap{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}
/* Responsive toggles */
.hideOnMobile{display:block}
.showOnMobile{display:none}

/* Mobile */
@media (max-width: 820px){
    .dashTitleRow{
        flex-direction:column;
        align-items:flex-start;
        gap:10px;
    }

    .dashTitleRight{
        width:100%;
        justify-content:flex-start;
    }

    .dashPills{
        width:100%;
        justify-content:flex-start;
    }

    .dashLogoutBtn{
        width:100%;
        justify-content:center;
    }

    .dashLogoutForm{
        width:100%;
    }
    .sectionTitle{
        flex-wrap: wrap;
        align-items: flex-start;
    }
    .sectionTitle h2{
        flex: 1 1 100%;
    }
    .sectionTitle > a,
    .sectionTitle > .btn,
    .sectionTitle .pills{
        flex: 1 1 auto;
    }
    .tableWrap{
        width:100%;
        overflow:auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }
    .tableWrap .table{
        min-width: 720px;
    }
    .bidsTitle{
        flex-direction: column;
        align-items: flex-start;
    }
    .bidsPills{
        width:100%;
        justify-content:flex-start;
    }
    .bidsPills .pill{
        max-width: 100%;
        white-space: normal;
        word-break: break-word;
    }
    .table .actions{
        white-space: normal;
    }
    .table .actions .btn{
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 420px){
    .dashPills .pill{max-width: 100%;}
}

@media (max-width: 640px){
    .hideOnMobile { display: none; }
    .showOnMobile { display: block; }

    .mobileCards { display: grid; gap: 12px; }

    .cardRow{
        background: var(--card);
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: 14px;
        box-shadow: 0 1px 2px rgba(16,24,40,0.06);
    }

    .cardRowTop{
        display: flex;
        gap: 12px;
        align-items: flex-start;
        justify-content: space-between;
    }

    .cardRowTitle{
        font-weight: 900;
        font-size: 16px;
        line-height: 1.2;
        margin-bottom: 4px;
    }
    .cardRowActions{
        margin-top:12px;
        display:flex;
        gap:10px;
        flex-wrap:wrap;
    }

    .cardRowActions .btn{
        width:100%;
        justify-content:center;
    }

    .dashPills .pill{max-width:100%}

    .cardRowMeta{
        margin-top: 10px;
        display: grid;
        gap: 10px;
    }

    .metaItem{
        border-top: 1px solid var(--border);
        padding-top: 10px;
    }

    .metaLabel{
        font-size: 12px;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #667085;
        margin-bottom: 4px;
        font-weight: 800;
    }

    .metaValue{
        font-weight: 700;
    }

    .cardRowTop .btn{
        padding: 10px 12px;
        border-radius: 12px;
        white-space: nowrap;
    }

    .mobileCards{display:grid;gap:12px}

    .metaGrid{
        margin-top:12px;
        border-top:1px solid var(--border);
        padding-top:10px;
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:10px;
    }

    .metaItem:last-child{
        grid-column:1 / -1;
    }
}
@media (max-width: 520px){
    .card form .btn{width:100%}
    .card form a.btn{margin-top:10px}
}
.h1-like-h2 {
    margin: 0 !important;
    display: block;
    font-size: 1.5em;
    margin-block-start: 0.83em;
    margin-block-end: 0.83em;
    margin-inline-start: 0;
    margin-inline-end: 0;
    font-weight: bold;
    unicode-bidi: isolate;
}
