/* Travel Agency Manager - styles */
:root {
  --bg: #f3f1ec; --panel: #ffffff; --ink: #1d2b2d; --muted: #6b7a7c; --line: #e2ddd3;
  --brand: #0f5c63; --brand-2: #0b474d; --accent: #f4b740;
  --ok: #1f8a5b; --ok-bg: #e3f4ea; --warn: #b4541c; --warn-bg: #fcebdc; --danger: #c0392b;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(15,92,99,.07);
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); }
h1, h2, h3 { margin: 0 0 .5rem; letter-spacing: -.01em; }
h3 { margin-top: 1.6rem; font-size: 15px; color: var(--brand-2); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Buttons */
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600; }
.btn:hover { border-color: var(--brand); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 4px 9px; font-size: 12px; margin: 2px; }
.btn-block { width: 100%; padding: 11px; margin-top: 8px; }

/* Forms */
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink); background: #fff; }
input:focus, select:focus { outline: 2px solid rgba(15,92,99,.25); border-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
label.pw { background: var(--warn-bg); padding: 10px; border-radius: 8px; color: var(--warn); }
.alert { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 8px; margin: 10px 0; font-weight: 600; }

/* Login */
.login-body { min-height: 100vh; background: linear-gradient(135deg, var(--brand-2), var(--brand) 60%, #1b7a6e); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--panel); width: 100%; max-width: 380px; padding: 32px; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); text-align: center; }
.login-card form { text-align: left; margin-top: 14px; }
.login-logo { width: 56px; height: 56px; }
.login-card h1 { font-size: 22px; margin-top: 10px; }
.login-card .clock { display: inline-block; margin-top: 6px; }

/* App shell */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background: var(--brand-2); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand img { width: 30px; height: 30px; }
.top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.top-right .btn-ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.clock { font-variant-numeric: tabular-nums; background: rgba(0,0,0,.08); padding: 4px 10px; border-radius: 6px; font-size: 13px; }
.topbar .clock { background: rgba(255,255,255,.12); }
.role-badge { font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 4px 10px; border-radius: 20px; }
.role-badge.sa { background: var(--accent); color: #3a2a00; }
.role-badge.ag { background: #d6efe9; color: var(--brand-2); }
.view-banner { background: var(--accent); color: #3a2a00; padding: 8px 20px; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.layout { display: flex; min-height: calc(100vh - 52px); }
.sidebar { width: 220px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--line); padding: 14px 10px; }
.sidebar a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; margin-bottom: 2px; }
.sidebar a:hover { background: var(--bg); }
.sidebar a.active { background: var(--brand); color: #fff; }
.content { flex: 1; padding: 24px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.loading, .empty { padding: 30px; text-align: center; color: var(--muted); background: var(--panel); border-radius: var(--radius); }
.search { max-width: 320px; margin-bottom: 10px; }
.total { margin-bottom: 8px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.card { background: var(--panel); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); border-left: 4px solid var(--brand); }
.card.ok { border-left-color: var(--ok); }
.card.warn { border-left-color: var(--warn); }
.card-l { font-size: 12px; color: var(--muted); font-weight: 600; }
.card-v { font-size: 22px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* Tables */
.table-wrap { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #faf8f4; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.actions { text-align: right; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #bbb; margin-right: 6px; }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }

/* Modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(10,30,32,.5); display: flex; align-items: flex-start; justify-content: center; padding: 50px 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--panel); width: 100%; max-width: 640px; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; color: var(--ink); }
.modal form > div:first-child { padding: 16px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.x { background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--muted); }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--ok); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 600; z-index: 60; box-shadow: var(--shadow); }
.toast.bad { background: var(--danger); }

@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .sidebar { width: auto; display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar a { white-space: nowrap; }
  .grid2 { grid-template-columns: 1fr; }
  .content { padding: 14px; }
}
