/* =========================================================
   AGBU Lebanon — Prototype Stylesheet
   Design tokens, base styles, layout, components, pages
   ========================================================= */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand palette: deep blue primary, burgundy accent, gold highlight */
  --color-primary:        #1a3a6c;   /* AGBU deep blue */
  --color-primary-dark:   #11264a;
  --color-primary-light:  #2c5499;
  --color-accent:         #8b1c2b;   /* burgundy */
  --color-accent-dark:    #6b1421;
  --color-gold:           #c9a14a;   /* warm gold */
  --color-gold-dark:      #a8852f;

  --color-bg:             #ffffff;
  --color-bg-alt:         #f5f6f8;
  --color-bg-soft:        #eef1f5;
  --color-border:         #dfe3ea;
  --color-text:           #1f2533;
  --color-text-soft:      #4a5468;
  --color-text-muted:     #6f7a8c;
  --color-success:        #1f7a4d;
  --color-warning:        #b06a00;
  --color-danger:         #a01f2c;

  --font-sans: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Georgia", "Times New Roman", serif;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow:    0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.12);

  --container: 1320px;
  --header-h:  72px;

  --transition: 180ms ease;
}

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent); }
h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--color-primary-dark); line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 3vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 2.2vw, 2rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1em; color: var(--color-text-soft); }

/* ---------- Layout ---------- */
/* Fluid: every page fills the user's screen (gutters scale with the viewport). */
.container { max-width: none; width: 100%; margin: 0 auto; padding: 0 clamp(16px, 2.5vw, 60px); }
/* Keep long body text readable even when the page is full-width. */
.page-hero .container > p, .hero .container > p.lead, .section .container > p { max-width: 80ch; }
.section   { padding: 64px 0; }
.section-alt { background: var(--color-bg-alt); }
.section-title { text-align: center; margin-bottom: 36px; }
.section-title h2 { margin-bottom: 8px; }
.section-title p  { max-width: 680px; margin: 0 auto; color: var(--color-text-muted); }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #ffffffee;
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-serif);
  color: var(--color-primary-dark);
}
.brand img { height: 40px; width: auto; display: block; }
.brand-text { line-height: 1.1; }
.brand-text .en { display: block; font-weight: 700; font-size: 1.05rem; }
.brand-text .hy { display: block; font-size: .8rem; color: var(--color-accent); }

.main-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 4px; align-items: center;
  flex-wrap: wrap;
}
.main-nav a {
  display: inline-block;
  padding: 8px 10px;
  font-size: .92rem;
  color: var(--color-text);
  border-radius: var(--radius-sm);
}
.main-nav a:hover,
.main-nav a.active {
  color: var(--color-primary);
  background: var(--color-bg-soft);
}
.main-nav .nav-cta {
  margin-left: 8px;
  background: var(--color-primary);
  color: #fff;
  padding: 8px 14px;
}
.main-nav .nav-cta:hover { background: var(--color-primary-dark); color: #fff; }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: ""; display: block;
  width: 22px; height: 2px; background: var(--color-primary);
  position: relative;
}
.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after  { position: absolute; top:  7px; }

@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    background: #fff; border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    display: none;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; padding: 10px 16px; gap: 0; }
  .main-nav li { width: 100%; }
  .main-nav a { display: block; padding: 12px 8px; border-bottom: 1px solid var(--color-bg-alt); }
  .main-nav .nav-cta { margin: 10px 0; text-align: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  text-align: center;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; }
