/* =========================================================
   FluxoPro - Stylesheet
   ========================================================= */

:root {
  --primary:        #4361ee;
  --primary-dark:   #3347c8;
  --primary-light:  #eef1fd;
  --success:        #2ec4b6;
  --warning:        #ff9f1c;
  --danger:         #e63946;
  --info:           #48cae4;
  --sidebar-bg:     #0f172a;
  --sidebar-hover:  rgba(255,255,255,.07);
  --sidebar-active: rgba(67,97,238,.25);
  --sidebar-width:  260px;
  --topbar-h:       62px;
  --text-primary:   #1e293b;
  --text-secondary: #64748b;
  --border:         #e2e8f0;
  --bg-body:        #f1f5f9;
  --card-bg:        #ffffff;
  --radius:         12px;
  --shadow:         0 2px 12px rgba(0,0,0,.08);
  --shadow-md:      0 4px 24px rgba(0,0,0,.12);
  --transition:     .25s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* ── Scrollbar ──────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9px; }

/* ── Layout ─────────────────────────────── */
.wrapper { display: flex; min-height: 100vh; }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  transition: margin-left var(--transition);
  display: flex;
  flex-direction: column;
}

.sidebar-collapsed .main-content { margin-left: 72px; }

/* ── Sidebar ─────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  transition: width var(--transition);
  z-index: 1040;
  overflow: hidden;
}

.sidebar-collapsed .sidebar { width: 72px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  white-space: nowrap;
  overflow: hidden;
}

.brand-logo {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  color: white;
  letter-spacing: -.3px;
  transition: opacity var(--transition);
}

.sidebar-collapsed .brand-name { opacity: 0; pointer-events: none; }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 0; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }

.sidebar-nav .nav-item { list-style: none; }

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: 8px;
  margin: 1px 8px;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.sidebar-nav .nav-link:hover { background: var(--sidebar-hover); color: #e2e8f0; }
.sidebar-nav .nav-link.active { background: var(--sidebar-active); color: #818cf8; }
.sidebar-nav .nav-link.active .nav-icon { color: #818cf8; }

.nav-icon { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-label { transition: opacity var(--transition); }
.sidebar-collapsed .nav-label { opacity: 0; pointer-events: none; }
.sidebar-collapsed .nav-section { opacity: 0; }

.nav-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #475569;
  padding: 14px 26px 4px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.sidebar-footer {
  padding: 14px 8px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar-logout {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  color: #ef4444;
  text-decoration: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--transition);
  white-space: nowrap;
}
.sidebar-logout:hover { background: rgba(239,68,68,.1); color: #ef4444; }
.sidebar-collapsed .sidebar-logout span { opacity: 0; }

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

/* ── Topbar ──────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

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

.sidebar-toggle {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 16px;
  transition: background var(--transition);
}
.sidebar-toggle:hover { background: var(--primary-light); color: var(--primary); }

.page-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }

.user-btn {
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px; padding: 4px 8px;
  border-radius: 8px; transition: background var(--transition);
}
.user-btn:hover { background: var(--primary-light); }

.user-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-avatar-placeholder {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}

.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }

.badge-dot {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--danger); color: white;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ── Content Area ────────────────────────── */
.content-area {
  flex: 1;
  padding: 28px 28px 40px;
  max-width: 1440px;
  width: 100%;
}

/* ── Cards ───────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  font-weight: 600;
  font-size: 14.5px;
}

.card-body { padding: 20px; }

/* Stat Cards */
.stat-card {
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  color: white;
  box-shadow: var(--shadow-md);
  border: none;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,.18); }

.stat-card .stat-icon {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 48px; opacity: .2;
}
.stat-card .stat-label { font-size: 12px; font-weight: 500; opacity: .85; margin-bottom: 4px; }
.stat-card .stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-card .stat-sub { font-size: 11px; opacity: .75; margin-top: 6px; }

