/* ============================================================
   Dillan (MilWeb) - by nyuc team
   Cream page, white rounded card, Arial text, Lucida Console ids
   ============================================================ */

* { box-sizing: border-box; }

:root {
  --cream: #f4f2dc;
  --blue: #1d4ed8;
  --blue-dark: #1b1ec4;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --radius: 14px;
}

body {
  margin: 0;
  background: var(--cream);
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  font-size: 14px;
  padding: 26px 16px 60px;
}

.mono, .login-code, .case-num { font-family: "Lucida Console", Monaco, monospace; }

/* ---------------- LOGIN (kept as before, just softened) ---------------- */
.login-wrap { min-height: 90vh; display: flex; align-items: center; justify-content: center; }
.login-box {
  background: #fff; border-radius: var(--radius); width: 380px; max-width: 100%;
  padding: 34px 30px; text-align: center; box-shadow: 0 4px 22px rgba(0,0,0,0.08);
}
.login-logo { width: 74px; height: 74px; object-fit: contain; }
.logo-text-fallback {
  width: 74px; height: 74px; margin: 0 auto; border-radius: 12px;
  background: linear-gradient(135deg, var(--blue-dark), #2f7ff5);
  color: #fff; font-weight: bold; font-size: 21px; line-height: 74px;
}
.login-box h1 { font-size: 17px; letter-spacing: 2px; color: var(--blue-dark); margin: 16px 0 14px; }
.warn {
  background: #fef2f2; border-left: 4px solid #dc2626; color: #991b1b;
  font-size: 12px; padding: 11px 13px; text-align: left; margin-bottom: 16px; line-height: 1.5; border-radius: 0 8px 8px 0;
}
.login-label { font-size: 11px; color: var(--muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: 1px; }
.login-code {
  font-size: 30px; letter-spacing: 8px; background: #f9fafb; border: 1px solid var(--line);
  border-radius: 10px; padding: 14px; color: var(--blue); font-weight: bold;
}
.remember { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #444; margin: 16px 0; text-align: left; }
.tip { font-size: 12px; color: #1e3a8a; background: #eff6ff; padding: 9px 11px; border-radius: 8px; text-align: left; }
.login-status { font-size: 12px; color: var(--muted); margin-top: 14px; }

/* ---------------- APP SHELL ---------------- */
.sheet {
  background: #fff; border-radius: var(--radius); max-width: 950px; margin: 0 auto;
  padding: 30px 34px 34px; box-shadow: 0 4px 22px rgba(0,0,0,0.07);
}

.sheet-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.brand { display: flex; align-items: baseline; gap: 8px; cursor: pointer; }
.brand-logo { height: 26px; width: 26px; object-fit: contain; border-radius: 6px; }
.brand-name { font-size: 24px; font-weight: bold; letter-spacing: -0.5px; }
.brand-sub { font-size: 12px; color: var(--muted); font-weight: bold; }
.head-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.search-input {
  width: 210px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; font-family: Arial;
}
.search-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,78,216,0.12); }

/* nav */
.nav { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.nav a {
  padding: 7px 14px; font-size: 12px; border-radius: 8px; color: var(--muted);
  text-decoration: none; cursor: pointer; background: #f3f4f6; font-weight: bold;
}
.nav a:hover { background: #e5e7eb; color: var(--text); }
.nav a.on { background: var(--blue); color: #fff; }

/* buttons */
button.blue, button.black {
  background: var(--blue); color: #fff; border: none; padding: 9px 16px; border-radius: 8px;
  font-size: 13px; font-weight: bold; cursor: pointer; font-family: Arial;
}
button.blue:hover, button.black:hover { background: #1e40af; }
button.ghost {
  background: #fff; color: var(--text); border: 1px solid var(--line); padding: 8px 14px;
  border-radius: 8px; font-size: 13px; font-weight: bold; cursor: pointer; font-family: Arial;
}
button.ghost:hover { background: #f9fafb; }
button.danger { background: #dc2626; color: #fff; border: none; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: bold; cursor: pointer; }
button.danger:hover { background: #b91c1c; }

/* headings */
h2.page-title { font-size: 22px; margin: 0 0 4px; }
p.page-sub { font-size: 13px; color: var(--muted); margin: 0 0 20px; }
h3.sec { font-size: 17px; margin: 26px 0 10px; }

/* banners */
.banner {
  border-left: 4px solid #dc2626; background: #fef2f2; padding: 12px 16px;
  font-size: 12px; font-weight: bold; letter-spacing: 0.4px; text-transform: uppercase;
  color: #7f1d1d; margin-bottom: 20px; border-radius: 0 8px 8px 0;
}
.banner-qc { border-left-color: #d97706; background: #fffbeb; color: #92400e; }
.banner-info { border-left-color: var(--blue); background: #eff6ff; color: #1e3a8a; }
.banner a, .banner .lnk { color: var(--blue); text-decoration: none; }

/* profile */
.profile-top { display: flex; align-items: center; gap: 18px; margin-bottom: 6px; }
.pp { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: #f3f4f6; }
.pp-text {
  width: 76px; height: 76px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-dark), #2f7ff5);
  color: #fff; font-weight: bold; font-size: 26px; text-align: center; line-height: 76px;
}
.profile-name { font-size: 30px; font-weight: bold; margin: 0; letter-spacing: -0.5px; }
.confirmed { font-size: 13px; color: var(--text); margin: 6px 0 16px; }
.lnk { color: var(--blue); font-weight: bold; text-decoration: none; cursor: pointer; }
.lnk:hover { text-decoration: underline; }

.field { font-size: 14px; margin: 7px 0; }
.field b { font-weight: bold; }

.pill { display:inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: bold; }
.pill-green { background:#dcfce7; color:#166534; }
.pill-red { background:#fee2e2; color:#991b1b; }
.pill-yellow { background:#fef3c7; color:#92400e; }
.pill-grey { background:#f3f4f6; color:#374151; }
.pill-blue { background:#dbeafe; color:#1e40af; }

/* tables */
table.logs { width:100%; border-collapse:collapse; margin-top:10px; font-size:13px; }
table.logs th {
  text-align:left; padding:9px 12px; font-size:12px; color:var(--muted);
  border-bottom:1px solid var(--line); font-weight:bold;
}
table.logs td { padding:11px 12px; border-bottom:1px solid #f3f4f6; vertical-align:top; }
table.logs tr:last-child td { border-bottom:none; }
table.logs tr:hover td { background:#fafafa; }

/* forms */
input[type=text], textarea, select {
  width:100%; padding:9px 11px; border:1px solid var(--line); border-radius:8px;
  font-size:13px; font-family:Arial; margin-bottom:9px; background:#fff;
}
textarea { height:70px; resize:vertical; }
input:focus, textarea:focus, select:focus { outline:none; border-color:var(--blue); box-shadow:0 0 0 3px rgba(29,78,216,0.12); }
.row { display:flex; gap:10px; flex-wrap:wrap; }
.row > * { flex:1; min-width:170px; }
label.lab { display:block; font-size:11px; color:var(--muted); font-weight:bold; margin-bottom:3px; text-transform:uppercase; letter-spacing:0.5px; }

/* edit panel */
.edit-panel { background:#f9fafb; border:1px solid var(--line); border-radius:10px; padding:18px; margin-top:18px; }

/* home cards */
.cards { display:flex; gap:14px; flex-wrap:wrap; margin-top:14px; }
.card { border:1px solid var(--line); border-radius:12px; padding:20px; flex:1; min-width:200px; }
.card:hover { box-shadow:0 3px 14px rgba(0,0,0,0.06); }
.card-name { font-weight:bold; font-size:16px; margin:0 0 5px; }
.card-desc { font-size:12px; color:var(--muted); margin:0 0 15px; min-height:32px; }
.cal { background:#f9fafb; border-radius:10px; padding:15px 18px; margin-top:18px; }
.cal-title { font-weight:bold; margin:0 0 7px; font-size:13px; }
.cal ul { margin:0; padding-left:18px; font-size:13px; color:#444; line-height:1.9; }

/* lists */
.case-row {
  border:1px solid var(--line); border-radius:10px; padding:11px 14px; margin-bottom:7px;
  cursor:pointer; font-size:13px; display:flex; align-items:center; gap:12px;
}
.case-row:hover { background:#f9fafb; }
.case-num { font-weight:bold; color:var(--blue); }

.actions { margin-top:20px; padding-top:16px; border-top:1px solid var(--line); display:flex; flex-wrap:wrap; gap:8px; }
.small { font-size:12px; color:var(--muted); }
.msg-ok { color:#166534; font-weight:bold; font-size:13px; margin-top:10px; }
.msg-err { color:#991b1b; font-weight:bold; font-size:13px; margin-top:10px; }
.box { border:1px solid var(--line); border-radius:10px; padding:18px; margin-top:14px; }
.audit-row { border-bottom:1px solid #f3f4f6; padding:9px 4px; font-size:12px; }
.audit-hidden { background:#fef2f2; color:#991b1b; border-radius:6px; padding-left:8px; }
.footer { text-align:center; font-size:11px; color:var(--muted); margin-top:34px; }

@media (max-width:640px){
  body { padding:12px 8px 40px; }
  .sheet { padding:20px 18px; }
  .search-input { width:140px; }
  .profile-name { font-size:24px; }
  .cards { flex-direction:column; }
  table.logs { font-size:12px; }
  table.logs td, table.logs th { padding:8px 6px; }
}

/* ---- mobile: stop accidental text selection that ruins the touch UX ---- */
@media (hover: none) and (pointer: coarse) {
  body, .sheet, .nav, .banner, .profile-name, .field, table.logs,
  .case-row, .card, .pill, button, .lnk, .brand {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
  /* but keep inputs and code selectable so people can copy ids */
  input, textarea, select, .mono, .case-num {
    -webkit-user-select: text;
    user-select: text;
  }
  /* remove the blue tap highlight for a native app feel */
  a, button, .case-row, .card, .nav a { -webkit-tap-highlight-color: transparent; }
}
