@import "tailwindcss";

:root {
  --color-primary:        #22c55e;
  --color-primary-light:  #064e3b;
  --color-primary-dark:   #16a34a;
  --color-bg:             #030712;
  --color-surface:        #111827;
  --color-surface-hover:  #1f2937;
  --color-border:         #1f2937;
  --color-sidebar-bg:     #0b0f19;

  --color-text-1:         #f3f4f6;
  --color-text-2:         #9ca3af;
  --color-text-3:         #6b7280;

  --color-success:        #22c55e;
  --color-success-bg:     #064e3b;
  --color-warning:        #eab308;
  --color-warning-bg:     #713f12;
  --color-danger:         #ef4444;
  --color-danger-bg:      #7f1d1d;
  --color-info:           #0ea5e9;
  --color-info-bg:        #0c4a6e;

  --radius-sm:  6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.5);
}

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

body {
  font-family: 'Inter', 'Outfit', system-ui, sans-serif;
  background: var(--color-bg);
  color: var(--color-text-1);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 10px; }

/* ─── LAYOUT ──────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── SIDEBAR ─────────────────────────────── */
#sidebar {
  width: 230px;
  min-width: 230px;
  background: var(--color-sidebar-bg);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
  transition: width 0.25s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--color-border);
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--color-primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.logo-text h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-1);
  line-height: 1.2;
}
.logo-text p {
  font-size: 11px;
  color: var(--color-text-3);
  font-weight: 400;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-3);
  padding: 20px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  margin: 1px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-2);
  transition: background 0.15s, color 0.15s;
  border: none;
  background: transparent;
  width: calc(100% - 20px);
  text-align: left;
}

.nav-item:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-1);
}

.nav-item.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 500;
  border-left: 3px solid var(--color-primary);
}

.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

/* ─── MAIN ────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── TOPBAR ──────────────────────────────── */
#topbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.topbar-left h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text-1);
}

.topbar-left p {
  font-size: 12px;
  color: var(--color-text-3);
  margin-top: 1px;
}

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

.btn-filter {
  padding: 7px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-2);
  font-size: 12px;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-filter:hover { background: var(--color-surface-hover); }

.btn-primary {
  padding: 8px 16px;
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-1px); box-shadow: 0 0 15px rgba(34, 197, 94, 0.5); }
.btn-primary:active { transform: translateY(0); }

.avatar-top {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--color-primary-dark);
}

/* ─── CONTENT ─────────────────────────────── */
#content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

/* ─── VIEWS ───────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ─── METRIC CARDS ────────────────────────── */
.metrics-group { margin-bottom: 22px; }
.metrics-group-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-3);
  margin-bottom: 10px;
}

.metrics-grid {
  display: grid;
  gap: 12px;
}
.metrics-grid-3 { grid-template-columns: repeat(3, 1fr); }
.metrics-grid-4 { grid-template-columns: repeat(4, 1fr); }
.mb-22 { margin-bottom: 22px; }

.metric-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.metric-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: rgba(34, 197, 94, 0.3); }

.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px 0 0 3px;
  opacity: 0;
  transition: opacity 0.2s;
}
.metric-card:hover::before { opacity: 1; }

.metric-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text-1);
  line-height: 1.1;
}

.metric-delta {
  font-size: 11px;
  color: var(--color-text-3);
  margin-top: 5px;
}

.metric-delta.up   { color: var(--color-success); }
.metric-delta.down { color: var(--color-danger);  }

/* ─── CHARTS SECTION ──────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

.chart-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.chart-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 16px;
}

/* ─── SIMPLE BAR CHART ────────────────────── */
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 120px; }
.bar-group { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; }
.bar {
  width: 100%;
  background: var(--color-primary);
  border-radius: 4px 4px 0 0;
  transition: opacity 0.2s;
  min-height: 4px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.2);
}
.bar:hover { opacity: 0.8; box-shadow: 0 0 15px rgba(34, 197, 94, 0.5); }
.bar-label { font-size: 10px; color: var(--color-text-3); }

/* ─── FUNIL ───────────────────────────────── */
.funil-item { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.funil-label { font-size: 11px; color: var(--color-text-2); width: 90px; flex-shrink: 0; text-align: right; }
.funil-bar-wrap { flex: 1; background: var(--color-bg); border-radius: 4px; height: 10px; overflow: hidden; }
.funil-bar { height: 100%; border-radius: 4px; transition: width 0.8s ease; }
.funil-count { font-size: 11px; color: var(--color-text-2); width: 24px; text-align: right; font-weight: 600; }

/* ─── DASHBOARD BOTTOM ROW ────────────────── */
.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.list-container {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.list-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.list-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-1);
}
.list-item-meta {
  font-size: 11px;
  color: var(--color-text-2);
}
.list-item-meta strong {
  color: var(--color-text-1);
}
.list-progress-wrap {
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}
.list-progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
}

.table-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-2);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--color-surface-hover);
}

table { width: 100%; border-collapse: collapse; }
th {
  background: var(--color-sidebar-bg);
  padding: 8px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--color-border);
}
td {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--color-text-1);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover td { background: var(--color-surface-hover); cursor: pointer; }

/* ─── AGENDA SLOT ─────────────────────────── */
.agenda-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.1s;
}
.agenda-slot:last-child { border-bottom: none; }
.agenda-slot:hover { background: var(--color-surface-hover); }
.slot-time { font-size: 12px; font-weight: 600; color: var(--color-text-2); width: 44px; flex-shrink: 0; }
.slot-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.slot-dot.confirmed { background: var(--color-success); }
.slot-dot.pending   { background: var(--color-warning); }
.slot-info { flex: 1; }
.slot-name { font-size: 13px; font-weight: 500; color: var(--color-text-1); }
.slot-proc { font-size: 11px; color: var(--color-text-3); margin-top: 1px; }

