/* ============================================================
   SANTANA, SOUSA & VILENE ADVOGADOS — Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,500&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --background: #160b07;
  --background-2: #1d0e09;
  --surface: #21120b;
  --surface-2: #2a160e;
  --surface-3: #33190f;
  --brown: #2a140d;
  --brown-mid: #3b1f13;
  --brown-light: #56301d;
  --border: rgba(212, 175, 112, 0.16);
  --border-strong: rgba(212, 175, 112, 0.32);
  --gold: #d4af70;
  --gold-light: #e8ca8d;
  --champagne: #f2deb0;
  --text: #f5eee8;
  --text-muted: #b9aaa0;
  --text-faint: #8a7a70;

  --status-andamento-bg: rgba(212, 175, 112, 0.14);
  --status-andamento-fg: #d4af70;
  --status-audiencia-bg: rgba(217, 155, 79, 0.16);
  --status-audiencia-fg: #d99b4f;
  --status-sentenca-bg: rgba(232, 202, 141, 0.18);
  --status-sentenca-fg: #e8ca8d;
  --status-arquivado-bg: rgba(107, 122, 79, 0.2);
  --status-arquivado-fg: #9caf7c;
  --status-urgente-bg: rgba(155, 74, 46, 0.2);
  --status-urgente-fg: #d68a68;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 18px rgba(0, 0, 0, 0.35);
  --shadow-elevated: 0 12px 32px rgba(0, 0, 0, 0.45);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 252px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body {
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(212,175,112,0.06), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 0%, rgba(212,175,112,0.04), transparent 55%);
  background-attachment: fixed;
}

h1, h2, h3, h4, .font-serif {
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::selection { background: rgba(212,175,112,0.3); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--brown-light); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ============ App Shell ============ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ============ Sidebar ============ */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--background-2) 0%, #150a06 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: transform 220ms var(--ease);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo img { height: 54px; width: auto; object-fit: contain; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
}
.nav-item i { width: 18px; text-align: center; font-size: 15px; color: var(--gold); opacity: 0.75; }
.nav-item:hover { background: rgba(212,175,112,0.06); color: var(--text); }
.nav-item:hover i { opacity: 1; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(212,175,112,0.14), rgba(212,175,112,0.04));
  color: var(--champagne);
  border-color: var(--border-strong);
  box-shadow: inset 0 0 0 1px rgba(212,175,112,0.05);
}
.nav-item.active i { opacity: 1; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 14px 12px;
  position: relative;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background 150ms var(--ease);
}
.user-chip:hover { background: rgba(212,175,112,0.06); }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--brown-light));
  display: flex; align-items: center; justify-content: center;
  color: #201007; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11.5px; color: var(--text-faint); }
.user-chip .fa-chevron-up { color: var(--text-faint); font-size: 11px; transition: transform 150ms var(--ease); }
.user-chip.open .fa-chevron-up { transform: rotate(180deg); }

.account-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 12px; right: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 1px;
}
.account-menu.show { display: flex; }
.account-menu a, .account-menu button {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 7px;
  font-size: 13.5px; color: var(--text-muted);
  background: none; border: none; width: 100%; text-align: left;
}
.account-menu a:hover, .account-menu button:hover { background: rgba(212,175,112,0.08); color: var(--text); }
.account-menu i { width: 16px; color: var(--gold); font-size: 13px; }
.account-menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 2px; }

/* ============ Main / Topbar ============ */
.main-area {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 68px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(22, 11, 7, 0.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 30;
  gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.menu-toggle {
  display: none;
  background: none; border: 1px solid var(--border); color: var(--gold);
  width: 36px; height: 36px; border-radius: var(--radius-sm); align-items: center; justify-content: center;
}
.breadcrumb { font-size: 13px; color: var(--text-faint); }
.breadcrumb strong { color: var(--text); font-weight: 600; }
.page-title-topbar { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); border: 1px solid transparent;
  position: relative; background: none;
  transition: background 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
}
.icon-btn:hover { background: var(--surface); color: var(--gold); border-color: var(--border); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%; background: #d68a68;
  box-shadow: 0 0 0 2px var(--background);
}
.topbar-date { text-align: right; line-height: 1.3; }
.topbar-date .d1 { font-size: 12.5px; color: var(--text-muted); }
.topbar-date .d2 { font-size: 11.5px; color: var(--gold); font-weight: 600; }
.topbar-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--brown-light));
  display: flex; align-items: center; justify-content: center;
  color: #201007; font-weight: 700; font-size: 13px;
}

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

