/* ============================================
   AI TOOLCOR BUSINESS — MIDNIGHT AURORA THEME
   business.aitoolcor.com
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand — Cyan + Gold */
  --brand:        #06b6d4;
  --brand-dark:   #0891b2;
  --brand-light:  #cffafe;
  --brand-soft:   #ecfeff;
  --gold:         #fbbf24;
  --gold-soft:    #fef3c7;
  --gradient:     linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  --gradient-gold:linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  --gradient-hero:linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0891b2 100%);

  /* Status */
  --income:        #10b981;
  --income-bg:     #d1fae5;
  --income-soft:   #ecfdf5;
  --income-border: #a7f3d0;
  --expense:       #f43f5e;
  --expense-bg:    #ffe4e6;
  --expense-soft:  #fff1f2;
  --expense-border:#fecdd3;
  --profit:        #f59e0b;
  --profit-bg:     #fef3c7;
  --profit-soft:   #fffbeb;

  /* Neutrals — Warm */
  --bg:           #f7f9fc;
  --bg-card:      #ffffff;
  --bg-subtle:    #f1f5f9;
  --bg-hover:     #e2e8f0;

  --text-head:    #0f172a;
  --text-body:    #334155;
  --text-muted:   #64748b;
  --text-light:   #94a3b8;

  --border:       #e2e8f0;
  --border-light: #f1f5f9;

  /* Sidebar */
  --sidebar-w:    250px;
  --sidebar-bg:   #0a0e27;

  /* Sizes */
  --header-h:     64px;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 24px;
  --r-full:9999px;

  --sh-sm: 0 1px 3px rgba(15,23,42,0.05);
  --sh-md: 0 4px 20px rgba(15,23,42,0.06);
  --sh-lg: 0 12px 40px rgba(15,23,42,0.12);
  --sh-glow: 0 0 40px rgba(6,182,212,0.15);

  --tr: all 0.2s ease;
  --font: 'Inter', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
}

*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration:none; color:inherit; }
ul { list-style:none; }
button { font-family:inherit; }

/* ============ LAYOUT ============ */
.app { display:flex; min-height:100vh; }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin 0.3s;
}

.content {
  padding: 22px 26px;
  flex: 1;
  margin-top: var(--header-h);
}

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar::-webkit-scrollbar { width:0; }

.sb-logo {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sb-logo-icon {
  width: 40px; height: 40px;
  background: var(--gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(6,182,212,0.3);
}

.sb-logo-text {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sb-logo-sub {
  font-size: 0.62rem;
  color: #06b6d4;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.sb-nav { flex: 1; padding: 12px 0; }

.sb-section {
  padding: 16px 20px 6px;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #475569;
}

.sb-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--tr);
  border-left: 3px solid transparent;
}

.sb-link:hover { background: rgba(255,255,255,0.04); color:#e2e8f0; }

.sb-link.active {
  background: linear-gradient(90deg, rgba(6,182,212,0.15) 0%, transparent 100%);
  color: #22d3ee;
  border-left-color: #06b6d4;
}

.sb-icon { font-size:1rem; width:20px; text-align:center; }

.sb-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

.sb-avatar {
  width: 36px; height: 36px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.sb-user-name { font-size:0.78rem; color:#e2e8f0; font-weight:600; }
.sb-user-email { font-size:0.62rem; color:#64748b; }

.sb-logout {
  width: 100%;
  padding: 9px;
  background: rgba(244,63,94,0.1);
  border: 1px solid rgba(244,63,94,0.2);
  border-radius: var(--r-md);
  color: #fb7185;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--tr);
}

.sb-logout:hover { background: rgba(244,63,94,0.18); }

.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ============ HEADER ============ */
.header {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 0 26px;
  gap: 16px;
  box-shadow: var(--sh-sm);
  transition: left 0.3s;
}

.hd-left { flex:1; display:flex; align-items:center; gap:14px; }

.menu-btn {
  display: none;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  cursor: pointer;
  font-size: 1rem;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.hd-title h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-head);
}

.hd-title p { font-size:0.72rem; color:var(--text-muted); }

.hd-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1.5px solid transparent;
  border-radius: var(--r-full);
  padding: 8px 16px;
  min-width: 260px;
  transition: var(--tr);
}

.hd-search:focus-within {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(6,182,212,0.1);
}

.hd-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--text-body);
  width: 100%;
}

.hd-search input::placeholder { color: var(--text-light); }

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

.hd-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 6px 14px;
  background: var(--bg-subtle);
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  white-space: nowrap;
  font-weight: 500;
}

.hd-live {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-light);
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brand-dark);
}

.hd-live::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--brand);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,100% { opacity:1; box-shadow: 0 0 0 0 rgba(6,182,212,0.5); }
  50% { opacity:0.7; box-shadow: 0 0 0 5px rgba(6,182,212,0); }
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--r-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--tr);
  white-space: nowrap;
  font-family: inherit;
}

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

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(6,182,212,0.3);
}

.btn-primary:hover { box-shadow: 0 6px 20px rgba(6,182,212,0.4); }