/* ─── TAREFA PENDENTE ─────────────────────── */
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-text-2);
  transition: background 0.1s;
}
.task-item:last-child { border-bottom: none; }
.task-item:hover { background: var(--color-surface-hover); }
.task-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.task-check:hover { border-color: var(--color-primary); }
.task-check.done { background: var(--color-primary); border-color: var(--color-primary); }

/* ─── BADGES ──────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-success { background: var(--color-success-bg); color: var(--color-success); border: 1px solid rgba(34, 197, 94, 0.2); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid rgba(234, 179, 8, 0.2); }
.badge-danger  { background: var(--color-danger-bg);  color: var(--color-danger);  border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-info    { background: var(--color-info-bg);    color: var(--color-info);    border: 1px solid rgba(14, 165, 233, 0.2); }
.badge-neutral { background: var(--color-bg); color: var(--color-text-2); border: 1px solid var(--color-border); }

/* ─── AVATAR ──────────────────────────────── */
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--color-primary-dark);
}

.td-flex { display: flex; align-items: center; gap: 8px; }

/* ─── KANBAN ──────────────────────────────── */
#view-kanban #content-inner {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  height: 100%;
}

.kanban-col {
  min-width: 240px;
  max-width: 240px;
  background: var(--color-sidebar-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kanban-col-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-2);
  margin-bottom: 3px;
}
.kanban-col-title .col-dot { width: 7px; height: 7px; border-radius: 50%; }
.kanban-count { font-size: 10px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 10px; padding: 1px 6px; color: var(--color-text-3); }
.kanban-total { font-size: 11px; color: var(--color-text-3); margin-top: 2px; }

.kanban-cards { flex: 1; overflow-y: auto; padding: 10px 10px; display: flex; flex-direction: column; gap: 8px; }

.kanban-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: grab;
  transition: box-shadow 0.2s, transform 0.15s;
  position: relative;
}
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--color-primary); }
.kanban-card:active { cursor: grabbing; }

.kanban-card-priority {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.priority-high { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid rgba(234, 179, 8, 0.2); }
.priority-mid  { background: var(--color-info-bg);    color: var(--color-info);    border: 1px solid rgba(14, 165, 233, 0.2); }
.priority-low  { background: var(--color-bg);          color: var(--color-text-3); border: 1px solid var(--color-border); }

.kanban-card h4 { font-size: 13px; font-weight: 600; color: var(--color-text-1); margin-bottom: 5px; }
.kanban-card-meta { font-size: 11px; color: var(--color-text-3); margin-bottom: 2px; }
.kanban-card-meta span { color: var(--color-text-2); font-weight: 500; }
.kanban-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--color-border); }
.kanban-price { font-size: 13px; font-weight: 700; color: var(--color-primary); }

.kanban-drag-over { background: var(--color-primary-light); border: 2px dashed var(--color-primary); }

/* ─── CALENDAR ────────────────────────────── */
.calendar-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.cal-nav-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--color-text-2);
  transition: all 0.15s;
}
.cal-nav-btn:hover { background: var(--color-primary-light); color: var(--color-primary); border-color: var(--color-primary); }
.cal-month { font-size: 16px; font-weight: 600; color: var(--color-text-1); }

.cal-table { width: 100%; border-collapse: collapse; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.cal-table thead th { padding: 10px 6px; font-size: 11px; font-weight: 600; color: var(--color-text-3); text-align: center; background: var(--color-sidebar-bg); border-bottom: 1px solid var(--color-border); }
.cal-table td { vertical-align: top; padding: 6px; width: calc(100%/7); border: 1px solid var(--color-border); height: 90px; font-size: 12px; }
.cal-table td:hover { background: var(--color-surface-hover); }
.cal-day-num { font-size: 12px; font-weight: 600; color: var(--color-text-2); margin-bottom: 4px; }
.cal-day-num.today { width: 24px; height: 24px; background: var(--color-primary); color: #000; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; }
.cal-event { font-size: 10px; background: var(--color-primary-light); color: var(--color-primary); border: 1px solid rgba(34, 197, 94, 0.3); border-radius: 3px; padding: 2px 5px; margin-bottom: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-event.blue { background: var(--color-info-bg); color: var(--color-info); border: 1px solid rgba(14, 165, 233, 0.3); }
.cal-event.green { background: var(--color-success-bg); color: var(--color-success); border: 1px solid rgba(34, 197, 94, 0.3); }
.cal-cell-empty { background: var(--color-bg); opacity: 0.5; }

/* ─── MODAL ───────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  padding: 24px;
  width: 480px;
  max-width: 95vw;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  animation: modal-in 0.2s ease;
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: none; } }

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 16px; font-weight: 600; color: var(--color-text-1); }
.modal-close { width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--color-bg); cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; color: var(--color-text-3); transition: background 0.15s; }
.modal-close:hover { background: var(--color-border); color: #fff; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.form-group label { font-size: 11px; font-weight: 600; color: var(--color-text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input, .form-group select {
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  background: var(--color-bg);
  color: var(--color-text-1);
  transition: border-color 0.15s;
  outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: var(--color-primary); background: var(--color-sidebar-bg); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--color-border); }

/* ─── ANIMATIONS ──────────────────────────── */
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fade-up 0.35s ease both; }
.fade-up:nth-child(1) { animation-delay: 0.05s; }
.fade-up:nth-child(2) { animation-delay: 0.10s; }
.fade-up:nth-child(3) { animation-delay: 0.15s; }
.fade-up:nth-child(4) { animation-delay: 0.20s; }
