:root {
  --teal-dark:    #134E4A;
  --teal:         #0F766E;
  --teal-mid:     #2D8577;
  --teal-light:   #F0FDFA;
  --teal-border:  #CCFBF1;
  --amber:        #F59E0B;
  --amber-light:  #FFFBEB;

  --bg:           #FFFFFF;
  --surface:      #FFFFFF;
  --border:       #E5E7EB;
  --border-light: #F3F4F6;

  --text-primary:   #1F2937;
  --text-secondary: #4B5563;
  --text-muted:     #9CA3AF;

  --success: #16A34A;
  --warning: #F59E0B;
  --danger:  #DC2626;
  --info:    #0F766E;

  --radius-sm: 10px;
  --radius:    16px;
  --shadow-sm: 0 2px 10px rgba(15,118,110,.06);
  --shadow:    0 8px 30px rgba(15,118,110,.1);
  --transition: all .2s ease;
  --font: 'Calibri', 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text-primary); background: var(--border-light); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ===== Layout geral (painéis) ===== */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 1.5rem 1rem; flex-shrink: 0;
}
.sidebar-logo { display: flex; align-items: center; gap: .6rem; padding: 0 .5rem 1.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-light); }
.sidebar-logo .mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--teal), var(--teal-dark)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 15px; }
.sidebar-logo .name { font-weight: 800; font-size: 15px; color: var(--teal-dark); }
.sidebar-logo .sub { font-size: 10.5px; color: var(--text-muted); }

.sidebar-label { font-size: 10.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; padding: .4rem .6rem; margin-top: .5rem; }
.nav-item {
  display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: .88rem; font-weight: 500; margin-bottom: .15rem; transition: var(--transition);
}
.nav-item i { width: 18px; text-align: center; color: var(--text-muted); }
.nav-item:hover { background: var(--teal-light); color: var(--teal-dark); }
.nav-item:hover i { color: var(--teal); }
.nav-item.active { background: var(--teal-light); color: var(--teal-dark); font-weight: 700; }
.nav-item.active i { color: var(--teal); }

.sidebar-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border-light); }
.sidebar-user { display: flex; align-items: center; gap: .6rem; padding: .5rem .3rem; }
.sidebar-user .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--teal-light); color: var(--teal-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.sidebar-user .info b { display: block; font-size: .82rem; color: var(--text-primary); }
.sidebar-user .info span { font-size: .72rem; color: var(--text-muted); text-transform: capitalize; }
.sidebar-logout { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; margin-top: .4rem; font-size: .82rem; color: var(--text-muted); border-radius: var(--radius-sm); cursor: pointer; }
.sidebar-logout:hover { background: #FEF2F2; color: var(--danger); }

.main { flex: 1; padding: 2rem 2.5rem; overflow-x: hidden; min-width: 0; }
.section { display: none; }
.section.active { display: block; }
.section-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.section-header h2 { font-size: 1.5rem; font-weight: 800; color: var(--teal-dark); }
.section-subtitle { color: var(--text-muted); font-size: .88rem; margin-top: .2rem; }

/* ===== Botões ===== */
.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex; align-items: center; gap: .5rem; border: none; cursor: pointer;
  padding: .65rem 1.2rem; border-radius: var(--radius-sm); font-size: .88rem; font-weight: 600; transition: var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-secondary { background: var(--teal-light); color: var(--teal-dark); border: 1px solid var(--teal-border); }
.btn-secondary:hover { background: var(--teal-border); }
.btn-danger { background: #FEF2F2; color: var(--danger); border: 1px solid #FECACA; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: .45rem .85rem; font-size: .8rem; }
.btn-xs { padding: .3rem .65rem; font-size: .75rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { padding: .5rem; }

/* ===== Cards / Cards KPI ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 1.25rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-light); }
.card-header h3 { font-size: .95rem; font-weight: 700; color: var(--teal-dark); display: flex; align-items: center; gap: .5rem; }
.card-body { padding: 1.25rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm); }
.kpi-card .icon { width: 38px; height: 38px; border-radius: 10px; background: var(--teal-light); color: var(--teal); display: flex; align-items: center; justify-content: center; margin-bottom: .7rem; }
.kpi-card .value { font-size: 1.5rem; font-weight: 800; color: var(--teal-dark); }
.kpi-card .label { font-size: .78rem; color: var(--text-muted); font-weight: 600; margin-top: .1rem; }

/* ===== Forms ===== */
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--text-secondary); margin-bottom: .35rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: .65rem .85rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .88rem; font-family: var(--font); color: var(--text-primary); transition: var(--transition); background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,118,110,.1); }
.form-hint { font-size: .76rem; color: var(--text-muted); margin-top: .3rem; }
.form-error { background: #FEF2F2; color: var(--danger); padding: .6rem .85rem; border-radius: var(--radius-sm); font-size: .82rem; margin-bottom: .8rem; }

/* ===== Tabelas ===== */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px; padding: .7rem 1rem; border-bottom: 1.5px solid var(--border); background: var(--teal-light); }
.data-table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border-light); font-size: .86rem; color: var(--text-primary); }
.data-table tr:last-child td { border-bottom: none; }

