
/* ========== App Design Tokens ========== */
:root {
  --bg:#0f172a;         /* header bg */
  --fg:#ffffff;         /* header fg */
  --muted:#64748b;      /* muted text */

  --brand:#60a5fa;      /* primary */
  --brand-contrast:#001b3b;

  --card:#ffffff;       /* card bg */
  --border:#e5e7eb;     /* card/table border */
  --table-stripe:#f8fafc;

  --ok-bg:#e8fff0;   --ok-br:#7ac18d;     /* success */
  --err-bg:#ffecec;  --err-br:#e39999;    /* error */
  --warn-bg:#fff7ed; --warn-br:#f59e0b;   /* warning */
}

/* ========== Global/Reset-ish ========== */
* { box-sizing: border-box; }
html, body {
  margin:0; padding:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:#0f172a;
  background:#f8fafc;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display:block; }

/* Container & Headings */
.container { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { margin:12px 0; font-size:22px; }
h2 { margin:14px 0 8px; font-size:18px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align:right; }
.center { text-align:center; }
.pill {
  background:#e2e8f0; padding:4px 8px; border-radius:999px; font-size:12px; display:inline-block;
}

/* ========== Header / Navigation ========== */
.app-header { background:var(--bg); color:var(--fg); position:sticky; top:0; z-index:1000; }
.app-header .bar {
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:12px 16px;
}
.brand { font-weight:700; letter-spacing:.3px; display:flex; align-items:center; gap:10px; }
.brand .dot { width:10px; height:10px; border-radius:50%; background:var(--brand); display:inline-block; }

.nav { display:flex; gap:10px; flex-wrap:wrap; }
.nav a { padding:8px 12px; border-radius:6px; color:#e2e8f0; }
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a.active { background:var(--brand); color:var(--brand-contrast); font-weight:600; }
.nav-toggle {
  display:none; background:transparent; border:1px solid rgba(255,255,255,.4);
  color:#fff; padding:6px 10px; border-radius:6px; font-size:16px;
}
@media (max-width: 760px) {
  .nav-toggle { display:inline-flex; }
  .nav { display:none; flex-direction:column; padding:8px 16px; }
  .nav.open { display:flex; background:#0b1228; border-top:1px solid rgba(255,255,255,.1); }
}

/* ========== Cards / Sections ========== */
.card {
  background:var(--card); border:1px solid var(--border);
  border-radius:10px; padding:16px; box-shadow:0 1px 2px rgba(0,0,0,.03);
}

/* ========== Forms (Uploader / Filters / CRUD) ========== */
form.uploader { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin:12px 0; }
input[type="file"] { padding:8px; border:1px dashed #94a3b8; border-radius:8px; background:#f1f5f9; }

form.inline {
  display:grid;
  grid-template-columns: 2fr 1fr 2fr auto;
  gap:10px; align-items:end;
}
label { display:grid; gap:6px; font-size:14px; }
input[type="text"], input[type="date"], select, textarea {
  padding:8px; border:1px solid #cbd5e1; border-radius:8px; background:#fff;
}
button {
  padding:10px 14px; border:0; border-radius:8px;
  background:var(--brand); color:var(--brand-contrast);
  cursor:pointer; font-weight:600; height:40px;
}
button:hover { background:#74b2ff; }
button.danger { background:#ef4444; color:#fff; }
button.danger:hover { background:#dc2626; }

.toolbar { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

/* Filters grid (Daily report, Upload history) */
form.filters {
  display:grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap:12px; margin:10px 0 4px;
}
@media (max-width: 760px) {
  form.filters { grid-template-columns: 1fr 1fr; }
  form.inline  { grid-template-columns: 1fr; }
}

/* ========== Messages ========== */
.msg { padding:10px; border-radius:8px; margin:12px 0; }
.msg.ok   { background:var(--ok-bg);   border:1px solid var(--ok-br); }
.msg.err  { background:var(--err-bg);  border:1px solid var(--err-br); }
.msg.warn { background:var(--warn-bg); border:1px solid var(--warn-br); }

/* ========== Tables (Report, Preview, CRUD lists, History) ========== */
.table-wrap { overflow-x:auto; border:1px solid var(--border); border-radius:10px; background:#fff; }
table { border-collapse: collapse; width: 100%; min-width: 900px; }
th, td { border-bottom: 1px solid #eef2f7; padding:10px; font-size: 14px; text-align:left; }
th { background:var(--table-stripe); position: sticky; top: 0; z-index: 1; }
tbody tr:nth-child(even) { background: #fff; }
tbody tr:nth-child(odd)  { background: #fff; } /* unify; zebra optional */

/* Row actions (edit/delete buttons area) */
.row-actions { display:flex; gap:8px; flex-wrap:wrap; }

/* Pager */
.pager { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:10px; }

/* Utility spacing (optional) */
.mt-0{margin-top:0} .mt-1{margin-top:4px} .mt-2{margin-top:8px}
.mt-3{margin-top:12px} .mt-4{margin-top:16px} .mt-5{margin-top:20px}


/* --- Shared buttons (consistent across app) --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

/* primary (blue) */
.btn-primary {
  background: var(--brand, #60a5fa);
  color: var(--brand-contrast, #001b3b);
}
.btn-primary:hover { background: #74b2ff; }

/* secondary (gray) */
.btn-secondary {
  background: #e2e8f0;
  color: #111827;
}
.btn-secondary:hover { background: #cbd5e1; }

/* danger (red) */
.btn-danger {
  background: #ef4444;
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

/* outline style (subtle bordered) */
.btn-outline {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #111827;
}
.btn-outline:hover {
  background: #f8fafc;
}

/* small size variant (for table action buttons) */
.btn-sm { padding: 6px 10px; border-radius: 6px; font-size: 13px; }

/* icon helper (optional) */
.btn .icon { width: 16px; height: 16px; display: inline-block; }

/* Align action buttons in table rows */
.row-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}


.hidden {
  display: none !important;
}
