/* =========================================================
   Cia DH – Admin Panel CSS
   ========================================================= */

:root {
  --brand:       #1A56DB;
  --brand-dark:  #0F1E5C;
  --brand-light: #EBF5FF;
  --cta:         #E8750A;
  --cta-dark:    #C45E00;
  --success:     #0E9F6E;
  --danger:      #E02424;
  --warning:     #FBBF24;
  --info:        #3ABFF8;
  --gray-50:     #F9FAFB;
  --gray-100:    #F3F4F6;
  --gray-200:    #E5E7EB;
  --gray-300:    #D1D5DB;
  --gray-400:    #9CA3AF;
  --gray-500:    #6B7280;
  --gray-600:    #4B5563;
  --gray-700:    #374151;
  --gray-800:    #1F2937;
  --gray-900:    #111827;
  --sidebar-w:   260px;
  --topbar-h:    64px;
  --radius:      8px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow:      0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 30px rgba(0,0,0,.15);
  --transition:  .2s ease;
}

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

html { font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ─── LAYOUT SHELL ─────────────────────────────────────── */

.admin-shell {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ───────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  background: var(--brand-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-decoration: none;
}

.sidebar-brand-logo {
  width: 36px;
  height: 36px;
  background: var(--brand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sidebar-brand-name small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: .6;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-nav-section {
  padding: 10px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  opacity: .45;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
  text-decoration: none;
}

.sidebar-nav a.active {
  background: rgba(26,86,219,.25);
  color: #fff;
  border-left-color: var(--brand);
}

.sidebar-nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .8;
}

.sidebar-nav a.active svg { opacity: 1; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  background: var(--brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-role {
  font-size: 11px;
  opacity: .5;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: rgba(255,255,255,.6);
  transition: background var(--transition);
}

.sidebar-logout:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  text-decoration: none;
}

/* ─── MAIN CONTENT ──────────────────────────────────────── */

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── TOPBAR ─────────────────────────────────────────────── */

.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  color: var(--gray-600);
}

.topbar-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--gray-800);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ─── PAGE WRAPPER ──────────────────────────────────────── */

.page-wrap {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
  width: 100%;
}

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

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
}

.page-header p {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* ─── CARDS ──────────────────────────────────────────────── */

.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  flex: 1;
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ─── STATS GRID ─────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.blue  { background: #EBF5FF; color: var(--brand); }
.stat-icon.green { background: #E3FCEF; color: var(--success); }
.stat-icon.orange{ background: #FFF3E0; color: var(--cta); }

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* ─── BUTTONS ────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), opacity var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn-primary:hover { background: #1648c0; border-color: #1648c0; }

.btn-cta {
  background: var(--cta);
  color: #fff;
  border-color: var(--cta);
}
.btn-cta:hover { background: var(--cta-dark); border-color: var(--cta-dark); }

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover { background: #0a7a58; border-color: #0a7a58; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-outline {
  background: #fff;
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.btn-outline:hover { background: var(--gray-50); }

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--gray-100); }

.btn-sm {
  padding: 5px 10px;
  font-size: 13px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 4px;
}

.btn-icon {
  padding: 7px;
  border-radius: 6px;
}

.btn:disabled, .btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
}

/* ─── FORMS ──────────────────────────────────────────────── */

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--gray-800);
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.4;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}

.form-control.is-invalid {
  border-color: var(--danger);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(224,36,36,.12);
}

.invalid-feedback {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 90px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.form-hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--brand);
}

/* ─── TABLES ─────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  background: var(--gray-50);
  padding: 11px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
  color: var(--gray-700);
}

tr:last-child td { border-bottom: none; }

tbody tr:hover { background: var(--gray-50); }

.td-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* ─── BADGES ─────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-success { background: #E3FCEF; color: #0E6245; }
.badge-danger  { background: #FDE8E8; color: #9B1C1C; }
.badge-warning { background: #FFF3CD; color: #92400E; }
.badge-info    { background: #EBF5FF; color: #1e40af; }
.badge-gray    { background: var(--gray-100); color: var(--gray-600); }

.stage-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
}

.produto-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: var(--gray-100);
  color: var(--gray-600);
}

/* ─── ALERTS ─────────────────────────────────────────────── */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 20px;
}

.alert svg { flex-shrink: 0; margin-top: 1px; }

