/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body   { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
         font-size: 14px; background: #f4f6f9; color: #2d3748; }
a      { color: #1a56db; text-decoration: none; }
a:hover{ text-decoration: underline; }

/* ---- Navbar ---- */
.navbar { background: #1e3a5f; color: #fff; padding: 0 24px;
          display: flex; align-items: center; height: 52px; }
.navbar .brand { font-size: 16px; font-weight: 700; color: #fff; margin-right: 32px; }
.navbar ul { list-style: none; display: flex; gap: 20px; }
.navbar ul li a { color: #cbd5e0; font-size: 13px; }
.navbar ul li a:hover { color: #fff; text-decoration: none; }
.btn-logout { background: #e53e3e; color: #fff !important;
              padding: 4px 12px; border-radius: 4px; }

/* ---- Container ---- */
.container { max-width: 1280px; margin: 0 auto; padding: 24px 16px; }
h1 { font-size: 22px; font-weight: 700; margin-bottom: 20px; color: #1e3a5f; }
h2 { font-size: 16px; font-weight: 600; margin: 24px 0 10px; }

/* ---- Cards / grid ---- */
.stats-grid { display: grid;
              grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
              gap: 16px; margin-bottom: 28px; }
.stat-card  { background: #fff; border-radius: 8px; padding: 18px 20px;
              box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.stat-card .label { font-size: 12px; color: #718096; text-transform: uppercase;
                    letter-spacing: .5px; }
.stat-card .value { font-size: 28px; font-weight: 700; margin-top: 4px; }
.stat-card.open   .value { color: #1a56db; }
.stat-card.closed .value { color: #057a55; }
.stat-card.expiry .value { color: #d97706; }
.stat-card.total  .value { color: #2d3748; }

/* ---- Tables ---- */
.table-wrap { background: #fff; border-radius: 8px;
              box-shadow: 0 1px 4px rgba(0,0,0,.08);
              overflow-x: auto; margin-bottom: 28px; }
table  { width: 100%; border-collapse: collapse; }
thead th { background: #1e3a5f; color: #fff; padding: 10px 14px;
           text-align: left; font-size: 12px; font-weight: 600;
           letter-spacing: .4px; white-space: nowrap; }
tbody td { padding: 9px 14px; border-bottom: 1px solid #edf2f7;
           white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td     { background: #ebf4ff; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 12px;
         font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-open      { background: #dbeafe; color: #1e40af; }
.badge-closed    { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-pending   { background: #fef3c7; color: #92400e; }
.badge-paid      { background: #d1fae5; color: #065f46; }
.badge-other     { background: #f3f4f6; color: #374151; }

/* ---- Expiry warning ---- */
.expiry-warn { color: #d97706; font-weight: 600; }
.expiry-crit { color: #e53e3e; font-weight: 700; }

/* ---- Forms / auth ---- */
.login-wrap { max-width: 380px; margin: 80px auto; background: #fff;
              border-radius: 10px; padding: 36px 32px;
              box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.login-wrap h1 { font-size: 20px; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label  { display: block; font-size: 12px; font-weight: 600;
                     color: #4a5568; margin-bottom: 6px; }
.form-group input  { width: 100%; padding: 9px 12px; border: 1px solid #cbd5e0;
                     border-radius: 6px; font-size: 14px; }
.form-group input:focus { outline: none; border-color: #1a56db;
                          box-shadow: 0 0 0 3px rgba(26,86,219,.15); }
.btn-primary { width: 100%; padding: 10px; background: #1a56db; color: #fff;
               border: none; border-radius: 6px; font-size: 14px; font-weight: 600;
               cursor: pointer; }
.btn-primary:hover { background: #1e40af; }
.alert-error { background: #fee2e2; color: #991b1b; padding: 10px 14px;
               border-radius: 6px; margin-bottom: 16px; font-size: 13px; }

/* ---- Pagination / misc ---- */
.footer { text-align: center; padding: 24px; color: #a0aec0; font-size: 12px; }
.search-bar { margin-bottom: 16px; }
.search-bar input { padding: 8px 12px; border: 1px solid #cbd5e0;
                    border-radius: 6px; width: 280px; font-size: 13px; }
.pagination { display: flex; gap: 6px; margin-top: 12px; }
.pagination a, .pagination span { padding: 5px 11px; border: 1px solid #cbd5e0;
    border-radius: 4px; font-size: 13px; }
.pagination .active { background: #1a56db; color: #fff; border-color: #1a56db; }
