/* ============================================================
   Aurea ERP — supplemental styles (beyond Tailwind utilities)
   ============================================================ */

:root {
  --accent: #1C1B19;
  --accent-dark: #000000;
  --accent-light: #FFFFFF;
  --ink: #1C1B19;
  --canvas: #F7F7F5;
}

html, body {
  background: var(--canvas);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.font-serif-display {
  font-family: 'Fraunces', ui-serif, Georgia, serif;
}

/* ---------- Scrollbars ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: #D8D6D0 transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #D8D6D0; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #C2BFB6; }

/* ---------- App shell ---------- */
#app-shell { transition: padding-left .18s ease; }
@media (min-width: 1024px) {
  #app-shell { padding-left: 16rem; }
  #app-shell.sidebar-collapsed { padding-left: 4.5rem; }
}
#app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247,247,245,.88);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #EDEBE5;
}

/* ---------- Sidebar ---------- */
#app-sidebar {
  transition: width .18s ease, transform .18s ease;
}
#app-sidebar.collapsed { width: 4.5rem; }
#app-sidebar.collapsed .nav-group-body { height: 0 !important; }
#app-sidebar .nav-label,
#app-sidebar .nav-group-caret,
#app-sidebar .brand-text { transition: opacity .12s ease; }
#app-sidebar.collapsed .nav-label,
#app-sidebar.collapsed .nav-group-caret,
#app-sidebar.collapsed .brand-text { opacity: 0; pointer-events: none; }

.nav-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .75rem;
  border-radius: .65rem;
  font-size: .84rem;
  font-weight: 500;
  color: #57544c;
  transition: background .12s ease, color .12s ease;
  white-space: nowrap;
}
.nav-link:hover { background: #EFEDE7; color: var(--ink); }
.nav-link.active {
  background: rgba(28,27,25,0.1);
  color: var(--accent-dark);
}
.nav-link.active .nav-icon { color: var(--accent); }
.nav-sublink {
  display: block;
  padding: .4rem .75rem .4rem 2.6rem;
  border-radius: .5rem;
  font-size: .8rem;
  color: #6b6860;
  transition: background .12s ease, color .12s ease;
}
.nav-sublink:hover { background: #EFEDE7; color: var(--ink); }
.nav-sublink.active { color: var(--accent-dark); font-weight: 600; background: rgba(28,27,25,0.08); }

.nav-group-body { overflow: hidden; }

@media (max-width: 1023px) {
  #app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    z-index: 50;
    box-shadow: 0 0 0 rgba(0,0,0,0);
  }
  #app-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 24px 0 48px rgba(0,0,0,.18);
  }
}

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid #EDEBE5;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(28,27,25,0.04), 0 4px 16px rgba(28,27,25,0.05);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .18rem .6rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
.badge-dot { width: .4rem; height: .4rem; border-radius: 999px; }

.badge-gray   { background:#F1F0EC; color:#57544c; }
.badge-gray  .badge-dot { background:#9c988c; }
.badge-blue   { background:#E8E7E3; color:#2b2a27; }
.badge-blue  .badge-dot { background:#6b6860; }
.badge-amber  { background:#EDEBE5; color:#4a473d; }
.badge-amber .badge-dot { background:#8a877d; }
.badge-green  { background:#1C1B19; color:#F7F7F5; }
.badge-green .badge-dot { background:#F7F7F5; }
.badge-red    { background:#fff; color:#1C1B19; border:1px solid #1C1B19; }
.badge-red   .badge-dot { background:#1C1B19; }
.badge-purple { background:#DAD8D0; color:#2b2a27; }
.badge-purple .badge-dot { background:#57544c; }
.badge-gold   { background:rgba(28,27,25,0.12); color:var(--accent-dark); }
.badge-gold  .badge-dot { background:var(--accent); }

/* ---------- Tables ---------- */
.data-table thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #8a877d;
  font-weight: 600;
  text-align: left;
  padding: .7rem 1rem;
  border-bottom: 1px solid #EDEBE5;
  white-space: nowrap;
}
.data-table thead th.sortable { cursor: pointer; user-select: none; }
.data-table thead th.sortable:hover { color: var(--ink); }
.data-table tbody td {
  padding: .8rem 1rem;
  font-size: .85rem;
  border-bottom: 1px solid #F2F0EA;
  color: #3a382f;
}
.data-table tbody tr:hover { background: #FBFAF7; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ---------- Kanban ---------- */
.kanban-col { min-width: 270px; }
.kanban-dropzone {
  min-height: 140px;
  transition: background .12s ease, box-shadow .12s ease;
  border-radius: .85rem;
}
.kanban-dropzone.drag-over {
  background: rgba(28,27,25,0.06);
  box-shadow: inset 0 0 0 2px rgba(28,27,25,0.35);
}
.kanban-card {
  cursor: grab;
  transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .35; }
.kanban-card.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 60;
  opacity: .92;
  transform: rotate(2deg);
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
}

/* ---------- Modal ---------- */
.modal-backdrop {
  background: rgba(28,27,25,.45);
  backdrop-filter: blur(2px);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-panel { animation: modal-in .16s ease-out; }

/* ---------- Toast ---------- */
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast { animation: toast-in .18s ease-out; }

/* ---------- Misc ---------- */
.focus-ring:focus { outline: none; box-shadow: 0 0 0 3px rgba(28,27,25,.25); border-color: var(--accent); }
.dropzone-highlight { background: rgba(28,27,25,.06); box-shadow: inset 0 0 0 2px rgba(28,27,25,.3); }

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #57544c, var(--accent-dark));
  color: #fff;
}

[data-lucide] { width: 1em; height: 1em; }

/* ---------- Print ---------- */
@media print {
  #app-sidebar, #app-topbar, #app-footer, #sidebar-backdrop, .no-print { display: none !important; }
  #app-shell { padding-left: 0 !important; }
  main { padding: 0 !important; }
  body { background: #fff !important; }
  .card { box-shadow: none !important; }
}
