/* assets/style.css — META Centro Universitário v2 */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Brand */
  --navy:        #1a2557;
  --navy-dark:   #0f1a3e;
  --navy-mid:    #243069;
  --gold:        #c9a227;
  --gold-light:  #f5e6a3;
  --gold-dark:   #a07d15;
  /* UI */
  --blue:        #2563eb;
  --blue-light:  #dbeafe;
  --green:       #16a34a;
  --green-light: #dcfce7;
  --red:         #dc2626;
  --red-light:   #fee2e2;
  --yellow:      #d97706;
  --yellow-light:#fef3c7;
  --bg:          #f0f3f9;
  --surface:     #ffffff;
  --border:      #d1dae8;
  --text:        #1e293b;
  --muted:       #64748b;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 2px 12px rgba(15,26,62,.09);
  --shadow-lg:   0 8px 32px rgba(15,26,62,.16);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── TOPBAR ─────────────────────────────────────────────── */
.topbar {
  background: var(--navy-dark);
  color: #fff;
  padding: 0 1.5rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,.3);
  gap: 1rem;
}
.topbar__brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-shrink: 0;
}
.topbar__logo {
  height: 44px;
  width: auto;
  /* logo has black bg, blend mode makes it transparent on dark bg */
  
}
.topbar__nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.topbar__nav a {
  color: rgba(255,255,255,.75);
  font-size: .92rem;
  font-weight: 500;
  transition: color .2s;
  white-space: nowrap;
}
.topbar__nav a:hover { color: #fff; text-decoration: none; }
.topbar__nav a.active { color: var(--gold); }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: .25rem;
}
@media(max-width:700px) {
  .nav-toggle { display: block; }
  .topbar__nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--navy-dark);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    gap: .75rem;
    border-top: 1px solid rgba(255,255,255,.1);
    box-shadow: 0 8px 20px rgba(0,0,0,.3);
  }
  .topbar__nav.open { display: flex; }
  .topbar__nav a { font-size: 1rem; padding: .35rem 0; }
}

