/* Alexa Aviation — Identidade Visual v1.0 (Out/2026)
   Graphite + Gold. Raleway (títulos) + Open Sans (texto). */

:root {
  --gold: #BB9848;
  --gold-light: #E0C77B;
  --gold-deep: #917437;
  --gold-soft: #F6F0DF;
  --charcoal: #3E4044;
  --charcoal-2: #55585D;
  --charcoal-3: #2F3134;
  --offwhite: #F7F5F0;
  --offwhite-2: #EEEBE3;
  --white: #FFFFFF;
  --line: #E4E0D6;
  --muted: #6F7277;
  --ok: #3F7D58;
  --danger: #B3423A;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(62, 64, 68, .06), 0 2px 8px rgba(62, 64, 68, .05);
  --shadow-md: 0 4px 24px rgba(62, 64, 68, .10);
  --shadow-lg: 0 24px 64px rgba(30, 31, 33, .35);
  --font-title: 'Raleway', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Open Sans', 'Segoe UI', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--charcoal);
  background: var(--offwhite);
  min-height: 100vh;
  line-height: 1.5;
}

h1, h2, h3, h4 { font-family: var(--font-title); color: var(--charcoal); letter-spacing: .01em; }
h2 { font-weight: 600; font-size: 1.35rem; }
a { color: var(--gold-deep); }

/* ---------- Carregando ---------- */
.loading-screen {
  display: block; text-align: center; padding: 120px 20px;
  color: var(--muted); font-family: var(--font-title); font-size: 15px; letter-spacing: .08em; text-transform: uppercase;
}

/* ---------- Topo ---------- */
.container { display: none; width: 100%; max-width: none; margin: 0; padding: 0; }

.header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--charcoal);
  border-bottom: 3px solid var(--gold);
  padding: 12px clamp(16px, 3vw, 40px);
  text-align: left; border-radius: 0; box-shadow: var(--shadow-md);
}
.header .brand { display: flex; align-items: center; gap: 18px; min-width: 0; }
.header .company-logo { height: 42px; width: auto; margin: 0; opacity: 1; }
.header h1 {
  font-size: 1rem; font-weight: 500; color: var(--gold-light); margin: 0;
  letter-spacing: .18em; text-transform: uppercase; white-space: nowrap;
  padding-left: 18px; border-left: 1px solid rgba(255, 255, 255, .22);
  background: none; -webkit-text-fill-color: currentColor;
}
.user-info { display: flex; align-items: center; gap: 14px; margin: 0; }
.user-name { color: #fff; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.user-name::before {
  content: "\f007"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 11px;
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(187, 152, 72, .22); color: var(--gold-light);
}
.header .btn-logout {
  background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .35);
  padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); transition: all .2s;
}
.header .btn-logout:hover { background: var(--gold); border-color: var(--gold); color: var(--charcoal); }

.page { width: 100%; max-width: 1480px; margin: 0 auto; padding: 24px clamp(12px, 3vw, 40px) 48px; }

/* ---------- Barra de ferramentas ---------- */
.toolbar {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 20px; box-shadow: var(--shadow-sm); backdrop-filter: none;
}
.toolbar-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.toolbar-row:last-child { margin-bottom: 0; }
#adminToolbar { padding-top: 12px; border-top: 1px dashed var(--line); }
#adminToolbar::before {
  content: "Administração"; font-family: var(--font-title); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--gold-deep); font-weight: 700; margin-right: 6px;
}
.toolbar-count { margin-left: auto; font-size: 13px; color: var(--muted); display: inline-flex; align-items: baseline; gap: 8px; }
.toolbar-count b { font-family: var(--font-title); font-size: 22px; font-weight: 700; color: var(--charcoal); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--charcoal) !important; color: #fff !important; border: 1px solid var(--charcoal);
  padding: 10px 18px; border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font-body); font-size: 13px; font-weight: 600; line-height: 1.2;
  transition: background .18s, color .18s, border-color .18s, transform .18s, box-shadow .18s;
}
.btn:hover { background: var(--gold) !important; color: var(--charcoal) !important; border-color: var(--gold); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(187, 152, 72, .35); }
.btn:active { transform: translateY(0); }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.toolbar-btn { padding: 8px 14px; font-size: 12.5px; white-space: nowrap; }
.toolbar-btn.is-primary { background: var(--gold) !important; color: var(--charcoal) !important; border-color: var(--gold); }
.toolbar-btn.is-primary:hover { background: var(--gold-light) !important; border-color: var(--gold-light); }
.toolbar-btn:not(.is-primary) { background: var(--white) !important; color: var(--charcoal) !important; border: 1px solid var(--line); }
.toolbar-btn:not(.is-primary):hover { background: var(--charcoal) !important; color: #fff !important; border-color: var(--charcoal); box-shadow: none; }

.btn-secondary, .btn-danger {
  border: 1px solid transparent; padding: 10px 18px; border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font-body); font-size: 13px; font-weight: 600; transition: all .18s;
}
.btn-secondary { background: var(--offwhite-2); color: var(--charcoal); border-color: var(--line); }
.btn-secondary:hover { background: var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }

/* ---------- Conteúdo principal ---------- */
.main-content {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 24px clamp(12px, 2vw, 28px); width: 100% !important; max-width: none !important; margin: 0; backdrop-filter: none;
}
.main-content > h2 {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 18px !important;
  font-size: 1.2rem; letter-spacing: .04em;
}
.main-content > h2::before, .main-content > h2::after { content: ""; flex: 0 0 36px; height: 2px; background: var(--gold); border-radius: 2px; }

