/* ==========================================================================
   Financial Dashboard - High Contrast, Persistent Login & Claymorphism Theme
   Domain: trend.cozyku.com
   ========================================================================== */

:root {
  --bg-main: #F2F0E9;
  --text-main: #0F172A;
  --text-muted: #1E293B;
  
  --color-depo: #047857;
  --color-wd: #B91C1C;
  --color-expense: #B45309;
  --accent-blue: #1D4ED8;
  --accent-purple: #6D28D9;
  
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-full: 9999px;
  
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: radial-gradient(circle at 10% 20%, #F5F3ED 0%, #E6E4DC 100%);
  color: var(--text-main);
  min-height: 100vh;
  padding: 24px 16px;
  -webkit-font-smoothing: antialiased;
}

.dash-container {
  max-width: 1150px;
  margin: 0 auto;
}

/* Header Bar */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding: 22px 28px;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: 8px 10px 24px rgba(0,0,0,0.08);
  border: 1.5px solid #CBD5E1;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #047857;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 4px 6px 14px rgba(4, 120, 87, 0.4);
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.88rem;
  color: #1E293B;
  margin-top: 2px;
  font-weight: 700;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.clock-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #EFF6FF;
  border: 1.5px solid #3B82F6;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.9rem;
  color: #1E40AF;
  box-shadow: 2px 4px 8px rgba(0,0,0,0.05);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  background: #FEE2E2;
  border: 1.5px solid #EF4444;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-weight: 800;
  font-size: 0.88rem;
  color: #B91C1C;
  cursor: pointer;
  box-shadow: 2px 4px 8px rgba(220, 38, 38, 0.15);
  transition: all 0.15s ease;
}

.btn-logout:hover {
  background: #EF4444;
  color: #FFFFFF;
  transform: translateY(-2px);
}

/* Fullscreen Login Overlay */
#loginOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 10% 20%, #1E293B 0%, #0F172A 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #FFFFFF;
  border-radius: 28px;
  padding: 38px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  border: 2px solid #38BDF8;
  text-align: center;
}

.login-header-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px auto;
  border-radius: 22px;
  background: linear-gradient(135deg, #059669, #047857);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 10px 20px rgba(5, 150, 105, 0.35);
}

.login-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 4px;
}

.login-sub {
  font-size: 0.9rem;
  color: #475569;
  font-weight: 700;
  margin-bottom: 26px;
}

.auth-alert-error {
  background: #FEE2E2;
  border: 1.5px solid #FCA5A5;
  color: #B91C1C;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.88rem;
  margin-bottom: 20px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-login {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
  transition: transform 0.15s ease;
  margin-top: 8px;
}

.btn-login:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #1D4ED8, #1E40AF);
}

/* Nav Tabs - 100% Clickable & High Contrast Pills */
.nav-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 6px;
  position: relative;
  z-index: 100;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border: 2px solid #64748B !important;
  border-radius: var(--radius-md);
  background: #FFFFFF !important;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  color: #0F172A !important;
  cursor: pointer !important;
  user-select: none;
  box-shadow: 4px 4px 10px rgba(0,0,0,0.1) !important;
  transition: all 0.15s ease;
  white-space: nowrap;
  position: relative;
  z-index: 101;
}

.tab-btn:hover {
  transform: translateY(-2px);
  background: #F1F5F9 !important;
  border-color: #334155 !important;
}

.tab-btn.active {
  color: #FFFFFF !important;
  background: #1D4ED8 !important;
  border-color: #1E40AF !important;
  box-shadow: 4px 6px 16px rgba(29, 78, 216, 0.45) !important;
}

.tab-btn.active.tab-expense {
  background: #B45309 !important;
  border-color: #92400E !important;
  box-shadow: 4px 6px 16px rgba(180, 83, 9, 0.45) !important;
}

.tab-btn.active.tab-sum {
  background: #6D28D9 !important;
  border-color: #5B21B6 !important;
  box-shadow: 4px 6px 16px rgba(109, 40, 217, 0.45) !important;
}

.tab-btn.active.tab-cumulative {
  background: #047857 !important;
  border-color: #064E3B !important;
  box-shadow: 4px 6px 16px rgba(4, 120, 87, 0.45) !important;
}

