/* ═══════════════════════════════════════════════════════════════
   GIRI COMPTA — Premium Accounting Interface
   Pattern: Giri Soins sidebar + main content
   Namespace: .gc-*
   ═══════════════════════════════════════════════════════════════ */

/* ── Layout ── */
.gc-app {
  display: flex;
  height: 100%;
  min-height: calc(100vh - 60px);
  background: var(--bg-primary, #0a0e17);
  color: var(--text, #e2e8f0);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.gc-sidebar {
  width: 260px;
  min-width: 260px;
  background: linear-gradient(180deg, rgba(15,20,35,0.98) 0%, rgba(10,14,23,0.99) 100%);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
  z-index: 10;
}

.gc-sidebar-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.gc-sidebar-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  letter-spacing: -0.02em;
}
.gc-sidebar-header h2 span {
  color: var(--accent, #b8944a);
  font-weight: 700;
}
.gc-sidebar-header p {
  font-size: 0.8rem;
  color: var(--text-secondary, #94a3b8);
  margin: 6px 0 0;
}

/* ── Navigation ── */
.gc-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gc-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  font-size: 0.875rem;
  font-weight: 450;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}
.gc-nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text, #e2e8f0);
}
.gc-nav-item.active {
  background: linear-gradient(135deg, rgba(184,148,74,0.12) 0%, rgba(184,148,74,0.06) 100%);
  color: var(--accent, #b8944a);
  font-weight: 550;
}
.gc-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}
.gc-nav-item.active svg { opacity: 1; }
.gc-nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 8px 16px;
}

/* ── Sidebar footer ── */
.gc-sidebar-footer {
  padding: 16px 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── Main content ── */
.gc-main {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.gc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(10,14,23,0.85);
}
.gc-topbar-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}
.gc-topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.gc-content {
  flex: 1;
  padding: 28px 32px;
}

/* ── Cards ── */
.gc-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 24px;
  transition: border-color 0.2s;
}
.gc-card:hover { border-color: rgba(255,255,255,0.1); }
.gc-card-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #94a3b8);
  margin: 0 0 12px;
  font-weight: 550;
}