/* ── WRAPPER ─────────────────────────────────────────────── */
.wrapper { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }
@media(max-width:600px) { .wrapper { padding: 1.25rem 1rem; } }

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header { margin-bottom: 1.8rem; }
.page-header h1 { font-size: 1.8rem; font-weight: 800; color: var(--navy); letter-spacing: -.02em; }
.page-header p { color: var(--muted); margin-top: .2rem; font-size: .92rem; }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.card__title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ── STAT CARDS ──────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media(max-width:900px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }
@media(max-width:480px) { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--navy);
}
.stat-card--gold   { border-top-color: var(--gold); }
.stat-card--green  { border-top-color: var(--green); }
.stat-card--red    { border-top-color: var(--red); }
.stat-card--yellow { border-top-color: var(--yellow); }
.stat-card__label  { font-size: .73rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .35rem; }
.stat-card__value  { font-size: 2.2rem; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-card__sub    { font-size: .78rem; color: var(--muted); margin-top: .2rem; }

/* ── DISPONIBILIDADE CARDS ───────────────────────────────── */
.disp-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
@media(max-width:800px) { .disp-grid { grid-template-columns: repeat(2,1fr); } }
@media(max-width:400px) { .disp-grid { grid-template-columns: 1fr 1fr; } }

.disp-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
}
.disp-card__img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}
.disp-card__nome { font-weight: 700; font-size: .95rem; color: var(--navy); }
.disp-card__num  { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.disp-card__num--ok   { color: var(--green); }
.disp-card__num--warn { color: var(--yellow); }
.disp-card__num--zero { color: var(--red); }
.disp-card__sub { font-size: .75rem; color: var(--muted); }

/* ── FORMS ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .95rem; font-weight: 600; color: var(--navy); margin-bottom: .4rem; }
.form-control {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.15); }
.form-hint { font-size: .77rem; color: var(--muted); margin-top: .25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media(max-width:560px) { .form-row { grid-template-columns: 1fr; } }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media(max-width:700px) { .form-row-3 { grid-template-columns: 1fr 1fr; } }
@media(max-width:450px) { .form-row-3 { grid-template-columns: 1fr; } }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.3rem;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-mid); color: #fff; }
.btn--gold { background: var(--gold); color: #fff; }
.btn--gold:hover { background: var(--gold-dark); color: #fff; }
.btn--green { background: var(--green); color: #fff; }
.btn--green:hover { background: #15803d; color: #fff; }
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: #b91c1c; color: #fff; }
.btn--yellow { background: var(--yellow); color: #fff; }
.btn--yellow:hover { background: #b45309; color: #fff; }
.btn--outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn--outline:hover { border-color: var(--navy); color: var(--navy); }
.btn--sm { padding: .38rem .75rem; font-size: .8rem; }
.btn--full { width: 100%; }
.btn--login {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy-mid));
  color: #fff;
  width: 100%;
  padding: .85rem;
  font-size: 1rem;
  border-radius: 10px;
  border: 2px solid var(--gold);
}
.btn--login:hover { opacity: .93; color: #fff; }

/* ── TABLE ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
thead tr { background: var(--navy-dark); color: #fff; }
thead th { padding: .75rem 1rem; text-align: left; font-weight: 600; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:hover { background: #f8faff; }
tbody td { padding: .7rem 1rem; vertical-align: middle; word-break: break-word; white-space: normal; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: .28rem .7rem; border-radius: 999px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.badge--green  { background: var(--green-light); color: var(--green); }
.badge--yellow { background: var(--yellow-light); color: var(--yellow); }
.badge--blue   { background: var(--blue-light); color: #1d4ed8; }
.badge--red    { background: var(--red-light); color: var(--red); }
.badge--gray   { background: #f1f5f9; color: var(--muted); }
.badge--gold   { background: #fef3c7; color: var(--gold-dark); }

/* ── FLASH ───────────────────────────────────────────────── */
.flash {
  padding: .85rem 1.2rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  font-weight: 500;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.flash__icon { font-weight: 800; font-size: 1rem; flex-shrink: 0; }
.flash--sucesso { background: var(--green-light); color: #166534; border-left: 4px solid var(--green); }
.flash--erro    { background: var(--red-light);   color: #991b1b; border-left: 4px solid var(--red); }
.flash--info    { background: var(--blue-light);  color: #1e40af; border-left: 4px solid var(--blue); }

/* ── PERIOD PILLS ────────────────────────────────────────── */
.pill { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.pill--tarde      { background: #fef3c7; color: #92400e; }
.pill--noite      { background: #ede9fe; color: #5b21b6; }
.pill--tarde-noite { background: #f0fdf4; color: #15803d; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 300;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-bg.open { display: flex; }
.modal {
  background: #fff; border-radius: 16px; padding: 2rem;
  width: 100%; max-width: 500px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
  max-height: 90vh; overflow-y: auto;
}
.modal h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; color: var(--navy); }
.modal-close { float: right; cursor: pointer; background: none; border: none; font-size: 1.3rem; color: var(--muted); }

/* ── CHECKLIST ───────────────────────────────────────────── */
.checklist { display: flex; flex-direction: column; gap: .6rem; margin: .75rem 0 1rem; }
.checklist__item {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
}
.checklist__item:has(input:checked) { border-color: var(--green); background: var(--green-light); }
.checklist__item input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; }
.checklist__item label { cursor: pointer; font-weight: 500; font-size: .92rem; }

/* ── AUTH PAGES ──────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--navy-dark) 0%, var(--navy) 50%, #0d2856 100%);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.auth-box {
  background: #fff; border-radius: 20px; padding: 2.5rem 2rem;
  width: 100%; max-width: 440px;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
}
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo img { height: 90px; width: auto; margin: 0 auto; }
.auth-logo__sub { font-size: .85rem; color: var(--muted); margin-top: .5rem; font-weight: 500; }
.auth-tabs {
  display: flex; gap: .4rem; margin-bottom: 1.75rem;
  background: #f1f5f9; border-radius: 10px; padding: .3rem;
}
.auth-tab {
  flex: 1; text-align: center; padding: .55rem;
  border-radius: 8px; font-weight: 600; font-size: .88rem;
  cursor: pointer; color: var(--muted); transition: all .2s;
}
.auth-tab.active { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.auth-tab:hover { text-decoration: none; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: .82rem; color: var(--muted); }

/* ── EQUIPMENT EQUIP BOX ─────────────────────────────────── */
.equip-box {
  border: 2px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem; transition: border-color .2s, background .2s;
  margin-bottom: .75rem;
}
.equip-box.active { border-color: var(--gold); background: #fffbeb; }
.equip-box__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.equip-box__title { font-weight: 700; font-size: .95rem; color: var(--navy); display: flex; align-items: center; gap: .5rem; }
.equip-box__img { width: 36px; height: 36px; object-fit: contain; }
.disp-badge { font-size: .77rem; font-weight: 700; padding: .22rem .6rem; border-radius: 999px; }
.disp-badge--ok   { background: var(--green-light); color: var(--green); }
.disp-badge--warn { background: var(--yellow-light); color: var(--yellow); }
.disp-badge--zero { background: var(--red-light); color: var(--red); }
.disp-badge--na   { background: #f1f5f9; color: var(--muted); }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty__icon { font-size: 2.5rem; margin-bottom: .75rem; opacity: .5; }
.empty p { font-size: .92rem; }

/* ── SECTION DIVIDER ─────────────────────────────────────── */
.section-label {
  font-size: .75rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin: 1.25rem 0 .75rem;
  display: flex; align-items: center; gap: .5rem;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── GRID HELPERS ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media(max-width:768px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── ITENS FALTANDO CARD ─────────────────────────────────── */
.faltando-card {
  border-left: 4px solid var(--red);
  background: var(--red-light);
  border-radius: var(--radius-sm);
  padding: .85rem 1rem;
  margin-bottom: .65rem;
  font-size: .88rem;
}
.faltando-card.resolvido { border-left-color: var(--green); background: var(--green-light); }

/* ── TRACKING BOX ────────────────────────────────────────── */
.tracking { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.tracking strong { color: var(--text); }

/* ── RESPONSIVE HELPERS ──────────────────────────────────── */
@media(max-width:700px) {
  /* Topbar */
  .topbar { padding: 0 1rem; }
  .topbar__logo { height: 36px; }

  /* Grid layouts collapse */
  .grid-2, .grid-3 { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: 1fr 1fr !important; }
  .form-row, .form-row-3 { grid-template-columns: 1fr !important; }

  /* Page header */
  .page-header h1 { font-size: 1.4rem; }
  .page-header p { font-size: .9rem; }

  /* Cards */
  .card { padding: 1rem; }

  /* Forms */
  .form-control { font-size: 1rem; padding: .7rem .85rem; }
  .form-group label { font-size: .92rem; }

  /* Buttons */
  .btn { font-size: .95rem; padding: .68rem 1rem; }
  .btn--sm { font-size: .85rem; padding: .42rem .75rem; }

  /* Stat cards */
  .stat-card__value { font-size: 1.8rem; }
  .stat-card { padding: 1rem; }

  /* Disponibilidade cards */
  .disp-grid { grid-template-columns: 1fr 1fr !important; gap: .6rem !important; }
  .disp-card { padding: .8rem .6rem; }
  .disp-card__img { width: 44px; height: 44px; }
  .disp-card__nome { font-size: .84rem; }
  .disp-card__num { font-size: 1.8rem; }
  .disp-card__sub { font-size: .7rem; }

  /* Modal */
  .modal { padding: 1.4rem 1.1rem; }
  .modal h2 { font-size: 1rem; }

  /* Tables - scroll horizontal */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 480px; }
  thead th { font-size: .74rem; padding: .6rem .75rem; }
  tbody td { font-size: .88rem; padding: .65rem .75rem; }

  /* Equipamentos equip-box */
  .equip-box { padding: .9rem; }
  .equip-box__title { font-size: .92rem; }
  .equip-box__img { width: 30px; height: 30px; }

  /* Stepper */
  .stepper__btn { width: 40px; height: 42px; font-size: 1.2rem; }
  .stepper__input { width: 48px; height: 42px; font-size: 1rem; }

  /* Responsabilidade modal */
  .resp-modal { padding: 1.4rem 1.1rem; }
  .resp-modal h2 { font-size: 1rem; }
  .resp-modal p { font-size: .88rem; }

  /* Section label */
  .section-label { font-size: .75rem; }

  /* Wrapper padding */
  .wrapper { padding: 1rem .85rem; }

  /* Badge */
  .badge { font-size: .78rem; }

  /* Pill */
  .pill { font-size: .76rem; padding: .18rem .55rem; }

  /* Flash */
  .flash { font-size: .88rem; padding: .75rem 1rem; }

  /* Others panel toggle */
  .btn-outros-toggle { font-size: .9rem; }

  /* Auth box */
  .auth-box { padding: 1.75rem 1.25rem; }
}

/* ── PASSWORD TOGGLE ─────────────────────────────────────── */
.pass-wrap { position: relative; }
.pass-wrap .form-control { padding-right: 2.8rem; }
.pass-toggle {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: .2rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  transition: color .2s;
  line-height: 1;
}
.pass-toggle:hover { color: var(--navy); }
.pass-toggle svg { width: 20px; height: 20px; }

/* ── STEPPER ─────────────────────────────────────────────── */
.stepper { display:flex; align-items:center; border:1.5px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; width:fit-content; }
.stepper__btn {
  width:44px; height:44px; border:none; background:var(--bg); cursor:pointer;
  font-size:1.3rem; font-weight:700; color:var(--navy); line-height:1;
  display:flex; align-items:center; justify-content:center;
  transition:background .15s; flex-shrink:0; font-family:inherit;
}
.stepper__btn:hover { background:#e2e8f0; }
.stepper__btn:active { background:#cbd5e1; }
.stepper__input {
  width:54px; height:44px; border:none;
  border-left:1.5px solid var(--border); border-right:1.5px solid var(--border);
  text-align:center; font-size:1.05rem; font-weight:700; color:var(--navy);
  font-family:inherit; background:#fff; -moz-appearance:textfield;
}
.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }

.ag-table .table-wrap { overflow-x: auto; }
.ag-table table { min-width: 920px; }

/* ── AGENDAMENTOS TABLE ENHANCED ────────────────────────────── */
.ag-table table { border-collapse: separate; border-spacing: 0; }
.ag-table thead tr { background: linear-gradient(135deg, var(--navy-dark), var(--navy-mid)); }
.ag-table tbody tr { transition: all .15s; }
.ag-table tbody tr:hover { background: #eff6ff; transform: translateX(2px); }
.ag-table tbody td { padding: .85rem 1rem; border-bottom: 1px solid #eef2f9; }
.ag-table tbody tr:last-child td { border-bottom: none; }
.proto-tag {
  font-family: 'Courier New', monospace;
  font-size: .78rem;
  font-weight: 700;
  color: var(--navy);
  background: #eef2ff;
  padding: .2rem .55rem;
  border-radius: 6px;
  border: 1px solid #c7d2fe;
  white-space: nowrap;
}

/* ── AGENDAMENTOS TABLE FIX ──────────────────────────────── */
.ag-table .table-wrap,
.ag-table > div[style*="overflow-x"] { overflow-x: auto !important; }
.ag-table table { min-width: 950px !important; }