/* ---------- Calendário ---------- */
.calendar { width: 100%; max-width: 100%; margin: 0; overflow-x: auto; border-radius: var(--radius-sm); }
.calendar > div { border-radius: var(--radius-sm); overflow: hidden; }
.calendar-header { background: var(--charcoal); color: #fff; padding: 10px; text-align: center; font-weight: 600; }
.calendar-cell { background: var(--offwhite); min-height: 80px; padding: 5px; border: 1px solid var(--line); cursor: pointer; transition: background .2s; }
.calendar-cell:hover { background: var(--gold-soft); }
.calendar-cell.hoje { background: var(--gold-soft); border: 2px solid var(--gold); }

/* ---------- Modais ---------- */
.modal { display: none; position: fixed; z-index: 1000; inset: 0; width: 100%; height: 100%; background: rgba(30, 31, 33, .62); backdrop-filter: blur(4px); }
.modal-content {
  background: var(--white); margin: 5vh auto; padding: 30px; border-radius: 18px;
  width: 92%; max-width: 620px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); border-top: 4px solid var(--gold);
  position: relative; max-height: 88vh; overflow-y: auto; backdrop-filter: none;
}
.modal-content h2 { margin-bottom: 16px; padding-right: 36px; }
.close {
  position: absolute; top: 14px; right: 16px; float: none; width: 32px; height: 32px; display: grid; place-items: center;
  color: var(--muted); font-size: 22px; font-weight: 400; line-height: 1; cursor: pointer; background: none; border: none; border-radius: 50%; transition: all .18s;
}
.close:hover { background: var(--offwhite-2); color: var(--charcoal); }

/* ---------- Formulários ---------- */
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 12.5px; color: var(--charcoal); letter-spacing: .01em; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #D5D1C6; border-radius: var(--radius-sm); font-size: 14px;
  font-family: var(--font-body); color: var(--charcoal); background: #fff; transition: border-color .18s, box-shadow .18s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(187, 152, 72, .22); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--gold-deep); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.btn-group { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 13px; display: none; }
.alert-error { background: #FBEDEB; color: #7D2B25; border: 1px solid #F0CBC7; }
.alert-success { background: #EAF4EE; color: #26543A; border: 1px solid #C7E0D1; }
.alert-info { background: var(--gold-soft); color: var(--gold-deep); border: 1px solid #E8DCB8; }

/* ---------- Itens de reserva / estatísticas ---------- */
.reserva-item { background: var(--offwhite); border-left: 3px solid var(--gold); padding: 6px 9px; margin: 3px 0; border-radius: 4px; font-size: 11px; cursor: pointer; }
.reserva-item:hover { background: var(--gold-soft); }
.stat-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); }
.stat-item:last-child { border-bottom: none; }
.stat-bar { width: 100px; height: 8px; background: var(--offwhite-2); border-radius: 4px; overflow: hidden; margin: 5px 0; }
.stat-fill { height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-light)); transition: width .3s ease; }
.stat-value { font-family: var(--font-title); font-weight: 700; color: var(--charcoal); min-width: 40px; text-align: right; }

.day-grid { display: grid; gap: 1px; background: var(--line); border-radius: 6px; overflow: hidden; }
.day-grid-cell { background: #fff; padding: 8px; min-height: 40px; font-size: 12px; position: relative; }
.day-grid-header { background: var(--charcoal); color: #fff; font-weight: 700; text-align: center; }
.day-grid-time { background: var(--offwhite); font-weight: 700; text-align: center; }
.day-grid-occupied { background: var(--gold-soft); border-left: 3px solid var(--gold); }
.day-grid-free { background: rgba(63, 125, 88, .08); }

/* tabelas dentro dos modais (usuários, logs...) */
.modal-content table { border-collapse: collapse; width: 100%; }
.modal-content th { font-family: var(--font-title); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-deep); }

/* ---------- Responsivo ---------- */
@media (max-width: 760px) {
  .header { padding: 10px 14px; }
  .header .company-logo { height: 32px; }
  .header h1 { display: none; }
  .user-name span, .user-name { font-size: 12px; }
  .toolbar-count { margin-left: 0; width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .modal-content { padding: 22px 18px; margin: 3vh auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Ajustes finos ---------- */
.btn { white-space: nowrap; }
#weekIndicator { font-family: var(--font-title); color: var(--gold-deep) !important; letter-spacing: .08em; text-transform: uppercase; font-size: 12.5px; }
#datePicker { border: 1px solid #D5D1C6 !important; border-radius: var(--radius-sm) !important; padding: 9px 10px !important; width: auto; }

/* ---------- Correções de largura (mobile) ---------- */
.container { grid-template-columns: minmax(0, 1fr); }
.page, .toolbar, .main-content { min-width: 0; }
.calendar > div { min-width: 760px; }
@media (max-width: 760px) {
  .main-content { padding: 18px 10px; }
  .main-content > h2::before, .main-content > h2::after { flex-basis: 20px; }
  .toolbar-btn { flex: 1 1 auto; justify-content: center; }
  .main-content > div[style*="display: flex"] { gap: 8px !important; }
  .main-content > div[style*="display: flex"] .btn { flex: 1 1 auto; }
  .user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- Quadro mais largo ---------- */
.page { max-width: 2200px; padding-left: clamp(10px, 1.6vw, 28px); padding-right: clamp(10px, 1.6vw, 28px); }
.main-content { padding-left: clamp(10px, 1.2vw, 22px); padding-right: clamp(10px, 1.2vw, 22px); }
.header { padding-left: clamp(14px, 1.6vw, 28px); padding-right: clamp(14px, 1.6vw, 28px); }