.btn-income {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16,185,129,0.3);
}

.btn-expense {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  box-shadow: 0 4px 14px rgba(244,63,94,0.3);
}

.btn-gold {
  background: var(--gradient-gold);
  color: #fff;
  box-shadow: 0 4px 14px rgba(251,191,36,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text-body);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 12px;
}

.btn-ghost:hover { background: var(--bg-hover); }

.btn-sm { padding:7px 14px; font-size:0.78rem; }
.btn-lg { padding:12px 22px; font-size:0.88rem; }

/* ============ CARDS ============ */
.card {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  transition: var(--tr);
}

.card:hover { box-shadow: var(--sh-md); }

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

.card-hd h4 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-head);
}

.card-bd { padding: 20px; }

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 700;
}

.badge-in {
  background: var(--income-bg);
  color: var(--income);
  border: 1px solid var(--income-border);
}

.badge-out {
  background: var(--expense-bg);
  color: var(--expense);
  border: 1px solid var(--expense-border);
}

.badge-gold {
  background: var(--gold-soft);
  color: #d97706;
  border: 1px solid #fcd34d;
}

/* ============ TABLE ============ */
.table-wrap { overflow-x:auto; }

.dtable { width:100%; border-collapse:collapse; font-size:0.82rem; }

.dtable thead tr {
  background: var(--bg-subtle);
  border-bottom: 2px solid var(--border);
}

.dtable th {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-display);
}

.dtable tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: var(--tr);
}

.dtable tbody tr:hover { background: var(--bg-subtle); }

.dtable td { padding:12px 14px; color:var(--text-body); vertical-align:middle; }

/* ============ FORMS ============ */
.fg { display:flex; flex-direction:column; gap:6px; }

.fl {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-body);
  letter-spacing: 0.02em;
}

.fl .req { color: var(--expense); }

.fc {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  color: var(--text-body);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: var(--tr);
}

.fc:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(6,182,212,0.08);
}

.fc::placeholder { color: var(--text-light); }

select.fc {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%2364748b' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

textarea.fc { resize:vertical; min-height:72px; }

.form-row { display:grid; grid-template-columns:1fr 1fr; gap:14px; }

/* ============ MODAL ============ */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(10,14,39,0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s;
}

.modal-bg.open { opacity:1; visibility:visible; }

.modal {
  background: var(--bg-card);
  border-radius: var(--r-2xl);
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  transform: scale(0.94) translateY(16px);
  transition: all 0.25s;
}

.modal-bg.open .modal { transform: scale(1) translateY(0); }

.modal-hd {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--r-2xl) var(--r-2xl) 0 0;
}

.modal-hd h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-head);
}

.modal-x {
  width: 32px; height: 32px;
  border: none;
  background: var(--bg-subtle);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--tr);
  color: var(--text-muted);
}

.modal-x:hover { background: var(--expense-bg); color: var(--expense); }

.modal-bd {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-ft {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ============ TOAST ============ */
.toast-box {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  min-width: 260px;
  max-width: 360px;
  animation: toastIn 0.3s ease;
  font-size: 0.85rem;
  font-weight: 500;
  border-left: 4px solid var(--brand);
}

@keyframes toastIn {
  from { opacity:0; transform:translateX(20px); }
  to { opacity:1; transform:translateX(0); }
}

/* ============ AMOUNT ============ */
.amt-in { color:var(--income); font-weight:700; }
.amt-out { color:var(--expense); font-weight:700; }

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

.empty-icon { font-size:2.8rem; margin-bottom:10px; opacity:0.4; }
.empty h4 { font-size:0.95rem; color:var(--text-body); margin-bottom:4px; font-family:var(--font-display); }
.empty p { font-size:0.82rem; }

/* ============ PREVIEW ============ */
.preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.preview-in {
  background: var(--income-soft);
  border: 1px solid var(--income-border);
  color: var(--income);
}

.preview-out {
  background: var(--expense-soft);
  border: 1px solid var(--expense-border);
  color: var(--expense);
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:10px; }
::-webkit-scrollbar-thumb:hover { background:#94a3b8; }

/* ============ ANIMATIONS ============ */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(16px); }
  to { opacity:1; transform:translateY(0); }
}

.fade-up { animation: fadeUp 0.5s ease forwards; }
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }

/* ============ MOBILE ============ */
@media (max-width: 900px) {
  .sidebar { transform:translateX(-100%); }
  .sidebar.open { transform:translateX(0); }
  .main { margin-left:0; }
  .header { left:0; }
  .menu-btn { display:flex !important; }
}

@media (max-width: 640px) {
  .content { padding:16px; }
  .hd-search { min-width:140px; }
  .header { padding:0 14px; gap:8px; }
  .hd-date, .hd-live { display:none; }
}

/* ============ UTILS ============ */
.text-income { color:var(--income); }
.text-expense { color:var(--expense); }
.text-profit { color:var(--profit); }
.text-brand { color:var(--brand-dark); }
.text-gold { color:#d97706; }
.fw-700 { font-weight:700; }
.fw-800 { font-weight:800; }