/* =========================================================
   GSE Library Management System — shared styles
   ========================================================= */
:root {
  --navy: #0b3d91;
  --navy-dark: #072a66;
  --blue: #1a5fd0;
  --saffron: #f39c12;
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --input: #cfd8e6;
  --green: #15803d;
  --red: #dc2626;
  --orange: #c2410c;
  --purple: #7c3aed;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(11, 61, 145, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Poppins", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
}
#shell:not([hidden]), body.opac, body.gate { display: flex; flex-direction: column; min-height: 100vh; }
[hidden] { display: none !important; }
a { color: var(--blue); }
code { background: #eef2f8; padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }

.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.text-red { color: var(--red); font-weight: 600; }
.grow { flex: 1; }
.wrap { white-space: normal; max-width: 260px; }
.only-print { display: none; }

/* ===== Buttons ===== */
.btn {
  font: inherit; font-size: 0.88rem; font-weight: 500;
  padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--input); background: #fff; color: var(--text);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.15s, transform 0.08s; white-space: nowrap;
}
.btn:hover { background: #f1f5fd; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.primary:hover { background: var(--navy-dark); }
.btn.success { background: var(--green); color: #fff; border-color: var(--green); }
.btn.warn { background: var(--saffron); color: #1f2937; border-color: var(--saffron); }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,0.5); color: inherit; }
.card .btn.ghost, .gate-side .btn.ghost { border-color: var(--input); color: var(--navy); }
.btn.light { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.35); }
.btn.light:hover { background: rgba(255,255,255,0.28); }
.btn.sm { padding: 5px 10px; font-size: 0.78rem; }
.btn.block { width: 100%; justify-content: center; padding: 12px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0 6px; }
.btn-row.top { margin: 0 0 16px; }
.btn-row.end { justify-content: flex-end; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ===== Login ===== */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(circle at 20% 20%, #1a5fd0 0, transparent 45%), linear-gradient(135deg, var(--navy-dark), var(--navy));
}
.login-card {
  background: #fff; width: 100%; max-width: 400px; border-radius: 16px; padding: 30px 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3); border-top: 5px solid var(--saffron);
  display: flex; flex-direction: column; gap: 12px; text-align: center;
}
.login-logo { width: 110px; height: auto; margin: 0 auto; }
.login-card h1 { font-family: "Merriweather", serif; color: var(--navy); font-size: 1.3rem; }
.login-card h2 { font-size: 0.95rem; color: var(--text); margin: 4px 0 6px; }
.login-card label { text-align: left; }
.login-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.85rem; margin-top: 4px; }
.login-links a { text-decoration: none; font-weight: 500; }
.dev-card {
  display: flex; align-items: center; gap: 14px; text-align: left; margin-top: 6px; padding: 12px;
  border-top: 1px solid var(--border); background: var(--bg); border-radius: 10px;
}
.dev-card img { width: 72px; height: 86px; object-fit: cover; object-position: top; border-radius: 8px; border: 2px solid var(--saffron); flex-shrink: 0; }
.dev-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 0.78rem; }
.dev-info small { color: var(--muted); font-size: 0.7rem; }
.dev-info b { color: var(--navy); font-size: 0.95rem; }
.dev-role { color: var(--orange); font-weight: 600; }
.dev-info a { text-decoration: none; color: var(--text); overflow-wrap: anywhere; }

/* ===== Header ===== */
.topbar {
  background: linear-gradient(90deg, var(--navy-dark), var(--navy) 60%, var(--blue));
  color: #fff; padding: 12px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 4px solid var(--saffron);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand h1 { font-family: "Merriweather", serif; font-size: 1.35rem; letter-spacing: 0.3px; }
.brand p { font-size: 0.8rem; opacity: 0.88; }
.logo {
  width: 58px; height: 58px; flex-shrink: 0; background: #fff; border-radius: 50%;
  border: 3px solid var(--saffron); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.logo img { width: 92%; height: 92%; object-fit: contain; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.clock { font-size: 0.82rem; background: rgba(255,255,255,0.12); padding: 6px 12px; border-radius: 20px; white-space: nowrap; }
.clock.big { font-size: 1rem; font-weight: 600; }
.user-chip { font-size: 0.82rem; background: var(--saffron); color: #1f2937; padding: 6px 12px; border-radius: 20px; font-weight: 600; white-space: nowrap; }

/* ===== Main software: header + menu bar + status bar ===== */
.app-top { position: sticky; top: 0; z-index: 50; }
.appbar {
  --bar: #0b1733;
  background: var(--bar); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 28px;
}
.brand-card {
  display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 6px;
  padding: 8px 20px 8px 12px; text-decoration: none; min-width: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.brand-card img { width: 58px; height: 58px; object-fit: contain; flex-shrink: 0; }
.gse-badge {
  background: var(--navy); color: #fff; font-weight: 700; font-size: 1.3rem; letter-spacing: 1px;
  padding: 4px 12px; border-radius: 4px; flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b { color: #c2410c; font-size: 1.35rem; font-weight: 700; letter-spacing: 0.5px; line-height: 1.15; }
.brand-text small { color: #374151; font-size: 0.74rem; font-weight: 500; }
.motto {
  color: #facc15; font-weight: 600; font-size: 0.82rem; border: 1px solid rgba(255,255,255,0.22);
  border-radius: 20px; padding: 6px 16px; white-space: nowrap;
}
.menu-btn {
  display: none; background: transparent; border: 1px solid rgba(255,255,255,0.4); color: #fff;
  font-size: 1rem; font-weight: 600; border-radius: 8px; padding: 6px 12px; cursor: pointer; white-space: nowrap;
}

.menubar {
  background: #0b1733; border-top: 2px solid #1d4ed8; border-bottom: 2px solid #1d4ed8;
  display: flex; align-items: center; padding: 0 12px 0 28px; box-shadow: 0 3px 10px rgba(0,0,0,0.18);
}
.menubar ul { list-style: none; display: flex; flex: 1; justify-content: space-between; margin: 0; padding: 0; }
.menubar li { position: relative; }
.menubar .top {
  display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px;
  background: none; border: 1px solid transparent; color: #fff; font: inherit; font-weight: 600; font-size: 0.86rem;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.menubar .home-ic { font-size: 0.9rem; }
.chev { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 4px; }
.menubar .top:hover, .menubar li.open > .top { background: rgba(255,255,255,0.08); }
.menubar li.current > .top { color: #facc15; background: #1e2c4f; border-color: rgba(255,255,255,0.35); }
.menubar .top:focus-visible, .submenu a:focus-visible { outline: 2px solid #facc15; outline-offset: -2px; }
.submenu {
  display: none; position: absolute; left: 0; top: 100%; min-width: 250px; z-index: 70;
  background: #0b1733; border: 1px solid #1d4ed8; border-top: none; border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35); overflow: hidden;
}
.menubar li.open > .submenu { display: block; }
@media (hover: hover) and (min-width: 1241px) { .menubar li.has-sub:hover > .submenu { display: block; } }
.menubar li:nth-last-child(-n+3) > .submenu { left: auto; right: 0; }
.submenu a {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #fff; text-decoration: none;
  font-size: 0.86rem; border-bottom: 1px solid rgba(255,255,255,0.08); white-space: nowrap;
}
.submenu a:last-child { border-bottom: none; }
.submenu a span { width: 20px; text-align: center; }
.submenu a:hover { background: #1d4ed8; }
.submenu a.active { background: #1e2c4f; color: #facc15; }
.power {
  flex-shrink: 0; width: 34px; height: 34px; margin-left: 10px; border-radius: 50%; border: none; cursor: pointer;
  background: #ef4444; color: #fff; font-size: 1.1rem; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.power:hover { background: #dc2626; }

.statusbar {
  margin-top: auto; background: #0b1733; color: #fff; border-top: 3px solid #7c3aed;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 24px; font-size: 0.8rem; font-weight: 600;
}
.statusbar #clock { color: #facc15; }
.db-status { color: #4ade80; }
.db-status.off { color: #f87171; }

.content { flex: 1; padding: 22px 28px 40px; min-width: 0; width: 100%; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { color: var(--navy); font-size: 1.35rem; }
.hint { font-size: 0.8rem; color: var(--navy); background: #e8effc; padding: 4px 10px; border-radius: 20px; }
.hint:empty { display: none; }
.fade { opacity: 0; transform: translateY(6px); }
.fade.in { opacity: 1; transform: none; transition: opacity 0.25s, transform 0.25s; }

/* ===== Hero / dashboard ===== */
.hero {
  background: linear-gradient(120deg, var(--navy), var(--blue)); color: #fff; border-radius: var(--radius);
  padding: 24px 28px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.hero h2 { font-size: 1.45rem; margin-bottom: 4px; }
.hero p { font-style: italic; opacity: 0.9; max-width: 640px; }
.hero-logo { width: 110px; height: 110px; background: #fff; border-radius: 50%; padding: 6px; flex-shrink: 0; border: 3px solid var(--saffron); object-fit: contain; }
.marquee { display: flex; align-items: center; gap: 10px; background: #fff8ec; border-left: 4px solid var(--saffron); border-radius: 8px; padding: 9px 14px; margin-bottom: 16px; overflow: hidden; }
.marquee > div { overflow: hidden; flex: 1; }
.marquee p { white-space: nowrap; display: inline-block; padding-left: 100%; animation: scroll 28s linear infinite; font-size: 0.9rem; color: #7c4a03; font-weight: 500; }
@keyframes scroll { to { transform: translateX(-100%); } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stats.one { grid-template-columns: 1fr; }
.stat { background: var(--card); border-radius: var(--radius); padding: 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); border-left: 5px solid; }
.stat h3 { font-size: 1.55rem; line-height: 1; }
.stat p { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.stat-icon { font-size: 1.6rem; }
.stat.blue { border-color: var(--blue); } .stat.green { border-color: var(--green); }
.stat.orange { border-color: var(--orange); } .stat.purple { border-color: var(--purple); } .stat.red { border-color: var(--red); }

/* ===== Cards ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid-2 > .card { margin-bottom: 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; min-width: 0; }
.card.narrow { max-width: 720px; }
.card h3 { color: var(--navy); font-size: 1.02rem; margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.card-head .btn-row { margin: 0; }
.info p, .info li { color: #374151; line-height: 1.7; font-size: 0.9rem; }
.info p { margin-bottom: 8px; }
.info ul { padding-left: 20px; }
.note { background: #f5f8ff; border: 1px dashed #b9c9ea; border-radius: 8px; padding: 10px 14px; font-size: 0.86rem; line-height: 1.7; }

/* ===== Forms ===== */
input, select, textarea {
  font: inherit; font-size: 0.9rem; padding: 9px 11px; width: 100%;
  border: 1px solid var(--input); border-radius: 8px; background: #fff; color: var(--text);
}
input[readonly] { background: #f6f8fc; color: #374151; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: transparent; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--navy); }
input[type="file"] { width: auto; max-width: 100%; padding: 6px; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: 0.83rem; color: #374151; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.self-end { align-self: end; padding-bottom: 10px; }
.form-grid { display: grid; gap: 12px 14px; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.span2 { grid-column: span 2; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; }
.radios, .checks { display: flex; gap: 10px 22px; flex-wrap: wrap; margin-top: 14px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); background: #f8faff; padding: 14px; border-radius: 10px; border: 1px solid var(--border); }
.form { display: flex; flex-direction: column; gap: 12px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar input { min-width: 220px; flex: 1; }
.toolbar select { width: auto; }
.msg { margin-top: 12px; font-size: 0.86rem; padding: 8px 12px; border-radius: 8px; }
.msg:empty { display: none; }
.msg.ok { background: #dcfce7; color: var(--green); }
.msg.bad { background: #fee2e2; color: var(--red); }
.msg.info { background: #dbeafe; color: #1e40af; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th { text-align: left; background: #f1f5fd; color: var(--navy); font-weight: 600; padding: 10px 12px; white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: #fafcff; }
tr.click { cursor: pointer; }
tr.click:hover { background: #eef3fc; }
.empty { text-align: center; color: var(--muted); padding: 22px; }
.total { text-align: right; margin-top: 12px; color: var(--navy); }
.kv th { width: 38%; background: #f6f8fc; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.74rem; font-weight: 600; white-space: nowrap; }
.badge.ok { background: #dcfce7; color: var(--green); }
.badge.info { background: #dbeafe; color: #1e40af; }
.badge.bad { background: #fee2e2; color: var(--red); }
.badge.warn { background: #ffedd5; color: var(--orange); }
.badge.purple { background: #ede9fe; color: var(--purple); }
.badge.grey { background: #f1f5f9; color: #475569; }

/* ===== Circulation ===== */
.circ-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.circ-grid > .card { margin-bottom: 0; }
.member-top { display: flex; gap: 14px; margin-bottom: 12px; align-items: flex-start; }
.photo {
  width: 96px; height: 116px; flex-shrink: 0; border-radius: 10px; background: #e8effc; border: 2px dashed #b9c9ea;
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.photo.big { width: 130px; height: 150px; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo .ini { font-size: 2rem; font-weight: 700; color: var(--navy); }
.photo .ini.muted { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.with-photo { display: flex; gap: 20px; align-items: flex-start; }
.with-photo .form-grid { flex: 1; }
#c-cards th, #c-cards td { padding: 6px 10px; }

/* ===== Tabs ===== */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { font: inherit; font-size: 0.86rem; font-weight: 500; padding: 8px 16px; border-radius: 20px; border: 1px solid var(--input); background: #fff; cursor: pointer; color: var(--text); }
.tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.count-box { display: flex; align-items: center; gap: 16px; }
.count-box span { font-size: 2.6rem; font-weight: 700; color: var(--navy); }

/* ===== Barcodes ===== */
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.label { border: 1px dashed #b9c9ea; border-radius: 6px; padding: 6px; text-align: center; display: flex; flex-direction: column; align-items: center; break-inside: avoid; }
.label svg { max-width: 100%; height: auto; }
.label small { font-size: 0.68rem; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Notices / digital / help ===== */
.notices { display: flex; flex-direction: column; gap: 10px; }
.notice { display: flex; gap: 12px; align-items: flex-start; background: #fff8ec; border-left: 4px solid var(--saffron); padding: 12px 14px; border-radius: 8px; }
.notice p { flex: 1; line-height: 1.6; }
.notice small { display: block; color: var(--muted); font-size: 0.75rem; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.dl-grid.small { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.dl-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; border-top: 4px solid var(--navy); text-decoration: none; color: inherit; }
.dl-grid.small .dl-card { box-shadow: none; border: 1px solid var(--border); border-top: 4px solid var(--navy); padding: 14px; }
.dl-card h3 { margin: 0; font-size: 0.95rem; color: var(--navy); }
.dl-card p { font-size: 0.83rem; color: var(--muted); flex: 1; }
.dl-icon { font-size: 1.6rem; }
.faq details { border-bottom: 1px solid var(--border); padding: 10px 2px; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--navy); font-size: 0.92rem; }
.faq p { margin-top: 8px; color: #374151; line-height: 1.7; font-size: 0.88rem; }
.about .photo { margin-bottom: 14px; }
.about .kv { margin-bottom: 10px; }

/* ===== Modal & toast ===== */
.modal { position: fixed; inset: 0; background: rgba(7, 26, 60, 0.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-box { background: #fff; border-radius: var(--radius); width: 100%; max-width: 520px; padding: 22px; max-height: 92vh; overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { color: var(--navy); }
.close { background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
.toast {
  position: fixed; bottom: 24px; right: 24px; max-width: min(420px, calc(100vw - 32px));
  background: var(--navy-dark); color: #fff; padding: 12px 18px; border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2); opacity: 0; transform: translateY(20px);
  transition: all 0.3s; pointer-events: none; z-index: 200; font-size: 0.9rem;
}
.toast.show { opacity: 1; transform: none; }
.toast.error { background: var(--red); }

.footer { text-align: center; padding: 14px; font-size: 0.78rem; color: #fff; background: var(--navy-dark); border-top: 3px solid var(--saffron); margin-top: auto; }

/* ===== OPAC ===== */
.opac-main, .gate-main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 22px 18px 40px; }
.search-big { display: flex; gap: 10px; }
.search-big input { font-size: 1.05rem; padding: 13px 16px; flex: 1; min-width: 0; }
.search-big .btn { padding: 0 22px; font-size: 1rem; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; }
.avail-pill { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
.avail-pill.avail { background: #dcfce7; color: var(--green); }
.avail-pill.loan { background: #dbeafe; color: #1e40af; }
.avail-pill.ref { background: #ede9fe; color: var(--purple); }
.avail-pill.na { background: #f1f5f9; color: #475569; }
.detail-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 16px; }
.detail-head h2 { color: var(--navy); font-size: 1.3rem; }
.book-cover { width: 90px; height: 120px; border-radius: 8px; background: linear-gradient(135deg, var(--navy), var(--blue)); display: flex; align-items: center; justify-content: center; font-size: 2.4rem; flex-shrink: 0; }

/* ===== Gate ===== */
.gate-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 18px; }
.gate-grid > .card { margin: 0; }
.gate-scan h2 { color: var(--navy); margin-bottom: 4px; }
.gate-scan .search-big { margin: 16px 0; }
.gate-side { display: flex; flex-direction: column; gap: 12px; }
.gate-side .stats { margin: 0; }
.gate-result { display: flex; gap: 18px; align-items: center; border-radius: 12px; padding: 0; min-height: 0; }
.gate-result.ok, .gate-result.bad, .gate-result.info { padding: 18px; }
.gate-result.ok { background: #dcfce7; border: 2px solid #86efac; }
.gate-result.info { background: #dbeafe; border: 2px solid #93c5fd; }
.gate-result.bad { background: #fee2e2; border: 2px solid #fca5a5; }
.gate-msg h2 { font-size: 1.4rem; color: var(--navy); }
.gate-result.ok .gate-msg h2 { color: var(--green); }
.gate-result.bad .gate-msg h2 { color: var(--red); }
.gate-msg h3 { font-size: 1.15rem; margin: 4px 0; }
.gate-msg p { font-size: 0.9rem; }

/* ===== Print ===== */
.print-head { display: flex; align-items: center; gap: 14px; border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 14px; }
.print-head img { width: 60px; height: 60px; object-fit: contain; }
.print-head h2 { font-size: 1.1rem; }
#printArea:not(.card) { display: none; }
@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { display: block !important; position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; padding: 0; }
  .only-print { display: flex; }
  .no-print { display: none; }
  .label { border-color: #999; }
  th { background: #eee !important; }
}

/* ===== Responsive ===== */
@media (max-width: 1400px) {
  .menubar { padding: 0 8px; }
  .menubar .top { padding: 0 6px; gap: 4px; font-size: 0.76rem; }
  .power { margin-left: 4px; }
}
@media (max-width: 1100px) {
  .form-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .circ-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1240px) {
  /* menu bar collapses into a drop-down list */
  .appbar { padding: 10px 16px; }
  .motto { display: none; }
  .menu-btn { display: block; }
  .menubar { display: none; padding: 8px 16px 12px; flex-direction: column; align-items: stretch; max-height: calc(100vh - 96px); overflow-y: auto; }
  .menubar.open { display: flex; }
  .menubar ul { flex-direction: column; }
  .menubar .top { width: 100%; justify-content: space-between; height: 44px; }
  .menubar a.top { justify-content: flex-start; }
  .submenu { position: static; min-width: 0; border: none; box-shadow: none; border-radius: 0; background: #12204a; }
  .submenu a { padding-left: 30px; }
  .power { width: auto; height: 40px; margin: 8px 0 0; border-radius: 8px; font-size: 0.9rem; padding: 0 16px; }
  .power::after { content: " Logout"; font-weight: 600; margin-left: 6px; }
}
@media (max-width: 900px) {
  .grid-2, .gate-grid { grid-template-columns: 1fr; }
  .form-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .clock:not(.big), .user-chip { display: none; }
  .hero-logo { display: none; }
  .with-photo { flex-direction: column-reverse; }
}
@media (max-width: 600px) {
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
  .topbar-right { margin-left: auto; }
  .topbar-right .btn { white-space: nowrap; }
  .brand h1 { font-size: 1rem; }
  .brand p { font-size: 0.68rem; }
  .logo { width: 44px; height: 44px; border-width: 2px; }
  .content { padding: 16px; }
  .brand-card { padding: 6px 10px; gap: 8px; }
  .brand-card img { width: 38px; height: 38px; }
  .gse-badge { display: none; }
  .brand-text b { font-size: 0.95rem; }
  .brand-text small { font-size: 0.62rem; }
  .statusbar { justify-content: center; text-align: center; padding: 8px 16px; font-size: 0.72rem; }
  .form-grid.cols-2, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .hero { padding: 18px; }
  .hero h2 { font-size: 1.2rem; }
  .search-big { flex-direction: column; }
  .search-big .btn { padding: 12px; justify-content: center; }
  .gate-result { flex-direction: column; text-align: center; }
  .member-top { flex-direction: column; }
  .toolbar select { width: 100%; }
  .clock.big { display: none; }
}