.alert-success { background: #E3FCEF; color: #0E6245; border: 1px solid #a7f3d0; }
.alert-danger  { background: #FDE8E8; color: #9B1C1C; border: 1px solid #fca5a5; }
.alert-warning { background: #FFF3CD; color: #92400E; border: 1px solid #fcd34d; }
.alert-info    { background: #EBF5FF; color: #1e40af; border: 1px solid #bfdbfe; }

.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  opacity: .5;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  color: inherit;
}
.alert-close:hover { opacity: 1; }

/* ─── FILTERS BAR ────────────────────────────────────────── */

.filters-bar {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.preset-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.preset-tab {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--gray-300);
  background: #fff;
  font-size: 13px;
  color: var(--gray-600);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}

.preset-tab:hover {
  background: var(--gray-100);
  text-decoration: none;
  color: var(--gray-800);
}

.preset-tab.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.filters-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.date-range-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.date-range-row input { flex: 1; }

/* ─── PAGINATION ─────────────────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  background: #fff;
  text-decoration: none;
  transition: all var(--transition);
}

.pagination a:hover {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--brand);
  text-decoration: none;
}

.pagination .current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.pagination .disabled {
  opacity: .4;
  pointer-events: none;
}

.pagination-meta {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 10px;
  text-align: center;
}

/* ─── MODALS ─────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.96) translateY(-8px);
  transition: transform .2s ease;
}

.modal-backdrop.open .modal {
  transform: scale(1) translateY(0);
}

.modal-lg { max-width: 640px; }
.modal-xl { max-width: 780px; }

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--gray-100);
}

.modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-icon.success { background: #E3FCEF; color: var(--success); }
.modal-icon.danger  { background: #FDE8E8; color: var(--danger); }
.modal-icon.warning { background: #FFF3CD; color: #D97706; }
.modal-icon.info    { background: #EBF5FF; color: var(--brand); }

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  flex: 1;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px;
  border-radius: 4px;
  font-size: 20px;
  line-height: 1;
  display: flex;
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-600); }

.modal-body {
  padding: 18px 22px;
}

.modal-body p {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.65;
}

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

/* ─── DETAIL CARDS ───────────────────────────────────────── */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px;
}

.detail-row {
  display: flex;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .05em;
  min-width: 140px;
  flex-shrink: 0;
}

.detail-value {
  font-size: 14px;
  color: var(--gray-800);
  word-break: break-all;
}

.detail-value.empty { color: var(--gray-300); font-style: italic; }

/* ─── HISTORY TIMELINE ───────────────────────────────────── */

.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--gray-300);
}

.timeline-content {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 10px 14px;
}

.timeline-meta {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ─── COLOR DOT ──────────────────────────────────────────── */

.color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── STAGE TYPE BADGE ───────────────────────────────────── */

.type-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.type-regular       { background: var(--gray-100); color: var(--gray-600); }
.type-ganho         { background: #E3FCEF; color: #0E6245; }
.type-perdido       { background: #FDE8E8; color: #9B1C1C; }
.type-desqualificado{ background: #FFF3CD; color: #92400E; }

/* ─── EMPTY STATE ────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 56px 24px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--gray-400);
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 14px;
  color: var(--gray-400);
}

/* ─── PER PAGE SELECTOR ──────────────────────────────────── */

.per-page-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-500);
}

.per-page-wrap select {
  padding: 4px 28px 4px 8px;
  font-size: 13px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: #fff;
  color: var(--gray-700);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

/* ─── EXPORT MODAL ───────────────────────────────────────── */

.export-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.export-type-row {
  display: flex;
  gap: 20px;
  margin-top: 12px;
}

/* ─── AUTH PAGES ─────────────────────────────────────────── */

.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--brand-dark) 0%, #1a3a7a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

.auth-logo-mark {
  width: 56px;
  height: 56px;
  background: var(--brand);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
}

.auth-logo-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}

.auth-logo-sub {
  font-size: 13px;
  color: var(--gray-400);
  margin-top: 2px;
}

.auth-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 28px;
}

/* ─── DRAG HANDLE ────────────────────────────────────────── */

.drag-handle {
  cursor: grab;
  color: var(--gray-300);
  padding: 2px 4px;
}
.drag-handle:active { cursor: grabbing; }

/* ─── INLINE EDIT TOGGLE ─────────────────────────────────── */

.inline-form { display: none; }
.inline-form.open { display: block; }

/* ─── PASSWORD REVEAL ────────────────────────────────────── */

.input-group {
  position: relative;
}

.input-group .form-control {
  padding-right: 40px;
}

.input-group-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 2px;
  display: flex;
}

.input-group-btn:hover { color: var(--gray-600); }

/* ─── TOAST / NOTIFICATION ───────────────────────────────── */

#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 360px;
  pointer-events: all;
  animation: toastIn .25s ease forwards;
}

.toast.hide { animation: toastOut .25s ease forwards; }

.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-icon.success { color: var(--success); }
.toast-icon.danger  { color: var(--danger); }
.toast-icon.warning { color: #D97706; }
.toast-icon.info    { color: var(--brand); }

.toast-body { flex: 1; font-size: 14px; color: var(--gray-700); }
.toast-title { font-weight: 600; margin-bottom: 2px; color: var(--gray-900); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ─── SIDEBAR OVERLAY (MOBILE) ───────────────────────────── */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */

@media (max-width: 1024px) {
  .filters-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .topbar-menu-toggle {
    display: flex;
  }

  .main-content {
    margin-left: 0;
  }

  .page-wrap {
    padding: 16px;
  }

  .filters-row {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .detail-label {
    min-width: 100px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .export-fields-grid {
    grid-template-columns: 1fr;
  }

  table { font-size: 13px; }
  th, td { padding: 10px 10px; }
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
  .preset-tabs { gap: 4px; }
  .preset-tab { font-size: 12px; padding: 4px 10px; }
}

/* ─── UTILITIES ──────────────────────────────────────────── */

.d-flex        { display: flex; }
.align-center  { align-items: center; }
.gap-8         { gap: 8px; }
.gap-12        { gap: 12px; }
.mt-4          { margin-top: 4px; }
.mt-8          { margin-top: 8px; }
.mt-16         { margin-top: 16px; }
.mt-24         { margin-top: 24px; }
.mb-0          { margin-bottom: 0; }
.mb-8          { margin-bottom: 8px; }
.mb-16         { margin-bottom: 16px; }
.text-sm       { font-size: 13px; }
.text-xs       { font-size: 12px; }
.text-muted    { color: var(--gray-400); }
.text-danger   { color: var(--danger); }
.text-success  { color: var(--success); }
.font-mono     { font-family: 'Courier New', monospace; }
.truncate      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full        { width: 100%; }
.text-center   { text-align: center; }
.text-right    { text-align: right; }
.sr-only       { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
