/* ============================================
   DarkPark Financieel - Stylesheet
   Consistent met DarkPark Backstage theme
   ============================================ */

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

:root {
  /* DarkPark Backstage kleuren */
  --color-gradient-top: #000000;
  --color-gradient-bottom: #020140;
  --accent: #FF0080;
  --accent-hover: #e00070;
  --color-secondary: #585E7A;
  --color-surface: rgba(255, 255, 255, 0.04);
  --color-surface-alt: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.1);
  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);

  /* Status kleuren */
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --orange: #fbbf24;
  --orange-bg: rgba(251, 191, 36, 0.12);
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.12);

  /* Fonts */
  --font-body: 'Questrial', sans-serif;
  --font-heading: 'Oswald', sans-serif;

  /* Layout */
  --sidebar-width: 240px;
  --transition-fast: 150ms ease;
}

html { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  min-height: 100vh;
  background: linear-gradient(to top, var(--color-gradient-bottom), var(--color-gradient-top));
  background-attachment: fixed;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

#app {
  display: flex;
  min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
#sidebar {
  width: var(--sidebar-width);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
  font-size: 22px;
  color: var(--text-primary);
}

.sidebar-header .subtitle {
  font-size: 11px;
  color: var(--accent);
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.nav-items {
  list-style: none;
  padding: 12px 8px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  padding: 10px 14px;
  border-radius: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent);
  color: white;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.user-info {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding: 0 4px;
}

.logout-btn {
  width: 100%;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

/* ==================== MAIN CONTENT ==================== */
#content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px;
  min-height: 100vh;
}

/* ==================== PAGE HEADER ==================== */
.page-header {
  margin-bottom: 28px;
}

.page-header h2 {
  font-size: 28px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ==================== CARDS ==================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-label {
  font-size: 11px;
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-value {
  font-size: 28px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.card-value.positive { color: var(--green); }
.card-value.negative { color: var(--red); }

.card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.card-icon.green { background: var(--green-bg); color: var(--green); }
.card-icon.red { background: var(--red-bg); color: var(--red); }
.card-icon.blue { background: var(--blue-bg); color: var(--blue); }
.card-icon.orange { background: var(--orange-bg); color: var(--orange); }

/* Summary card (accent) */
.summary-card {
  background: linear-gradient(135deg, #FF0080 0%, #7928CA 100%);
  border: none;
  padding: 28px;
}

.summary-card .card-label {
  color: rgba(255,255,255,0.7);
}

.summary-card .card-value {
  color: white;
  font-size: 36px;
}

.summary-card .card-sub {
  color: rgba(255,255,255,0.6);
}

/* Entity cards */
.entity-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

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

.entity-card .entity-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.entity-card .entity-type {
  font-size: 10px;
  font-family: var(--font-heading);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.entity-balance {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.entity-balance .label {
  font-size: 12px;
  color: var(--text-secondary);
}

.entity-balance .value {
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-heading);
}

.entity-balance .value.muted {
  color: var(--text-muted);
  font-size: 13px;
}

/* ==================== ALERTS ==================== */
.alerts-section {
  margin-bottom: 24px;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 0;
  margin-bottom: 8px;
  font-size: 13px;
}

.alert-item.urgent {
  background: var(--red-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.alert-item.waarschuwing {
  background: var(--orange-bg);
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: #fde68a;
}

.alert-item.info {
  background: var(--blue-bg);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.alert-item .alert-amount {
  font-weight: 600;
  margin-left: auto;
  white-space: nowrap;
}

.alert-item .dismiss-btn {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
}

.alert-item .dismiss-btn:hover { opacity: 1; }

/* ==================== TABLES ==================== */
.table-container {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.table-header h3 {
  font-size: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 10px 20px;
  font-size: 11px;
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

td {
  padding: 12px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

tr:last-child td { border-bottom: none; }

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

td.amount {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-heading);
}

td.amount.positive { color: var(--green); }
td.amount.negative { color: var(--red); }

/* ==================== CHARTS ==================== */
.chart-container {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.chart-container h3 {
  font-size: 16px;
  margin-bottom: 16px;
}

.chart-wrapper {
  position: relative;
  height: 300px;
}

/* ==================== FORMS ==================== */
.form-section {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.form-section h3 {
  font-size: 16px;
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--color-secondary);
  border-radius: 0;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

/* ==================== BUTTONS ==================== */
.btn {
  padding: 10px 20px;
  border-radius: 0;
  font-size: 14px;
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-secondary {
  background: var(--color-secondary);
  color: var(--text-primary);
}
.btn-secondary:hover { opacity: 0.85; }

.btn-danger {
  background: var(--red);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ==================== BADGES ==================== */
.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 0;
  font-size: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-pink { background: rgba(255, 0, 128, 0.12); color: var(--accent); }

/* ==================== PROGRESS BARS ==================== */
.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-bar .fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.progress-bar .fill.green { background: var(--green); }
.progress-bar .fill.orange { background: var(--orange); }
.progress-bar .fill.red { background: var(--red); }
.progress-bar .fill.blue { background: var(--blue); }
.progress-bar .fill.pink { background: var(--accent); }

/* ==================== SECTION TITLES ==================== */
.section-title {
  font-size: 18px;
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== TABS ==================== */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ==================== TOOLTIPS ==================== */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1000;
  max-width: 300px;
  white-space: normal;
  line-height: 1.4;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.empty-state p {
  font-size: 14px;
}

/* ==================== LOADING ==================== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--text-muted);
}

/* ==================== ADMIN PANEL ==================== */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.admin-card {
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-card:hover {
  background: var(--color-surface-alt);
  border-color: var(--accent);
}

.admin-card h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--accent);
}

.admin-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.admin-card .count {
  font-size: 24px;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: linear-gradient(to top, var(--color-gradient-bottom), #0a0a2e);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
}

.modal h3 {
  font-size: 20px;
  margin-bottom: 20px;
  color: var(--accent);
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  justify-content: flex-end;
}

/* ==================== PAYMENT PLANNING ==================== */
.payment-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: 0;
  margin-bottom: 8px;
}

.payment-item.overdue {
  border-color: var(--red);
  background: var(--red-bg);
}

.payment-item.pending {
  border-color: var(--orange);
}

.payment-item.approved {
  border-color: var(--green);
}

.payment-item .payment-amount {
  font-size: 18px;
  font-family: var(--font-heading);
  font-weight: 700;
  margin-left: auto;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  #sidebar {
    width: 100%;
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    height: auto;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--border);
  }

  .sidebar-header, .sidebar-footer { display: none; }

  .nav-items {
    display: flex;
    padding: 8px;
    gap: 4px;
    overflow-x: auto;
  }

  .nav-item {
    flex-shrink: 0;
    font-size: 12px;
    padding: 8px 12px;
  }

  #content {
    margin-left: 0;
    margin-bottom: 70px;
    padding: 16px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .entity-cards {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-secondary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }
