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

:root {
  --purple: #5d1674;
  --purple-dark: #4a1070;
  --magenta: #9a2361;
  --orange: #ff3d10;
  --orange-dark: #e83208;
  --blue: #4a87b8;
  --bg: #f4f4f6;
  --panel: #ffffff;
  --text: #4f5660;
  --muted: #6f7782;
  --line: #e5e7eb;
  --shadow: 0 7px 18px rgba(27,31,35,0.16);
  --radius: 10px;
}

body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

.hidden { display: none !important; }

/* ── LOGIN ── */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(93,22,116,0.92), rgba(255,61,16,0.9)),
    var(--bg);
}

.login-card {
  background: var(--panel);
  border-radius: 16px;
  padding: 40px 36px;
  width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.login-logo {
  display: block;
  width: min(100%, 220px);
  margin: 0 auto 20px;
}
.login-logo img {
  width: 100%;
  height: auto;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  background: transparent;
  display: block;
}

.login-sub {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 0 28px;
}

/* ── DASHBOARD ── */
#dashboard {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR PRINCIPAL ── */
.topbar-main {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 0 26px;
  color: #fff;
  background: linear-gradient(100deg, #b91c1c 0%, #dc2626 40%, #ea580c 75%, var(--orange) 100%);
  box-shadow: 0 5px 16px rgba(0,0,0,0.22);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.brand-area { display: flex; align-items: center; gap: 18px; min-width: 0; }
.top-actions { display: flex; align-items: center; gap: 16px; }

.top-logo {
  width: 140px;
  height: 50px;
  border: 0;
  box-shadow: none;
  background: transparent;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.system-name {
  font-size: 1rem;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
}

.top-icon-button {
  color: #fff;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  min-width: 36px;
  min-height: 36px;
  padding: 6px;
}
.top-icon-button:hover { opacity: 0.8; }

.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
  display: block;
  width: 20px;
  height: 3px;
  border-radius: 3px;
  background: #fff;
}
.hamburger-icon { position: relative; }
.hamburger-icon::before,
.hamburger-icon::after { content: ""; position: absolute; left: 0; }
.hamburger-icon::before { top: -7px; }
.hamburger-icon::after  { top: 7px; }

/* ── WORKSPACE ── */
.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 220px;
  background: #fff;
  border-right: 1px solid #d7d9de;
  box-shadow: 5px 0 14px rgba(0,0,0,0.12);
  flex-shrink: 0;
  padding: 18px 0 28px;
  transition: width 0.2s, padding 0.2s;
  overflow: hidden;
}
.sidebar.sidebar-hidden { width: 0; padding: 0; box-shadow: none; }

.nav-item {
  display: block;
  width: 100%;
  min-height: 45px;
  line-height: 45px;
  padding: 0 20px;
  color: #565d66;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: background 0.16s, color 0.16s;
  border: 0;
}

.nav-item:hover,
.nav-item.active {
  background: var(--orange);
  color: #fff;
}

/* ── CONTENT ── */
.content {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  background: var(--bg);
}

.page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-breadcrumb { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--orange); margin-bottom: 2px; }
.page-topbar h1 { font-size: 1.3rem; font-weight: 800; color: var(--text); margin: 0; }

.list-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }

.busca-input {
  flex: 1;
  max-width: 320px;
  padding: 8px 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--panel);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
.busca-input:focus { border-color: var(--orange); }

.list-card-info {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

/* ── TABELA PADRÃO GESTAO ── */
.list-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  background: var(--bg);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #fafafa; }
.data-table .td-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* badges */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-ativo   { background: #d1fae5; color: #065f46; }
.badge-inativo { background: #fee2e2; color: #991b1b; }
.badge-liberado { background: #fff4f0; color: var(--orange-dark); border: 1px solid var(--orange); }
.badge-bloqueado { background: #fee2e2; color: #991b1b; }

/* ── FORMULÁRIOS ── */
.field { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.field label { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--orange); background: #fff; }
.field textarea { resize: vertical; }
.field-short { max-width: 100px; flex: none; }
.field-grow { flex: 2; }

.form-row { display: flex; gap: 12px; }
.req { color: var(--orange); }

.section-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--orange);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--orange);
  margin-bottom: 12px;
}

.tip {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #fff4f0;
  border-radius: 7px;
  border-left: 3px solid var(--orange);
}

.error { color: var(--orange); font-size: 0.82rem; margin-top: 6px; }

.empty { color: var(--muted); font-size: 0.88rem; text-align: center; padding: 40px 0; grid-column: 1/-1; }

/* ── BOTÕES ── */
.btn-primary {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s;
}
.btn-primary:hover { background: var(--orange-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s;
}
.btn-secondary:hover { border-color: var(--orange); color: var(--orange); }

.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
  border-radius: 6px;
}

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.btn-danger:hover { background: #fecaca; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }

.btn-full { width: 100%; padding: 13px; font-size: 0.95rem; margin-top: 4px; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal {
  background: var(--panel);
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 { font-size: 1.05rem; font-weight: 800; color: var(--orange); }

.modal form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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


/* ── CADEADO ── */
.btn-lock {
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 20px;
  transition: opacity 0.12s;
  flex-shrink: 0;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.02em;
}
.btn-lock:hover { opacity: 0.8; }
.lock-open   { background: #d1fae5; color: #065f46; }
.lock-closed { background: #fee2e2; color: #991b1b; }