.bg-gradient-primary { background: linear-gradient(135deg, #4361ee, #3a86ff); }
.bg-gradient-success { background: linear-gradient(135deg, #2ec4b6, #06d6a0); }
.bg-gradient-warning { background: linear-gradient(135deg, #ff9f1c, #ffb347); }
.bg-gradient-danger  { background: linear-gradient(135deg, #e63946, #ff6b6b); }
.bg-gradient-info    { background: linear-gradient(135deg, #48cae4, #0096c7); }
.bg-gradient-purple  { background: linear-gradient(135deg, #7b2d8b, #a855f7); }
.bg-gradient-teal    { background: linear(135deg, #0d9488, #2dd4bf); }
.bg-gradient-indigo  { background: linear-gradient(135deg, #4338ca, #6366f1); }
.bg-gradient-rose    { background: linear-gradient(135deg, #e11d48, #f43f5e); }

/* Chart Cards */
.chart-card { border-radius: var(--radius); background: var(--card-bg); border: 1px solid var(--border); box-shadow: var(--shadow); }
.chart-card .chart-header { padding: 16px 20px 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.chart-card .chart-title { font-size: 14px; font-weight: 600; }
.chart-card canvas { max-height: 280px; }

/* ── Tables ──────────────────────────────── */
.table-card { overflow: hidden; }
.table { margin: 0; font-size: 13.5px; }
.table thead th {
  background: #f8fafc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.table tbody td { padding: 13px 16px; vertical-align: middle; border-color: #f1f5f9; }
.table tbody tr:hover { background: #f8fafc; }
.table-striped tbody tr:nth-of-type(odd) { background-color: #fafbfc; }

/* ── Buttons ─────────────────────────────── */
.btn { border-radius: 8px; font-weight: 500; font-size: 13px; transition: all var(--transition); }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 6px; }
.btn-icon { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* ── Forms ───────────────────────────────── */
.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13.5px;
  padding: 8px 12px;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67,97,238,.12);
}
.form-label { font-size: 13px; font-weight: 500; margin-bottom: 5px; color: var(--text-primary); }

/* ── Badges ──────────────────────────────── */
.badge { font-size: 11px; padding: 4px 8px; border-radius: 6px; font-weight: 600; }

/* ── Progress ────────────────────────────── */
.progress { border-radius: 99px; height: 6px; }
.progress-bar { border-radius: 99px; }

/* ── Modal ───────────────────────────────── */
.modal-content { border-radius: 14px; border: none; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-header { border-bottom: 1px solid var(--border); padding: 18px 24px; }
.modal-footer { border-top: 1px solid var(--border); padding: 14px 24px; }
.modal-title { font-size: 16px; font-weight: 600; }

/* ── Page Header ─────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 { font-size: 20px; font-weight: 700; margin: 0; }

/* ── Search Bar ──────────────────────────── */
.search-box { position: relative; }
.search-box .form-control { padding-left: 36px; border-radius: 8px; }
.search-box .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); pointer-events: none; }

/* ── Filters ─────────────────────────────── */
.filter-bar { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; box-shadow: var(--shadow); }

/* ── Empty State ─────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .empty-icon { font-size: 56px; margin-bottom: 14px; opacity: .25; }
.empty-state h5 { font-weight: 600; margin-bottom: 6px; }
.empty-state p { color: var(--text-secondary); font-size: 13px; }

/* ── Avatar ──────────────────────────────── */
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-initials {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}

/* ── Login Page ──────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -20%, rgba(67,97,238,.35), transparent);
}

.login-card {
  background: white; border-radius: 20px;
  padding: 48px 44px; width: 100%; max-width: 440px;
  box-shadow: 0 32px 80px rgba(0,0,0,.35);
  position: relative; z-index: 1;
}

.login-brand { text-align: center; margin-bottom: 36px; }
.login-brand .logo-icon {
  width: 60px; height: 60px; border-radius: 16px;
  background: var(--primary); color: white;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 26px; margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(67,97,238,.4);
}
.login-brand h1 { font-size: 26px; font-weight: 800; margin: 0; color: var(--text-primary); }
.login-brand p { color: var(--text-secondary); margin: 4px 0 0; font-size: 13px; }

/* ── Misc ────────────────────────────────── */
.text-money { font-weight: 700; font-size: 15px; }
.text-money.positive { color: #16a34a; }
.text-money.negative { color: var(--danger); }

.separator { border: none; border-top: 1px solid var(--border); margin: 0; }

.action-btns .btn { margin: 0 2px; }

.fs-12 { font-size: 12px !important; }
.fs-13 { font-size: 13px !important; }
.fw-600 { font-weight: 600 !important; }

/* ── Kanban / Status columns ─────────────── */
.status-col { background: #f8fafc; border-radius: var(--radius); padding: 14px; min-height: 200px; }
.status-col-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; color: var(--text-secondary); }

/* ── Timeline ────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content:''; position:absolute; left:10px; top:0; bottom:0; width:2px; background:var(--border); }
.timeline-item { position:relative; margin-bottom:20px; }
.timeline-item::before { content:''; position:absolute; left:-22px; top:4px; width:10px; height:10px; border-radius:50%; background:var(--primary); border:2px solid white; box-shadow:0 0 0 2px var(--primary); }

/* ── Responsive ──────────────────────────── */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-width) !important; transition: transform var(--transition); }
  .sidebar.show { transform: translateX(0); }
  .sidebar.show ~ .sidebar-overlay { display: block; }
  .main-content { margin-left: 0 !important; }
  .content-area { padding: 16px 16px 32px; }
  .sidebar-collapsed .main-content { margin-left: 0; }
}

@media (max-width: 576px) {
  .content-area { padding: 12px 12px 28px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .stat-card .stat-value { font-size: 18px; }
}