.btn-accent  { background: var(--color-accent); color: #fff; }
.btn-accent:hover  { background: var(--color-accent-dark); color: #fff; }
.btn-gold    { background: var(--color-gold); color: #fff; }
.btn-gold:hover    { background: var(--color-gold-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-ghost   { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn-ghost:hover   { background: var(--color-bg-alt); }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-block { display: block; width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    linear-gradient(135deg, rgba(17, 38, 74, 0.92), rgba(44, 84, 153, 0.88)),
    radial-gradient(ellipse at top right, rgba(201, 161, 74, 0.35), transparent 60%);
  color: #fff;
  padding: 80px 0 90px;
}
.hero h1 { color: #fff; margin-bottom: 14px; }
.hero p.lead { color: #e7ecf5; font-size: 1.15rem; max-width: 720px; margin-bottom: 28px; }
.hero .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .hero-actions .btn-outline { color: #fff; border-color: #fff; }
.hero .hero-actions .btn-outline:hover { background: #fff; color: var(--color-primary); }

.page-hero {
  background: var(--color-primary);
  color: #fff;
  padding: 56px 0;
}
.page-hero h1 { color: #fff; margin-bottom: 6px; }
.page-hero p  { color: #d9e0ed; margin: 0; }

/* status badges (portal, bookings, leave, tasks, rentals) */
.badge { display:inline-block; padding:2px 9px; border-radius:999px; font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.03em; background:var(--color-bg-soft); color:var(--color-text-soft); }
.badge-pending,.badge-prio-medium { background:#fff3cd; color:#7a5c00; }
.badge-confirmed,.badge-approved,.badge-active { background:#d8f0e2; color:#1f7a4d; }
.badge-rejected,.badge-cancelled,.badge-expired,.badge-terminated,.badge-prio-high { background:#f6d6da; color:#a01f2c; }
.badge-prio-low { background:#e3e8f0; color:#4a5468; }

/* section tab bar (Properties / HR) */
.tabs { display:flex; gap:4px; border-bottom:2px solid var(--color-border); margin:0 0 20px; flex-wrap:wrap; }
.tabs a { padding:9px 18px; font-weight:600; color:var(--color-text-soft); border-bottom:3px solid transparent; margin-bottom:-2px; text-decoration:none; }
.tabs a:hover { color:var(--color-primary); }
.tabs a.active { color:var(--color-primary); border-bottom-color:var(--color-gold); }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card-icon {
  width: 44px; height: 44px;
  background: var(--color-bg-soft);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; margin-bottom: 12px;
}

.quick-card {
  display: block;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: left;
  color: var(--color-text);
  transition: all var(--transition);
}
.quick-card:hover {
  border-color: var(--color-primary);
  color: var(--color-text);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.quick-card .title { font-weight: 700; color: var(--color-primary-dark); display: block; margin-bottom: 4px; }
.quick-card .desc { color: var(--color-text-muted); font-size: .9rem; }

/* ---------- Event Cards ---------- */
.event-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.event-card .img {
  background: var(--color-bg-soft);
  aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center;
}
.event-card .body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.event-card h3   { margin: 0 0 6px; font-size: 1.1rem; }
.event-card .meta { color: var(--color-text-muted); font-size: .85rem; margin-bottom: 10px; }
.event-card .desc { color: var(--color-text-soft); font-size: .92rem; flex: 1; }
.event-card .actions { display: flex; gap: 8px; margin-top: 14px; }
.event-card .actions .btn { flex: 1; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--color-bg-soft);
  color: var(--color-primary);
}
.badge-accent  { background: #f9e7ea; color: var(--color-accent); }
.badge-gold    { background: #fbf2dc; color: var(--color-gold-dark); }
.badge-success { background: #e0f2e9; color: var(--color-success); }
.badge-muted   { background: var(--color-bg-alt); color: var(--color-text-muted); }

/* ---------- Filters ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 24px;
}
.filter-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  font-size: .85rem;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--color-primary); }
.filter-btn.is-active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; }
.field label {
  font-size: .85rem; font-weight: 600;
  color: var(--color-text); margin-bottom: 6px;
}
.field label .req { color: var(--color-accent); }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: #fff;
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 58, 108, 0.15);
}
.field .hint { font-size: .8rem; color: var(--color-text-muted); margin-top: 4px; }

.check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .9rem; color: var(--color-text-soft);
}
.check input { margin-top: 3px; }

.form-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.notice {
  padding: 14px 16px;
  border-left: 4px solid var(--color-gold);
  background: #fbf6e8;
  color: #6c5210;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  margin-bottom: 24px;
}
.notice-info    { border-left-color: var(--color-primary); background: #eef2f9; color: #1c3460; }
.notice-warning { border-left-color: var(--color-warning); background: #fdf3e3; color: #6a4205; }
.notice-danger  { border-left-color: var(--color-danger);  background: #fbe9eb; color: #6b1421; }
.notice-success { border-left-color: var(--color-success); background: #e6f3ec; color: #1f4f37; }

.success-message {
  background: #e6f3ec;
  border: 1px solid #b8dec8;
  color: #1f4f37;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-top: 16px;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data, .table {
  width: 100%; border-collapse: collapse;
  background: #fff; border: 1px solid var(--color-border);
  border-radius: var(--radius); overflow: hidden;
  font-size: .9rem;
}
table.data th, table.data td, .table th, .table td {
  text-align: left; padding: 11px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
table.data th, .table th {
  background: var(--color-bg-alt);
  color: var(--color-primary-dark);
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;            /* headers never bunch together */
}
table.data tr:last-child td, .table tr:last-child td { border-bottom: none; }
table.data tbody tr:hover, .table tbody tr:hover { background: var(--color-bg-soft); }

/* Sortable table headers */
.table th.th-sort { cursor: pointer; user-select: none; position: relative; padding-right: 24px; }
.table th.th-sort:hover { background: var(--color-bg-soft); }
.table th.th-sort::after { content: "\2195"; position: absolute; right: 9px; opacity: .35; font-size: .85em; }
.table th.sort-asc::after  { content: "\2191"; opacity: 1; }
.table th.sort-desc::after { content: "\2193"; opacity: 1; }

/* Print: hide chrome, show just the statement */
@media print {
  .site-header, .site-footer, .page-hero, .no-print, .nav-toggle { display: none !important; }
  body { background: #fff; }
  .section { padding: 0 !important; }
  .table { font-size: .85rem; }
}

/* ---------- Dashboard Stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat {
  background: #fff; border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm);
}
.stat .label { color: var(--color-text-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { color: var(--color-primary-dark); font-size: 2rem; font-weight: 700; font-family: var(--font-serif); margin-top: 6px; }
.stat .sub   { color: var(--color-text-muted); font-size: .82rem; margin-top: 2px; }

/* ---------- Seating Plan ---------- */
.seating-wrap { background: var(--color-bg-alt); padding: 28px; border-radius: var(--radius); }
.stage-bar {
  background: var(--color-primary-dark);
  color: #fff;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  letter-spacing: .15em;
  margin-bottom: 26px;
  font-size: .9rem;
}
.seat-row {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-bottom: 6px;
}
.seat-row .row-label {
  width: 26px; text-align: center;
  font-weight: 700; color: var(--color-text-muted);
  font-size: .85rem;
}
.seat {
  width: 30px; height: 30px;
  border-radius: 4px 4px 8px 8px;
  background: #d6dde8;
  border: 1px solid #b8c1d1;
  cursor: pointer;
  font-size: .7rem;
  display: flex; align-items: center; justify-content: center;
  color: #4a5468;
  transition: transform var(--transition), background var(--transition);
}
.seat:hover:not(.reserved) { transform: scale(1.08); }
.seat.vip       { background: #f9e7c2; border-color: var(--color-gold); color: #6c5210; }
.seat.reserved  { background: #c0c5d0; border-color: #a3aabb; color: #6b7384; cursor: not-allowed; opacity: .65; }
.seat.selected  { background: var(--color-accent); border-color: var(--color-accent-dark); color: #fff; }
.seat-legend {
  display: flex; gap: 16px; flex-wrap: wrap;
  margin-top: 18px; font-size: .85rem; color: var(--color-text-soft);
}
.seat-legend .swatch {
  display: inline-block; width: 16px; height: 16px;
  border-radius: 4px; margin-right: 6px; vertical-align: middle;
  border: 1px solid #b8c1d1;
}
.swatch.s-avail    { background: #d6dde8; }
.swatch.s-vip      { background: #f9e7c2; border-color: var(--color-gold); }
.swatch.s-reserved { background: #c0c5d0; }
.swatch.s-selected { background: var(--color-accent); border-color: var(--color-accent-dark); }

.seating-summary {
  background: #fff; border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 18px;
  margin-top: 22px;
}
.seating-summary h3 { margin-top: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary-dark);
  color: #d6dceb;
  padding: 56px 0 24px;
  margin-top: 64px;
}
.site-footer h4 { color: #fff; font-family: var(--font-sans); font-size: 1rem; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a  { color: #d6dceb; font-size: .9rem; }
.site-footer a:hover { color: var(--color-gold); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 30px;
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand { font-family: var(--font-serif); color: #fff; font-size: 1.2rem; margin-bottom: 8px; }
.footer-brand .hy { color: var(--color-gold); font-size: .95rem; display: block; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 36px; padding-top: 18px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: .82rem; color: #9aa4bd;
}

/* ---------- Auth / Login ---------- */
.auth-wrap {
  max-width: 420px;
  margin: 0 auto;
  background: #fff;
  padding: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-wrap h1 { font-size: 1.5rem; text-align: center; }

/* ---------- Misc ---------- */
.split {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center;
}
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.list-checks { list-style: none; padding: 0; margin: 0; }
.list-checks li { padding: 6px 0 6px 28px; position: relative; color: var(--color-text-soft); }
.list-checks li::before {
  content: "✓"; position: absolute; left: 0; top: 6px;
  color: var(--color-gold-dark); font-weight: 700;
}
.kicker {
  display: inline-block;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: 8px;
}
.muted { color: var(--color-text-muted); }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 14px; } .mt-3 { margin-top: 22px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 14px; }
.gap-2 { gap: 14px; } .flex { display: flex; } .flex-wrap { flex-wrap: wrap; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); margin-bottom: 22px; flex-wrap: wrap; }
.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 3px solid transparent;
  font-size: .92rem;
}
.tab-btn:hover { color: var(--color-primary); }
.tab-btn.is-active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* admin layout — FLUID: fills each user's screen automatically (gutters scale with viewport) */
.container.admin-shell { max-width: none; width: 100%; padding-left: clamp(16px, 2.5vw, 60px); padding-right: clamp(16px, 2.5vw, 60px); }
.admin-shell { display: grid; grid-template-columns: 230px 1fr; gap: 28px; }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } }
.admin-side {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  position: sticky; top: calc(var(--header-h) + 16px);
  align-self: start;
}
.admin-side h4 { margin: 8px 0; color: var(--color-primary-dark); font-family: var(--font-sans); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.admin-side a {
  display: block; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--color-text); font-size: .9rem;
}
.admin-side a:hover, .admin-side a.active { background: var(--color-bg-soft); color: var(--color-primary); }

/* Print-friendly subtle */
@media print {
  .site-header, .site-footer, .nav-toggle, .filter-bar, .form-actions { display: none !important; }
}