/* ============ Page Header ============ */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 30px; color: var(--champagne); margin-bottom: 4px; }
.page-header .subtitle { color: var(--text-muted); font-size: 14.5px; }
.page-header-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; border: 1px solid transparent;
  transition: transform 150ms var(--ease), background 150ms var(--ease), border-color 150ms var(--ease), box-shadow 150ms var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), #c39a5c);
  color: #201007;
  box-shadow: 0 4px 14px rgba(212,175,112,0.18);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(212,175,112,0.28); }
.btn-secondary {
  background: var(--surface); color: var(--text); border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--gold); border-color: transparent; padding: 8px 10px; }
.btn-ghost:hover { background: rgba(212,175,112,0.08); }
.btn-danger { background: rgba(155,74,46,0.16); color: #d68a68; border-color: rgba(155,74,46,0.3); }
.btn-danger:hover { background: rgba(155,74,46,0.26); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.link-gold { color: var(--gold); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.link-gold:hover { color: var(--gold-light); }

/* ============ Cards / Grid ============ */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.card-flat { padding: 0; overflow: hidden; }

.stat-card { display: flex; flex-direction: column; gap: 14px; }
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.stat-icon {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 30%, var(--gold-light), var(--brown-light));
  color: #241207; font-size: 17px;
}
.stat-label { font-size: 12.5px; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.stat-value { font-size: 32px; font-family: 'Cormorant Garamond', serif; font-weight: 700; color: var(--text); }
.stat-foot { font-size: 12.5px; color: var(--gold); }
.stat-foot.muted { color: var(--text-faint); }

.card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title-row h2 { font-size: 19px; color: var(--champagne); }

/* ============ Table ============ */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead th {
  text-align: left; padding: 10px 14px; color: var(--text-faint);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table tbody td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tbody tr { transition: background 150ms var(--ease); }
.data-table tbody tr:hover { background: rgba(212,175,112,0.04); cursor: pointer; }
.data-table tbody tr:last-child td { border-bottom: none; }
.cell-primary { color: var(--text); font-weight: 600; }
.cell-muted { color: var(--text-muted); font-size: 12.5px; }

/* ============ Badges ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
}
.badge-andamento { background: var(--status-andamento-bg); color: var(--status-andamento-fg); }
.badge-audiencia { background: var(--status-audiencia-bg); color: var(--status-audiencia-fg); }
.badge-sentenca { background: var(--status-sentenca-bg); color: var(--status-sentenca-fg); }
.badge-arquivado { background: var(--status-arquivado-bg); color: var(--status-arquivado-fg); }
.text-danger { color: #e08b7d; }
.badge-urgente { background: var(--status-urgente-bg); color: var(--status-urgente-fg); }
.badge-novo { background: rgba(212,175,112,0.1); color: var(--gold-light); }

/* ============ Timeline (Agenda) ============ */
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: none; padding-bottom: 0; }
.timeline-time { width: 52px; flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--gold); padding-top: 2px; }
.timeline-dot-col { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); margin-top: 6px; box-shadow: 0 0 0 3px rgba(212,175,112,0.15); }
.timeline-body { flex: 1; }
.timeline-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.timeline-meta { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }

/* ============ Task list ============ */
.task-list { display: flex; flex-direction: column; }
.task-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.task-item:last-child { border-bottom: none; padding-bottom: 0; }
.task-check {
  width: 19px; height: 19px; border-radius: 5px; border: 1.5px solid var(--border-strong);
  flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center;
  background: transparent; transition: all 150ms var(--ease);
}
.task-check:hover { border-color: var(--gold); }
.task-check.checked { background: var(--gold); border-color: var(--gold); color: #201007; }
.task-body { flex: 1; }
.task-title { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.task-meta { font-size: 12px; color: var(--text-muted); }
.task-due { font-size: 12px; font-weight: 600; color: var(--gold); white-space: nowrap; }
.task-due.overdue { color: #d68a68; }

/* ============ Activity feed ============ */
.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--gold); font-size: 13px;
}
.activity-body { flex: 1; }
.activity-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.activity-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.5; }
.activity-time { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }

/* ============ Forms ============ */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.form-field input, .form-field select, .form-field textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; color: var(--text); font-size: 13.5px;
  transition: border-color 150ms var(--ease), background 150ms var(--ease);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--gold); background: var(--surface-2);
}
.form-field textarea { resize: vertical; min-height: 80px; }
.form-field .error { color: #d68a68; font-size: 11.5px; }
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--text-faint); }

