/* =========================================================
   Yuanqi Special Transport - Event Management System
   Design: square elements, asymmetric layout, no purple.
   ========================================================= */

:root {
  --bg:        #e9eb0e; /* placeholder, overridden below */
  --bg:        #eceef1;
  --surface:   #ffffff;
  --surface-2: #f4f6f8;
  --ink:       #12161c;
  --muted:     #5c6571;
  --line:      #d2d6dc;
  --line-2:    #b9bfc7;
  --accent:    #0e6e6a;   /* teal - primary, definitely not purple */
  --accent-d:  #0a4f4c;
  --accent-2:  #c0491d;   /* rust - secondary */
  --ok:        #1b7a3d;
  --warn:      #b06b08;
  --bad:       #b3261e;
  --radius:    0;         /* square */
  --maxw:      1240px;
  --shadow:    0 1px 0 var(--line), 0 8px 24px -16px rgba(18,22,28,.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-d); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  font-weight: 800;
  letter-spacing: -.01em;
  text-transform: none;
}
h1 { font-size: 28px; }
h2 { font-size: 20px; }

/* ---------- Buttons (square) ---------- */
.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .02em;
  cursor: pointer;
  text-decoration: none;
  transition: transform .05s ease, background .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-d); border-color: var(--accent-d); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-danger { background: var(--bad); border-color: var(--bad); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-link { background: none; border: none; color: var(--accent-d); padding: 4px 6px; }

/* ---------- Forms (square) ---------- */
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
select.multi { height: auto; }
label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 6px;
}

/* ---------- Frontend header ---------- */
.site-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  background: var(--ink);
  color: #fff;
  border-bottom: 4px solid var(--accent);
}
.site-header .brand {
  display: flex;
  align-items: center;
  padding: 0 28px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .02em;
  color: #fff;
  border-right: 1px solid #2a313b;
}
.site-header .brand:hover { text-decoration: none; }
.main-nav {
  display: flex;
  align-items: stretch;
}
.main-nav a {
  display: flex;
  align-items: center;
  padding: 0 22px;
  color: #c9d0d8;
  font-weight: 600;
  font-size: 14px;
  border-left: 1px solid #2a313b;
}
.main-nav a:hover { background: #1b212a; color: #fff; text-decoration: none; }
.main-nav a.active { background: var(--accent); color: #fff; }
.main-nav a.nav-admin { color: #ffd9c2; }

/* ---------- Main / asymmetric layout ---------- */
.site-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 28px 64px;
}
.page-head {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 18px;
}
.page-head .lead { color: var(--muted); font-size: 15px; }
.page-head .head-tools { justify-self: end; }

/* Filter bar */
.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 16px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.filter-bar .field { margin: 0; }

/* Event grid (asymmetric) */
.event-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}
.event-card {
  grid-column: span 6;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform .08s ease, box-shadow .15s ease;
}
.event-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(18,22,28,.6); }
/* asymmetry: offset every 3rd card */
.event-card:nth-child(3n+2) { grid-column: 5 / span 6; margin-top: 26px; }
.event-card:nth-child(3n+3) { grid-column: 1 / span 7; }
.event-card .ec-body { padding: 18px 18px 20px; flex: 1; }
.event-card .ec-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  padding: 3px 8px;
  margin-bottom: 10px;
}
.event-card h3 { font-size: 19px; margin-bottom: 12px; }
.event-card .ec-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 13px; }
.event-card .ec-meta div { color: var(--muted); }
.event-card .ec-meta b { color: var(--ink); font-weight: 700; display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.event-card .ec-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2);
}
.event-card .ec-route { font-weight: 700; }