/* ── KPIs ── */
.gc-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.gc-kpi {
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}
.gc-kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-size: 1.1rem;
}
.gc-kpi-icon.income { background: rgba(74,222,128,0.12); color: #4ade80; }
.gc-kpi-icon.expense { background: rgba(248,113,113,0.12); color: #f87171; }
.gc-kpi-icon.net { background: rgba(96,165,250,0.12); color: #60a5fa; }
.gc-kpi-icon.clients { background: rgba(184,148,74,0.12); color: #b8944a; }
.gc-kpi-icon.mrr { background: rgba(168,85,247,0.12); color: #a855f7; }
.gc-kpi-icon.bank { background: rgba(45,212,191,0.12); color: #2dd4bf; }
.gc-kpi-label {
  font-size: 0.75rem;
  color: var(--text-secondary, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.gc-kpi-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
  margin-top: 4px;
  letter-spacing: -0.02em;
}
.gc-kpi-value.positive { color: #4ade80; }
.gc-kpi-value.negative { color: #f87171; }

/* ── Buttons ── */
.gc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 10px;
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.gc-btn-primary {
  background: linear-gradient(135deg, #b8944a 0%, #9a7a3c 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(184,148,74,0.25);
}
.gc-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(184,148,74,0.35); }
.gc-btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text, #e2e8f0);
  border: 1px solid rgba(255,255,255,0.08);
}
.gc-btn-secondary:hover { background: rgba(255,255,255,0.1); }
.gc-btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.gc-btn-danger { background: rgba(248,113,113,0.15); color: #f87171; border: 1px solid rgba(248,113,113,0.2); }
.gc-btn-danger:hover { background: rgba(248,113,113,0.25); }
.gc-btn-success { background: rgba(74,222,128,0.15); color: #4ade80; }

/* ── Table ── */
.gc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.gc-table thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary, #94a3b8);
  font-weight: 550;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.gc-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.15s;
  cursor: pointer;
}
.gc-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.gc-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

/* ── Forms ── */
.gc-input, .gc-select, .gc-textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--text, #e2e8f0);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.gc-input:focus, .gc-select:focus, .gc-textarea:focus {
  outline: none;
  border-color: var(--accent, #b8944a);
  box-shadow: 0 0 0 3px rgba(184,148,74,0.12);
}
.gc-input::placeholder { color: rgba(148,163,184,0.5); }
.gc-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 6px;
}
.gc-form-group { margin-bottom: 18px; }
.gc-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Avatar ── */
.gc-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
}

/* ── Status badges ── */
.gc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 550;
}
.gc-badge-active { background: rgba(74,222,128,0.12); color: #4ade80; }
.gc-badge-paused { background: rgba(251,191,36,0.12); color: #fbbf24; }
.gc-badge-churned { background: rgba(248,113,113,0.12); color: #f87171; }
.gc-badge-prospect { background: rgba(96,165,250,0.12); color: #60a5fa; }
.gc-badge-draft { background: rgba(148,163,184,0.12); color: #94a3b8; }
.gc-badge-sent { background: rgba(96,165,250,0.12); color: #60a5fa; }
.gc-badge-paid { background: rgba(74,222,128,0.12); color: #4ade80; }
.gc-badge-overdue { background: rgba(248,113,113,0.12); color: #f87171; }
.gc-badge-income { background: rgba(74,222,128,0.1); color: #4ade80; }
.gc-badge-expense { background: rgba(248,113,113,0.1); color: #f87171; }
.gc-badge-completed { background: rgba(74,222,128,0.12); color: #4ade80; }
.gc-badge-cancelled { background: rgba(148,163,184,0.12); color: #94a3b8; }

/* ── Calendar / Agenda ── */
.gc-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.gc-cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.gc-cal-header span {
  text-align: center;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary, #94a3b8);
  padding: 8px 0;
  font-weight: 550;
}
.gc-cal-day {
  min-height: 90px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 8px;
  font-size: 0.8rem;
  position: relative;
  transition: border-color 0.2s;
}
.gc-cal-day:hover { border-color: rgba(255,255,255,0.08); }
.gc-cal-day.today { border-color: var(--accent, #b8944a); background: rgba(184,148,74,0.04); }
.gc-cal-day.other-month { opacity: 0.35; }
.gc-cal-day-num {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 4px;
}
.gc-cal-day.today .gc-cal-day-num { color: var(--accent, #b8944a); }
.gc-cal-event {
  font-size: 0.65rem;
  padding: 3px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.gc-cal-event.income {
  background: rgba(74,222,128,0.12);
  color: #4ade80;
  border-left: 2px solid #4ade80;
}

/* ── Charts (simple CSS) ── */
.gc-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 180px;
  padding: 16px 0;
}
.gc-chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.gc-chart-bar-fill {
  width: 100%;
  max-width: 40px;
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
  transition: height 0.4s ease;
}
.gc-chart-bar-fill.income { background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%); }
.gc-chart-bar-fill.expense { background: linear-gradient(180deg, #f87171 0%, #ef4444 100%); }
.gc-chart-bar-label {
  font-size: 0.65rem;
  color: var(--text-secondary, #94a3b8);
  text-align: center;
}

/* ── Upcoming payments list ── */
.gc-upcoming {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gc-upcoming-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px;
  transition: all 0.2s;
}
.gc-upcoming-item:hover { border-color: rgba(255,255,255,0.08); }
.gc-upcoming-date {
  min-width: 50px;
  text-align: center;
}
.gc-upcoming-date-day {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}
.gc-upcoming-date-month {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #94a3b8);
}
.gc-upcoming-info { flex: 1; }
.gc-upcoming-name { font-weight: 550; color: #fff; font-size: 0.9rem; }
.gc-upcoming-desc { font-size: 0.8rem; color: var(--text-secondary, #94a3b8); margin-top: 2px; }
.gc-upcoming-amount { font-weight: 600; color: #4ade80; font-size: 1rem; }

/* ── Modal ── */
.gc-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: gc-fadeIn 0.2s;
}
.gc-modal {
  background: var(--bg-secondary, #111827);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  width: 560px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.gc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.gc-modal-title { font-size: 1.15rem; font-weight: 600; color: #fff; }
.gc-modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.06); border: none;
  color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: all 0.2s;
}
.gc-modal-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.gc-modal-body { padding: 24px 28px; }
.gc-modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 18px 28px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ── Empty state ── */
.gc-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary, #94a3b8);
}
.gc-empty-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.gc-empty-title { font-size: 1.1rem; font-weight: 550; color: var(--text, #e2e8f0); margin-bottom: 8px; }
.gc-empty-desc { font-size: 0.875rem; max-width: 400px; margin: 0 auto 20px; line-height: 1.5; }

/* ── Contract group chips ── */
.gc-group-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 550;
}

/* ── Forecast chart ── */
.gc-forecast-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.gc-forecast-month {
  min-width: 80px;
  font-size: 0.85rem;
  font-weight: 550;
  color: var(--text, #e2e8f0);
}
.gc-forecast-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  overflow: hidden;
}
.gc-forecast-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.gc-forecast-amount {
  min-width: 100px;
  text-align: right;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ── Scrollbar ── */
.gc-sidebar::-webkit-scrollbar, .gc-main::-webkit-scrollbar { width: 5px; }
.gc-sidebar::-webkit-scrollbar-track, .gc-main::-webkit-scrollbar-track { background: transparent; }
.gc-sidebar::-webkit-scrollbar-thumb, .gc-main::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

/* ── Animations ── */
@keyframes gc-fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes gc-slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.gc-animate-in { animation: gc-slideUp 0.3s ease; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .gc-sidebar { width: 56px; min-width: 56px; }
  .gc-sidebar-header h2, .gc-sidebar-header p, .gc-nav-item span, .gc-sidebar-footer { display: none; }
  .gc-nav-item { justify-content: center; padding: 12px; }
  .gc-nav-item svg { margin: 0; }
  .gc-content { padding: 16px; }
  .gc-kpis { grid-template-columns: repeat(2, 1fr); }
  .gc-form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .gc-app { flex-direction: column; }
  .gc-sidebar { width: 100%; min-width: 100%; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .gc-nav { flex-direction: row; padding: 8px; gap: 4px; }
  .gc-nav-item { white-space: nowrap; font-size: 0.8rem; padding: 8px 12px; }
  .gc-sidebar-header, .gc-sidebar-footer, .gc-nav-divider { display: none; }
  .gc-kpis { grid-template-columns: 1fr; }
}