/* ===== Badges ===== */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem; border-radius: 99px; font-size: .72rem; font-weight: 700; }
.badge-ativo { background: #DCFCE7; color: #15803D; }
.badge-inativo { background: #F3F4F6; color: #6B7280; }
.badge-cancelado { background: #FEF2F2; color: var(--danger); }
.badge-confirmada { background: #DCFCE7; color: #15803D; }
.badge-livre { background: #DCFCE7; color: #15803D; }
.badge-ocupado { background: var(--amber-light); color: #B45309; }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(19,78,74,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem; }
.modal-box { background: #fff; border-radius: var(--radius); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--border-light); }
.modal-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--teal-dark); display: flex; align-items: center; gap: .5rem; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1.1rem; }
.modal-body { padding: 1.4rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: .7rem; padding: 1.1rem 1.4rem; border-top: 1px solid var(--border-light); }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 2.5rem 1.5rem; color: var(--text-muted); }
.empty-state i { font-size: 1.8rem; margin-bottom: .6rem; color: var(--teal-border); }
.empty-state p { font-size: .88rem; }

/* ===== Toast ===== */
.toast-container { position: fixed; top: 1.2rem; right: 1.2rem; z-index: 200; display: flex; flex-direction: column; gap: .6rem; }
.toast { background: #fff; border-left: 4px solid var(--teal); box-shadow: var(--shadow); border-radius: var(--radius-sm); padding: .8rem 1.1rem; font-size: .85rem; color: var(--text-primary); opacity: 0; transform: translateX(20px); transition: var(--transition); max-width: 340px; }
.toast.show { opacity: 1; transform: translateX(0); }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--teal); }

/* ===== Loading ===== */
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,.75); display: flex; align-items: center; justify-content: center; z-index: 300; }
.loading-overlay i { font-size: 2rem; color: var(--teal); }

/* ===== Login page ===== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--teal-dark); padding: 1.5rem; position: relative; overflow: hidden; }
.login-page::before { content:''; position: absolute; top: -120px; right: -120px; width: 420px; height: 420px; border-radius: 50%; background: var(--teal); opacity: .4; }
.login-page::after { content:''; position: absolute; bottom: -150px; left: -100px; width: 350px; height: 350px; border-radius: 50%; background: var(--amber); opacity: .12; }
.login-card { background: #fff; border-radius: 20px; padding: 2.5rem; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.25); position: relative; z-index: 1; }
.login-brand { text-align: center; margin-bottom: 1.8rem; }
.login-brand .mark { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, var(--teal), var(--teal-dark)); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 22px; margin: 0 auto .8rem; }
.login-brand h1 { font-size: 1.3rem; font-weight: 800; color: var(--teal-dark); }
.login-brand p { font-size: .82rem; color: var(--text-muted); margin-top: .2rem; }
.login-tabs { display: flex; background: var(--border-light); border-radius: var(--radius-sm); padding: .25rem; margin-bottom: 1.4rem; }
.login-tab { flex: 1; text-align: center; padding: .55rem; border-radius: 8px; font-size: .84rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: var(--transition); }
.login-tab.active { background: #fff; color: var(--teal-dark); box-shadow: var(--shadow-sm); }

@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 90; height: 100vh; transform: translateX(-100%); transition: var(--transition); }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 1.2rem; }
  .form-row { grid-template-columns: 1fr; }
  input, select, textarea { font-size: 16px !important; }
}