/* Detail page asymmetric */
.detail-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
  align-items: start;
}
.detail-main { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.detail-main .d-hero { border-top: 5px solid var(--accent); }
.detail-main .d-hero img { width: 100%; height: 320px; object-fit: cover; }
.detail-main .d-pad { padding: 24px; }
.detail-main .d-route-img { margin-top: 18px; border: 1px solid var(--line); }
.detail-main .d-route-img img { width: 100%; }

.info-table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.info-table th, .info-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
  font-size: 14px; vertical-align: top;
}
.info-table th { width: 200px; color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: .04em; }
.info-table tr:nth-child(even) td, .info-table tr:nth-child(even) th { background: var(--surface-2); }

.rich { line-height: 1.7; }
.rich ul { padding-left: 20px; }
.rich a { color: var(--accent-d); }

/* Sidebar panel */
.side-panel { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.side-panel .sp-head { background: var(--ink); color: #fff; padding: 12px 16px; font-weight: 800; letter-spacing: .03em; }
.side-panel .sp-body { padding: 16px; }
.slot-big { font-size: 40px; font-weight: 900; color: var(--accent-d); line-height: 1; }
.slot-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }

/* Booking form */
.booking-form { display: grid; gap: 14px; }
.booking-form .field { margin: 0; }

/* My bookings */
.booking-list { margin-top: 14px; }
.booking-item { border: 1px solid var(--line); padding: 12px 14px; margin-bottom: 10px; background: var(--surface-2); }
.status-pill { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border: 1px solid; }
.status-pending  { color: var(--warn); border-color: var(--warn); background: #fdf3e3; }
.status-approved { color: var(--ok);   border-color: var(--ok);   background: #e8f5ec; }
.status-rejected { color: var(--bad);  border-color: var(--bad);  background: #fbe9e8; }
.status-draft    { color: var(--muted);border-color: var(--line-2); background: #eef0f3; }
.status-published{ color: var(--accent-d); border-color: var(--accent); background: #e6f3f2; }

/* ---------- Flash ---------- */
.flash { padding: 12px 16px; border: 1px solid var(--line-2); margin-bottom: 18px; font-weight: 600; }
.flash-success { background: #e8f5ec; border-color: var(--ok); color: #14592c; }
.flash-error   { background: #fbe9e8; border-color: var(--bad); color: #7d1a15; }
.flash-info    { background: #e6f3f2; border-color: var(--accent); color: var(--accent-d); }

/* ---------- Footer (fixed copyright) ---------- */
.site-footer {
  background: var(--ink);
  color: #c9d0d8;
  border-top: 4px solid var(--accent-2);
  margin-top: 40px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 28px 18px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 20px;
}
.footer-brand { font-weight: 800; font-size: 18px; color: #fff; display: flex; flex-direction: column; }
.footer-sub { font-weight: 500; font-size: 12px; color: #8b95a1; letter-spacing: .04em; }
.footer-links a { display: block; color: #c9d0d8; margin-bottom: 6px; }
.footer-links a:hover { color: #fff; }
.footer-meta { font-size: 13px; color: #8b95a1; }
.footer-copy {
  border-top: 1px solid #2a313b;
  padding: 14px 28px;
  text-align: center;
  font-size: 12px;
  color: #8b95a1;
  letter-spacing: .02em;
}

/* =========================================================
   Admin console
   ========================================================= */
.admin-body { background: #dde1e6; }
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-side {
  background: var(--ink);
  color: #c9d0d8;
  display: flex;
  flex-direction: column;
  border-right: 4px solid var(--accent);
}
.admin-brand {
  padding: 22px 20px;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  border-bottom: 1px solid #2a313b;
  display: flex;
  flex-direction: column;
}
.admin-brand span { font-size: 11px; font-weight: 500; color: #8b95a1; letter-spacing: .08em; text-transform: uppercase; }
.admin-nav { padding: 14px 0; flex: 1; }
.admin-nav a {
  display: block;
  padding: 12px 20px;
  color: #c9d0d8;
  font-weight: 600;
  border-left: 4px solid transparent;
}
.admin-nav a:hover { background: #1b212a; color: #fff; text-decoration: none; }
.admin-nav a.active { background: var(--accent); color: #fff; border-left-color: var(--accent-2); }
.admin-side-foot { border-top: 1px solid #2a313b; padding: 12px 0; }
.admin-side-foot a { display: block; padding: 10px 20px; color: #8b95a1; font-size: 13px; }
.admin-side-foot a:hover { color: #fff; }

.admin-main { display: flex; flex-direction: column; }
.admin-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-topbar h1 { margin: 0; }
.admin-content { padding: 28px; }

/* Stat cards (asymmetric) */
.stat-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat-card:nth-child(1) { grid-column: span 4; }
.stat-card:nth-child(2) { grid-column: span 4; margin-top: 22px; }
.stat-card:nth-child(3) { grid-column: span 4; }
.stat-card:nth-child(4) { grid-column: 7 / span 6; }
.stat-card .num { font-size: 34px; font-weight: 900; color: var(--accent-d); }
.stat-card .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }

/* Admin table */
.table-wrap { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
table.data th { background: var(--surface-2); font-weight: 800; text-transform: uppercase; font-size: 11px; letter-spacing: .05em; color: var(--muted); }
table.data tr:hover td { background: var(--surface-2); }
table.data td.actions { white-space: nowrap; }
.thin { color: var(--muted); font-size: 12px; }

/* Panels / boxes */
.panel { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 22px; margin-bottom: 22px; }
.panel .panel-title { border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 18px; }

/* Event form builder */
.event-form { display: grid; gap: 22px; max-width: 980px; }
.form-block { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 20px 22px; }
.block-title { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; border-left: 4px solid var(--accent-2); padding-left: 10px; margin-bottom: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; margin-bottom: 4px; }
.field.full { grid-column: 1 / -1; }
.field .file-current { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.field .file-current img { width: 64px; height: 44px; object-fit: cover; border: 1px solid var(--line); }
.agree { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 14px 0; }
.agree input { width: auto; }
.form-actions { display: flex; gap: 12px; margin-top: 16px; }

/* Rich text editor */
.rte { border: 1px solid var(--line-2); }
.rte-toolbar { display: flex; gap: 4px; padding: 6px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.rte-toolbar button { width: 34px; height: 30px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 13px; }
.rte-toolbar button:hover { border-color: var(--accent); }
.rte-area { min-height: 140px; padding: 12px; background: #fff; font-size: 14px; line-height: 1.6; outline: none; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-aside { background: var(--ink); color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center; border-right: 5px solid var(--accent); }
.login-aside h1 { font-size: 34px; }
.login-aside p { color: #aeb6c0; max-width: 360px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.login-box { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 28px; }
.login-box .field { margin-bottom: 16px; }

/* Utilities */
.muted { color: var(--muted); }
.right { text-align: right; }
.mt { margin-top: 18px; }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-2); }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 28px; }
.pager a, .pager span { padding: 8px 14px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; }
.pager a:hover { border-color: var(--ink); text-decoration: none; }
.pager .current { background: var(--accent); color: #fff; border-color: var(--accent); }
.tags-inline { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Responsive (PC-first, graceful down) ---------- */
@media (max-width: 980px) {
  .page-head, .detail-grid, .filter-bar, .footer-inner { grid-template-columns: 1fr; }
  .event-card, .event-card:nth-child(3n+2), .event-card:nth-child(3n+3) { grid-column: 1 / -1; margin-top: 0; }
  .stat-card, .stat-card:nth-child(1), .stat-card:nth-child(2), .stat-card:nth-child(3), .stat-card:nth-child(4) { grid-column: 1 / -1; margin-top: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { flex-direction: row; flex-wrap: wrap; }
  .admin-nav { display: flex; flex-wrap: wrap; }
  .admin-nav a { border-left: none; border-bottom: 4px solid transparent; }
  .admin-side-foot { display: flex; }
}
@media (max-width: 560px) {
  .event-card .ec-meta { grid-template-columns: 1fr; }
  .site-header { flex-direction: column; }
  .main-nav { flex-wrap: wrap; }
}
