/* ============================================================
   Admin Dra. Luiza — paleta verde da marca
   ============================================================ */
:root {
  --primary: #358F80;
  --primary-dark: #1F7E74;
  --primary-deeper: #11514A;
  --primary-hover: #2A7368;
  --accent: #99E2B4;
  --mint: #D4F3E0;
  --cream: #F8F5EF;
  --bg: #F4F7F5;
  --surface: #FFFFFF;
  --text: #1F2A27;
  --text-soft: #5A6B65;
  --muted: #8FA39A;
  --border: #E1ECE7;
  --danger: #C84743;
  --warning: #D8A04D;
  --success: #2BAA7B;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(17,81,74,.06);
  --shadow:    0 6px 22px rgba(17,81,74,.10);
  --shadow-lg: 0 20px 50px rgba(17,81,74,.16);
  --t: .22s cubic-bezier(.4,0,.2,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-dark); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { letter-spacing: -.01em; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-body {
  background: linear-gradient(135deg, var(--mint), var(--cream));
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.login {
  width: 100%; max-width: 420px; padding: 24px;
}
.login__card {
  background: #fff;
  padding: 40px 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login__logo { height: 56px; width: auto; margin: 0 auto 20px; display: block; }
.login h1 { font-size: 22px; font-weight: 600; color: var(--primary-deeper); margin-bottom: 6px; }
.login__sub { color: var(--text-soft); font-size: 14px; margin-bottom: 26px; }
.login__back { margin-top: 22px; font-size: 13px; color: var(--muted); }

/* ============================================================
   LAYOUT — sidebar + main
   ============================================================ */
.admin {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--primary-deeper);
  color: #DDEDE6;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff;
  padding: 6px 10px;
  border-radius: var(--radius);
  text-decoration: none;
}
.sidebar__brand img { background: #fff; padding: 4px; border-radius: 8px; }
.sidebar__brand strong { display: block; font-size: 15px; line-height: 1.1; }
.sidebar__brand small { font-size: 11px; opacity: .65; letter-spacing: .12em; text-transform: uppercase; }

.sidebar__nav {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 10px;
}
.sidebar__nav a {
  color: #C9DDD4;
  padding: 10px 14px;
  border-radius: 8px;
  display: flex; align-items: center; gap: 11px;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--t);
}
.sidebar__nav a span { display: inline-block; width: 18px; text-align: center; opacity: .85; }
.sidebar__nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar__nav a.is-active {
  background: var(--primary);
  color: #fff;
}
.sidebar__nav a.is-active span { opacity: 1; }

.sidebar__user {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.10);
  display: flex; align-items: center; gap: 10px;
}
.sidebar__user-info { flex: 1; min-width: 0; }
.sidebar__user-info strong { display: block; color: #fff; font-size: 13px; line-height: 1.2; }
.sidebar__user-info small {
  color: #93B1A6; font-size: 11.5px;
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar__logout {
  color: #fff;
  background: rgba(255,255,255,.10);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: all var(--t);
  font-size: 16px;
}
.sidebar__logout:hover { background: var(--danger); color: #fff; }

.main {
  display: flex; flex-direction: column;
  min-width: 0;
}

.topbar-admin {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 9;
}
.topbar-admin h1 { font-size: 18px; font-weight: 600; color: var(--primary-deeper); }
.topbar-admin__actions { display: flex; gap: 10px; }

.content {
  padding: 28px 32px;
  flex: 1;
}

@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .sidebar__nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar__nav a { padding: 8px 12px; }
  .content, .topbar-admin { padding: 18px 18px; }
}

/* ============================================================
   COMPONENTES
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px;
  border: 0; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 14px;
  border-radius: 8px;
  transition: all var(--t);
  text-decoration: none;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--primary-dark); border: 1px solid var(--border); }
.btn--ghost:hover { border-color: var(--primary); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #A93735; }
.btn--sm { padding: 6px 12px; font-size: 12.5px; }
.btn--block { width: 100%; padding: 12px 18px; font-size: 15px; }

/* Cards / stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.stat {
  background: #fff;
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--t);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat__label { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; margin-bottom: 8px; }
.stat__value { font-size: 32px; font-weight: 700; color: var(--primary-dark); line-height: 1.1; }
.stat__detail { color: var(--text-soft); font-size: 13px; margin-top: 4px; }

/* Card genérico */
.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.card__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card__header h2 { font-size: 17px; font-weight: 600; color: var(--primary-deeper); }

/* Tabela */
.table {
  width: 100%; border-collapse: collapse;
}
.table th, .table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.table th {
  color: var(--muted);
  font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  font-weight: 700;
}
.table tr:hover td { background: var(--cream); }
.table__actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Badge / status */
.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11.5px; font-weight: 600;
  border-radius: 30px;
  letter-spacing: .02em;
}
.badge--published { background: var(--mint); color: var(--primary-deeper); }
.badge--draft { background: #F4ECD9; color: #8A6E2A; }
.badge--active { background: var(--mint); color: var(--primary-deeper); }
.badge--inactive { background: #EFE2E1; color: #8A4341; }

/* Forms */
.field { display: block; margin-bottom: 16px; text-align: left; }
.field__label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-soft); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .04em;
}
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=url], .field input[type=tel],
.field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit; font-size: 14px;
  background: #fff;
  transition: border var(--t), box-shadow var(--t);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(53,143,128,.15);
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.55; font-family: inherit; }
.field__hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.field-group { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* Toggle (checkbox styled) */
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__sw {
  width: 38px; height: 22px;
  background: #CFDAD5;
  border-radius: 50px;
  position: relative;
  transition: background var(--t);
}
.toggle__sw::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; background: #fff;
  border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: transform var(--t);
}
.toggle input:checked + .toggle__sw { background: var(--primary); }
.toggle input:checked + .toggle__sw::after { transform: translateX(16px); }

/* Alertas */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 14px;
  border-left: 3px solid;
}
.alert--success { background: var(--mint); border-color: var(--success); color: var(--primary-deeper); }
.alert--error   { background: #FBE7E5; border-color: var(--danger);  color: #7E2D2B; }
.alert--info    { background: #E9F1FB; border-color: #3F77D8;       color: #2B4E94; }
.alert--warning { background: #FBF1DC; border-color: var(--warning); color: #7C5A1E; }

/* Empty state */
.empty {
  padding: 60px 30px;
  text-align: center;
  color: var(--muted);
}
.empty__icon { font-size: 38px; opacity: .5; margin-bottom: 14px; }
.empty h3 { font-weight: 600; color: var(--text-soft); font-size: 16px; margin-bottom: 6px; }

/* Quick actions */
.quick-actions {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px;
}

/* ============================================================
   DOCUMENTOS (atestados / pedido de exames)
   ============================================================ */
.doc-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px; margin-bottom: 28px;
}
.doc-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px 22px 18px;
  color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.doc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); color: var(--text); }
.doc-card__icon { font-size: 30px; line-height: 1; }
.doc-card h3 { font-size: 16px; font-weight: 600; color: var(--primary-deeper); }
.doc-card p { color: var(--text-soft); font-size: 13.5px; flex: 1; }
.doc-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted);
}
.doc-form { max-width: 760px; }
.doc-form .req { color: var(--danger); }
.doc-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.doc-chips__label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.doc-chip {
  background: var(--mint); color: var(--primary-deeper); border: 1px solid transparent;
  border-radius: 999px; padding: 5px 11px; font: 500 12.5px/1 inherit; font-family: inherit; cursor: pointer;
  transition: all var(--t);
}
.doc-chip:hover { background: var(--primary); color: #fff; }