/* Quick Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #FFFFFF !important;
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 6px 8px 20px rgba(0,0,0,0.15);
}

.stat-depo {
  background: #047857 !important;
}

.stat-wd {
  background: #B91C1C !important;
}

.stat-nett {
  background: #3730A3 !important;
}

.stat-expense {
  background: #B45309 !important;
  border: 2px solid #92400E !important;
}

.stat-title {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: #FFFFFF !important;
  opacity: 0.95;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFFFFF !important;
}

/* Forms Grid */
.forms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 868px) {
  .forms-grid {
    grid-template-columns: 1fr;
  }
}

.clay-card {
  padding: 26px;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: 8px 10px 24px rgba(0,0,0,0.06);
  border: 1.5px solid #CBD5E1;
}

.clay-card-depo {
  background: linear-gradient(160deg, #ECFDF5 0%, #D1FAE5 100%);
  border: 2px solid #34D399;
}

.clay-card-wd {
  background: linear-gradient(160deg, #FEF2F2 0%, #FEE2E2 100%);
  border: 2px solid #FCA5A5;
}

.clay-card-expense {
  background: linear-gradient(160deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 2px solid #FCD34D;
}

.card-header-depo {
  border-bottom: 3.5px solid #047857;
  padding-bottom: 12px;
  margin-bottom: 22px;
}

.card-header-wd {
  border-bottom: 3.5px solid #B91C1C;
  padding-bottom: 12px;
  margin-bottom: 22px;
}

.card-header-expense {
  border-bottom: 3.5px solid #B45309;
  padding-bottom: 12px;
  margin-bottom: 22px;
}

.card-header-purple {
  border-bottom: 3.5px solid #6D28D9;
  padding-bottom: 12px;
  margin-bottom: 22px;
}

.card-header-green {
  border-bottom: 3.5px solid #047857;
  padding-bottom: 12px;
  margin-bottom: 22px;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Forms Input */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #0F172A;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 14px 18px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border: 1.5px solid #94A3B8;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  color: #0F172A;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #1D4ED8;
  box-shadow: 0 0 0 3.5px rgba(29, 78, 216, 0.2);
}

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

/* Buttons */
.btn-submit-depo {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-md);
  background: #047857;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 4px 6px 16px rgba(4, 120, 87, 0.4);
  transition: transform 0.15s ease;
}

.btn-submit-wd {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-md);
  background: #B91C1C;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 4px 6px 16px rgba(185, 28, 28, 0.4);
  transition: transform 0.15s ease;
}

.btn-submit-expense {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-md);
  background: #B45309;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 4px 6px 16px rgba(180, 83, 9, 0.4);
  transition: transform 0.15s ease;
}

.btn-submit-depo:hover { transform: translateY(-2px); }
.btn-submit-wd:hover { transform: translateY(-2px); }
.btn-submit-expense:hover { transform: translateY(-2px); }

/* Tables & Badges */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  margin-top: 12px;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.custom-table th {
  background: #F1F5F9;
  padding: 14px 16px;
  font-weight: 800;
  color: #0F172A;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #94A3B8;
}

.custom-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #E2E8F0;
  font-weight: 700;
  color: #0F172A;
}

.tfoot-total td {
  background: #F8FAFC;
  font-size: 1.08rem;
  font-weight: 800;
  border-top: 2.5px solid #94A3B8;
}

.badge-depo {
  background: #D1FAE5;
  color: #047857;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.8rem;
  border: 1.5px solid #34D399;
}

.badge-wd {
  background: #FEE2E2;
  color: #B91C1C;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.8rem;
  border: 1.5px solid #FCA5A5;
}

.badge-expense {
  background: #FEF3C7;
  color: #B45309;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.8rem;
  border: 1.5px solid #FCD34D;
}

.delete-icon-btn {
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}

.delete-icon-btn:hover {
  background: #FCA5A5;
}

/* SUM & Cumulative Boxes */
.sum-box {
  margin-top: 24px;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 100%);
  color: #FFFFFF;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.4);
  border: 1.5px solid rgba(255,255,255,0.2);
}

.kas-box {
  margin-top: 24px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #064E3B 0%, #022C22 100%);
  color: #FFFFFF;
  box-shadow: 0 14px 32px rgba(6, 78, 59, 0.45);
  border: 2px solid #34D399;
}

.sum-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  font-size: 1.1rem;
  font-weight: 700;
}

.sum-row-nett {
  border-bottom: none;
  margin-top: 14px;
  padding-top: 18px;
  border-top: 2px dashed rgba(255,255,255,0.4);
}

.sum-nett-value {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.text-surplus { color: #34D399 !important; }
.text-deficit { color: #F87171 !important; }

.empty-table {
  padding: 28px;
  text-align: center;
  color: #475569;
  font-weight: 800;
  font-size: 1rem;
}
