@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* =============================================
   Novo Hotel — Design System
   CSS puro, sem dependências externas
   ============================================= */

/* ---- Variáveis ---- */
:root {
  --primary:        #1a56db;
  --primary-dark:   #1340a8;
  --primary-light:  #e8f0fe;
  --accent:         #f59e0b;
  --danger:         #ef4444;
  --danger-light:   #fef2f2;
  --success:        #10b981;
  --success-light:  #ecfdf5;
  --warning:        #f59e0b;
  --warning-light:  #fffbeb;
  --purple:         #8b5cf6;
  --purple-light:   #f3e8ff;
  --orange-light:   #ffedd5;

  --bg:             #f3f4f6;
  --bg-card:        #ffffff;
  --border:         #e5e7eb;
  --text:           #111827;
  --text-secondary: #6b7280;
  --text-muted:     #9ca3af;

  --sidebar-bg:     #111827;
  --sidebar-text:   #d1d5db;
  --sidebar-hover:  #1f2937;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow:     0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.14);

  --radius:    10px;
  --radius-sm:  6px;
  --radius-lg: 14px;

  --sidebar-w: 256px;
  --header-h:   64px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* =============================================
   LAYOUT
   ============================================= */
#app { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
#sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  transition: transform .2s ease;
}

/* Logo */
.sidebar-logo {
  padding: 16px 18px 16px 18px;
  border-bottom: 1px solid #1f2937;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
}
.sidebar-logo .logo-icon {
  width: 60px; height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo .logo-icon svg { width: 20px; height: 20px; color: #fff; }
.sidebar-logo .logo-text { color: #fff; font-weight: 700; font-size: .95rem; line-height: 1.2; }
.sidebar-logo .logo-text span { display: block; font-weight: 400; font-size: .72rem; color: #9ca3af; }

/* Nav */
#sidebar nav { flex: 1; padding: 10px 0; }
.nav-section {
  padding: 10px 18px 4px;
  font-size: .68rem;
  font-weight: 700;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: .07em;
}
#sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: var(--sidebar-text);
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
#sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .8; }
#sidebar nav a:hover { background: var(--sidebar-hover); color: #fff; }
#sidebar nav a.active { background: var(--primary); color: #fff; }
#sidebar nav a.active svg { opacity: 1; }

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid #1f2937;
}
.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .875rem;
  flex-shrink: 0;
}
.user-name { color: #fff; font-size: .825rem; font-weight: 600; }
.user-role { color: #6b7280; font-size: .7rem; }
.btn-logout {
  width: 100%; padding: 8px;
  background: transparent;
  border: 1px solid #374151;
  border-radius: var(--radius-sm);
  color: #9ca3af;
  font-size: .8rem;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-logout:hover { background: #374151; color: #fff; }
.btn-logout svg { width: 15px; height: 15px; }

/* ---- Main ---- */
#main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Topbar ---- */
#topbar {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar-title { font-weight: 700; font-size: 1.05rem; flex: 1; }
.topbar-hotel { font-size: .8rem; color: var(--text-secondary); }
.btn-menu-toggle {
  display: none;
  background: none; border: none;
  color: var(--text); padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-menu-toggle svg { width: 22px; height: 22px; }
.btn-menu-toggle:hover { background: var(--bg); }

/* ---- Page content ---- */
#page-content {
  flex: 1;
  padding: 28px 28px 48px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* =============================================
   COMPONENTS
   ============================================= */

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.card-title { font-weight: 700; font-size: .95rem; }
.card-body { padding: 20px; }

/* ---- Stats grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.blue   { background: #dbeafe; color: #1e40af; }
.stat-icon.green  { background: #d1fae5; color: #065f46; }
.stat-icon.yellow { background: #fef3c7; color: #92400e; }
.stat-icon.red    { background: #fee2e2; color: #991b1b; }
.stat-icon.purple { background: #ede9fe; color: #4c1d95; }
.stat-icon.gray   { background: #f3f4f6; color: #374151; }
.stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: .775rem; color: var(--text-secondary); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:not(:disabled):hover  { background: var(--primary-dark); }

.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:not(:disabled):hover   { background: #dc2626; }

.btn-success  { background: var(--success); color: #fff; }
.btn-success:not(:disabled):hover  { background: #059669; }

.btn-warning  { background: var(--warning); color: #1f2937; }
.btn-warning:not(:disabled):hover  { background: #d97706; color: #fff; }

.btn-outline  { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:not(:disabled):hover  { background: var(--bg); }

.btn-sm { padding: 5px 12px; font-size: .8rem; }

.btn-icon {
  padding: 6px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon svg { width: 15px; height: 15px; }

/* ---- Forms ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-full  { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-size: .775rem; font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.required { color: var(--danger); margin-left: 2px; }

.form-control {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  background: var(--bg-card);
  color: var(--text);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.form-control.error { border-color: var(--danger); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { appearance: auto; }

/* ---- Tables ---- */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: .73rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-secondary);
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:hover { background: #f9fafb; }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 11px 14px; font-size: .875rem; vertical-align: middle; }
.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 14px;
  font-size: .9rem;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #ede9fe; color: #4c1d95; }
.badge-gray   { background: #f3f4f6; color: #374151; }
.badge-orange { background: #ffedd5; color: #9a3412; }

/* ---- Modal ---- */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 600px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  animation: modalIn .18s ease;
}
.modal-lg { max-width: 800px; }
.modal-sm { max-width: 420px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h3 { font-weight: 700; font-size: 1rem; }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}

.btn-close {
  background: none; border: none;
  color: var(--text-secondary);
  padding: 4px; border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.btn-close:hover { color: var(--text); background: var(--bg); }
.btn-close svg { width: 20px; height: 20px; }

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-danger  { background: var(--danger-light);  color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: var(--primary-light); color: #1e40af; border: 1px solid #bfdbfe; }

/* ---- Toast ---- */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999; pointer-events: none;
}
.toast {
  background: #1f2937; color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: .875rem;
  display: flex; align-items: center; gap: 10px;
  pointer-events: all;
  animation: toastIn .2s ease;
  max-width: 360px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); color: #1f2937; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Page header ---- */
.page-header {
  margin-bottom: 24px;
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.page-header h1 { font-size: 1.4rem; font-weight: 800; }
.page-header p  { color: var(--text-secondary); font-size: .875rem; margin-top: 2px; }

/* ---- Utilities ---- */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.section-title {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.search-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px; align-items: center;
}
.search-bar .form-control { max-width: 320px; }

/* ---- Spinner ---- */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid #e5e7eb;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 56px;
  color: var(--text-muted); font-size: .9rem;
}

/* ---- Upload zone ---- */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone input[type=file] { display: none; }
.upload-zone .upload-icon { color: var(--text-muted); margin-bottom: 8px; }
.upload-zone .upload-icon svg { width: 36px; height: 36px; margin: 0 auto; }
.upload-zone p { font-size: .84rem; color: var(--text-secondary); }
.upload-zone strong { color: var(--primary); }
.upload-preview { margin-top: 10px; }
.upload-preview img {
  width: 80px; height: 80px; object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 0 auto;
}
.upload-preview .file-name { font-size: .78rem; color: var(--text-secondary); margin-top: 6px; }

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a56db 0%, #0f3d9e 100%);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  padding: 40px 36px;
  width: 100%; max-width: 400px;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon {
  width: 60px; height: 60px;
  background: var(--primary);
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; margin: 0 auto 12px;
}
.login-logo .logo-icon svg { width: 30px; height: 30px; }
.login-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.login-logo p  { color: var(--text-secondary); font-size: .875rem; margin-top: 4px; }

/* =============================================
   CHECK-IN ONLINE PAGE
   ============================================= */
.checkin-page { min-height: 100vh; background: #f3f4f6; }

.checkin-header {
  background: var(--primary);
  color: #fff;
  padding: 18px 24px;
  display: flex; align-items: center; gap: 14px;
}
.checkin-header .hotel-logo {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.checkin-header .hotel-logo svg { width: 24px; height: 24px; }
.checkin-header h1 { font-size: 1.1rem; font-weight: 700; }
.checkin-header p  { font-size: .8rem; opacity: .85; }

.checkin-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 16px 60px;
}

.checkin-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
}
.checkin-card-header {
  padding: 13px 20px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .9rem;
}
.checkin-card-header svg { width: 17px; height: 17px; color: var(--primary); }
.checkin-card-body { padding: 20px; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  #sidebar {
    transform: translateX(-256px);
    width: 256px;
  }
  #sidebar.open { transform: translateX(0); }
  #main { margin-left: 0; }
  .btn-menu-toggle { display: flex; }
  #page-content { padding: 16px 14px 36px; }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .page-header { flex-direction: column; align-items: flex-start; }
  .stats-grid  { grid-template-columns: 1fr 1fr; }
  .login-card  { padding: 28px 20px; }
  .modal { border-radius: var(--radius); }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; }
}
