/* ============================================================
   TPX Stylesheet | Township Procurement Exchange
   Compatible with XAMPP local dev + production
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin:0; padding:0; }
body { font-family: 'Segoe UI', Arial, sans-serif; font-size:15px; background:#f0f2f5; color:#222; }
a { text-decoration:none; color:#2E75B6; }
a:hover { text-decoration:underline; }
input,select,textarea { font-family:inherit; font-size:inherit; }

/* ---- HEADER ---- */
.tpx-header { color:#fff; box-shadow:0 2px 8px rgba(0,0,0,.25); position:sticky; top:0; z-index:100; }
.header-inner { max-width:1280px; margin:0 auto; padding:12px 20px; display:flex; align-items:center; gap:20px; }
.logo { display:flex; align-items:center; gap:8px; min-width:120px; }
.logo-text { font-size:22px; font-weight:800; letter-spacing:1px; }
.logo-tag { background:rgba(255,255,255,.22); border-radius:20px; font-size:11px; padding:2px 8px; font-weight:600; }
.main-nav { display:flex; gap:4px; flex:1; flex-wrap:wrap; }
.nav-link { color:rgba(255,255,255,.88); padding:6px 12px; border-radius:6px; font-size:13.5px; transition:.15s; }
.nav-link:hover { background:rgba(255,255,255,.18); text-decoration:none; color:#fff; }
.header-right { display:flex; align-items:center; gap:12px; margin-left:auto; }
.user-name { font-size:13px; opacity:.8; max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.notif-bell { position:relative; font-size:18px; color:#fff; line-height:1; }
.badge { position:absolute; top:-6px; right:-8px; background:#e53e3e; color:#fff; font-size:10px; font-weight:700;
         border-radius:999px; min-width:16px; height:16px; display:flex; align-items:center; justify-content:center; padding:0 3px; }

/* ---- PAGE WRAP ---- */
.page-wrap { max-width:1280px; margin:0 auto; padding:24px 20px; min-height:calc(100vh - 120px); }
.tpx-footer { text-align:center; padding:20px; font-size:13px; color:#888; border-top:1px solid #ddd; margin-top:40px; background:#fff; }

/* ---- ALERTS ---- */
.alert { padding:12px 18px; border-radius:8px; margin-bottom:16px; font-size:14px; }
.alert-info { background:#e8f4fd; border-left:4px solid #2E75B6; color:#1a4971; }
.alert-success { background:#e6f9ee; border-left:4px solid #27ae60; color:#155724; }
.alert-error, .alert-danger { background:#fdf0f0; border-left:4px solid #c0392b; color:#7b1717; }
.alert-warning { background:#fffbea; border-left:4px solid #f39c12; color:#6b4c00; }

/* ---- BUTTONS ---- */
.btn { display:inline-block; padding:9px 20px; border-radius:7px; font-size:14px; font-weight:600; cursor:pointer;
       border:2px solid transparent; transition:.15s; line-height:1.3; }
.btn-primary { background:#2E75B6; color:#fff; border-color:#2E75B6; }
.btn-primary:hover { background:#1a5c96; text-decoration:none; color:#fff; }
.btn-dark { background:#1F3864; color:#fff; border-color:#1F3864; }
.btn-dark:hover { background:#142848; text-decoration:none; color:#fff; }
.btn-success { background:#27ae60; color:#fff; border-color:#27ae60; }
.btn-success:hover { background:#1e8c4c; text-decoration:none; color:#fff; }
.btn-danger { background:#c0392b; color:#fff; border-color:#c0392b; }
.btn-outline { background:transparent; color:#fff; border-color:rgba(255,255,255,.6); }
.btn-outline:hover { background:rgba(255,255,255,.12); text-decoration:none; color:#fff; }
.btn-sm { padding:5px 12px; font-size:13px; }
.btn-block { display:block; width:100%; text-align:center; margin-top:12px; }

/* ---- CARDS ---- */
.card { background:#fff; border-radius:12px; box-shadow:0 1px 6px rgba(0,0,0,.09); padding:24px; margin-bottom:20px; }
.card-title { font-size:17px; font-weight:700; color:#1F3864; margin-bottom:16px; }
.card-muted { font-size:13px; color:#666; }

/* ---- STAT BOXES ---- */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:16px; margin-bottom:24px; }
.stat-box { background:#fff; border-radius:12px; padding:20px 18px; box-shadow:0 1px 6px rgba(0,0,0,.08); text-align:center; }
.stat-icon { font-size:28px; }
.stat-value { font-size:26px; font-weight:800; color:#1F3864; margin:6px 0 2px; }
.stat-label { font-size:13px; color:#777; }

/* ---- PRODUCT GRID ---- */
.products-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:20px; }
.product-card { background:#fff; border-radius:12px; padding:20px; box-shadow:0 1px 6px rgba(0,0,0,.09); display:flex; flex-direction:column; gap:8px; }
.product-badge { display:inline-block; background:#e8f0fe; color:#2E75B6; border-radius:20px; font-size:11px; font-weight:700; padding:3px 10px; width:fit-content; }
.product-name { font-size:16px; font-weight:700; color:#1F3864; }
.product-wholesaler { font-size:12px; color:#888; }
.product-price { font-size:20px; font-weight:800; color:#27ae60; display:flex; align-items:center; gap:8px; }
.per-unit { font-size:13px; font-weight:400; color:#999; }
.tier-badge { font-size:11px; font-weight:700; background:#1F3864; color:#fff; border-radius:20px; padding:3px 10px; }
.tier-badge.tier-0 { background:#f39c12; }
.progress-wrap { background:#e8eef4; border-radius:999px; height:8px; overflow:hidden; }
.progress-bar { background:linear-gradient(90deg,#2E75B6,#27ae60); height:100%; border-radius:999px; transition:.4s; }
.progress-label { font-size:12px; color:#666; }
.tier-table { background:#f7f9fc; border-radius:8px; padding:10px; }
.tier-row { display:flex; justify-content:space-between; font-size:13px; padding:4px 6px; border-radius:5px; }
.tier-row.active-tier { background:#e8f5e9; font-weight:700; color:#27ae60; }
.cutoff-row { font-size:12px; color:#888; }

/* ---- FORMS ---- */
.form-group { margin-bottom:18px; }
.form-group label { display:block; font-weight:600; margin-bottom:6px; color:#333; font-size:14px; }
.form-control { width:100%; padding:10px 13px; border:1.5px solid #ccd6e0; border-radius:7px; font-size:15px; background:#fff; transition:.15s; }
.form-control:focus { outline:none; border-color:#2E75B6; box-shadow:0 0 0 3px rgba(46,117,182,.12); }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.required::after { content:' *'; color:#c0392b; }
.form-hint { font-size:12px; color:#888; margin-top:4px; }
.tcs-row { display:flex; align-items:flex-start; gap:10px; padding:14px; background:#f7f9fc; border-radius:8px; }
.tcs-row input[type=checkbox] { width:18px; height:18px; flex-shrink:0; margin-top:2px; }

/* ---- TABLE ---- */
.tpx-table { width:100%; border-collapse:collapse; font-size:14px; }
.tpx-table th { background:#1F3864; color:#fff; padding:10px 14px; text-align:left; font-weight:600; }
.tpx-table td { padding:10px 14px; border-bottom:1px solid #edf0f5; }
.tpx-table tr:hover td { background:#f7f9fc; }
.tpx-table .amount { font-weight:700; }
.status-badge { font-size:11px; font-weight:700; border-radius:20px; padding:3px 10px; display:inline-block; }
.status-open { background:#e8f5e9; color:#27ae60; }
.status-failed { background:#fdf0f0; color:#c0392b; }
.status-closed, .status-settled { background:#e8f0fe; color:#2E75B6; }
.status-pending { background:#fffbea; color:#c87f00; }
.status-committed { background:#e8f5e9; color:#27ae60; }

/* ---- WALLET ---- */
.wallet-balance-card { background:linear-gradient(135deg,#1F3864,#2E75B6); color:#fff; border-radius:14px; padding:28px 24px; margin-bottom:20px; }
.wallet-balance-label { font-size:13px; opacity:.8; }
.wallet-balance-amount { font-size:38px; font-weight:800; margin:8px 0; }
.wallet-ledger-type { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; }

/* ---- NOTIFICATION ---- */
.notif-item { padding:14px 16px; border-bottom:1px solid #edf0f5; display:flex; gap:14px; }
.notif-item.unread { background:#f0f6ff; }
.notif-icon { font-size:22px; flex-shrink:0; }
.notif-title { font-weight:700; font-size:14px; }
.notif-msg { font-size:13px; color:#555; margin-top:2px; }
.notif-time { font-size:11px; color:#aaa; margin-top:4px; }

/* ---- LANDING PAGE ---- */
.landing-wrap { min-height:100vh; background:linear-gradient(135deg,#1F3864 0%,#2E75B6 60%,#66A8A6 100%); display:flex; flex-direction:column; align-items:center; justify-content:center; padding:40px 20px; }
.landing-logo { font-size:52px; font-weight:900; color:#fff; letter-spacing:2px; }
.landing-tag { font-size:18px; color:rgba(255,255,255,.85); font-style:italic; margin:8px 0 40px; text-align:center; }
.login-cards { display:flex; gap:24px; flex-wrap:wrap; justify-content:center; width:100%; max-width:820px; }
.login-card { background:#fff; border-radius:16px; padding:36px 32px; flex:1; min-width:240px; max-width:360px; box-shadow:0 8px 32px rgba(0,0,0,.18); }
.login-card-icon { font-size:40px; margin-bottom:12px; }
.login-card-title { font-size:20px; font-weight:800; color:#1F3864; margin-bottom:4px; }
.login-card-sub { font-size:13px; color:#888; margin-bottom:24px; }
.divider { text-align:center; color:#bbb; font-size:13px; margin:14px 0; position:relative; }
.divider::before, .divider::after { content:''; position:absolute; top:50%; width:38%; height:1px; background:#e0e0e0; }
.divider::before { left:0; } .divider::after { right:0; }

/* ---- CART ---- */
.cart-summary { background:#f7f9fc; border-radius:10px; padding:18px; }
.cart-total-row { display:flex; justify-content:space-between; font-size:17px; font-weight:700; color:#1F3864; padding-top:12px; border-top:2px solid #dde4ef; margin-top:12px; }
.cart-item-row { display:flex; justify-content:space-between; align-items:center; padding:10px 0; border-bottom:1px solid #edf0f5; font-size:14px; }

/* ---- MISC ---- */
.page-title { font-size:22px; font-weight:800; color:#1F3864; margin-bottom:4px; }
.page-sub { font-size:14px; color:#888; margin-bottom:24px; }
.empty-state { text-align:center; padding:60px 20px; color:#bbb; }
.empty-state .empty-icon { font-size:52px; margin-bottom:12px; }
.two-col { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
@media(max-width:680px){.form-row,.two-col{grid-template-columns:1fr;} .login-cards{flex-direction:column;} .header-inner{flex-wrap:wrap;}}