/* ============ Search / Filters ============ */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.search-input { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.search-input i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 13px; }
.search-input input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px 10px 34px; color: var(--text); font-size: 13.5px;
}
.search-input input:focus { outline: none; border-color: var(--gold); }
.filter-select {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; color: var(--text-muted); font-size: 13px;
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tab {
  padding: 10px 16px; font-size: 13.5px; color: var(--text-muted); font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 150ms var(--ease), border-color 150ms var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); border-color: var(--gold); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border); color: var(--text-muted); background: var(--surface);
}
.chip.active { color: #201007; background: var(--gold); border-color: var(--gold); }

/* ============ Empty state ============ */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state i { font-size: 34px; color: var(--brown-light); margin-bottom: 14px; }
.empty-state p { font-size: 13.5px; }

/* ============ Skeleton ============ */
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============ Modal ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(8,4,2,0.7); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  animation: fadeIn 180ms var(--ease);
}
.modal-overlay.show { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated); max-width: 640px; width: 100%; max-height: 88vh; overflow-y: auto;
  animation: modalIn 200ms var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 20px; color: var(--champagne); }
.modal-close { background: none; border: none; color: var(--text-faint); font-size: 18px; width: 32px; height: 32px; border-radius: 50%; }
.modal-close:hover { background: var(--surface); color: var(--text); }
.modal-body { padding: 22px 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); }

/* ============ Toast ============ */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 260px; max-width: 360px; padding: 13px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow-elevated);
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text);
  animation: toastIn 200ms var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.toast.success i { color: #9caf7c; }
.toast.error i { color: #d68a68; }

/* ============ Kanban ============ */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: start; }
.kanban-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; }
.kanban-col-title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 12px; display: flex; justify-content: space-between; }
.kanban-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; }
.kanban-card-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.kanban-card-meta { font-size: 11.5px; color: var(--text-muted); }

/* ============ Login ============ */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--background); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-elevated); padding: 40px 36px; }
.login-logo { display: flex; justify-content: center; margin-bottom: 22px; }
.login-logo img { height: 78px; }
.login-card h1 { text-align: center; font-size: 24px; margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
.login-error { background: rgba(155,74,46,0.14); border: 1px solid rgba(155,74,46,0.3); color: #d68a68; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.login-footer { text-align: center; margin-top: 18px; font-size: 12px; color: var(--text-faint); }

/* ============ Responsive ============ */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-elevated); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .menu-toggle { display: flex; }
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .topbar-date { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 24px; }
}

.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 39;
}
.sidebar-backdrop.show { display: block; }

/* Utility */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }

/* ============ Painel Admin ============ */
.admin-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px;
  color: var(--text-muted); font-size: 14px; font-weight: 600; border-bottom: 2px solid transparent;
  transition: color 150ms var(--ease), border-color 150ms var(--ease);
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.admin-tab i { color: var(--gold); opacity: 0.8; font-size: 13px; }

.logo-preview-box {
  display: flex; align-items: center; justify-content: center;
  background: var(--background-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
  padding: 24px; min-height: 130px;
}
.logo-preview-box img { max-height: 90px; max-width: 100%; object-fit: contain; }

.color-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px;
}
.color-field label { display: block; font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; }
.color-input-row {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 10px;
}
.color-input-row input[type="color"] {
  width: 36px; height: 36px; border: none; border-radius: 6px; background: none; cursor: pointer; padding: 0;
}
.color-hex { font-size: 12.5px; color: var(--text-faint); font-family: monospace; text-transform: uppercase; }

.btn-icon-sm {
  width: 30px; height: 30px; border-radius: 7px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; margin-left: 4px;
  transition: background 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
}
.btn-icon-sm:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-icon-danger:hover { color: #d68a68; border-color: rgba(155,74,46,0.4); }
.modal-sm { max-width: 420px; }
