/* ============================================================
   LuminoStudio 月末締めシステム - Main Stylesheet
   ============================================================ */

/* CSS Variables */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent-green: #16a34a;
  --accent-green-light: #dcfce7;
  --accent-red: #dc2626;
  --accent-red-light: #fee2e2;
  --accent-yellow: #d97706;
  --accent-yellow-light: #fef3c7;
  --accent-purple: #7c3aed;
  --accent-purple-light: #ede9fe;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-hover: #334155;
  --sidebar-active: #2563eb;
  --sidebar-width: 240px;
  --header-height: 60px;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --transition: 0.2s ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', 'Meiryo', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ============================================================
   Login Page
   ============================================================ */

#login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 420px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 64px;
  height: 64px;
  background: white;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-md);
}

.login-logo .logo-icon svg {
  width: 36px;
  height: 36px;
  color: var(--primary);
}

.login-logo h1 {
  color: white;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-logo p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.login-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.login-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.login-card .login-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 28px;
}

.login-error {
  background: var(--accent-red-light);
  color: var(--accent-red);
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.875rem;
  margin-bottom: 20px;
  display: none;
}

.login-error.show {
  display: block;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
}

/* ============================================================
   Form Elements
   ============================================================ */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group label .required {
  color: var(--accent-red);
  margin-left: 4px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-control.error {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px var(--accent-red-light);
}

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

.form-control[type="date"] {
  cursor: pointer;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control {
  border-radius: var(--radius) 0 0 var(--radius);
  flex: 1;
}

.input-group .btn-icon {
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg);
  padding: 0 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background var(--transition);
}

.input-group .btn-icon:hover {
  background: var(--border);
  color: var(--text);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.form-check label {
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 0;
  font-weight: 400;
}

.form-error {
  color: var(--accent-red);
  font-size: 0.8rem;
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
  white-space: nowrap;
  text-decoration: none;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg);
  border-color: #cbd5e1;
}

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

.btn-success:hover:not(:disabled) {
  background: #15803d;
}

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

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

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

.btn-warning:hover:not(:disabled) {
  background: #b45309;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

.btn-icon-only {
  padding: 8px;
  width: 36px;
  height: 36px;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ============================================================
   App Layout
   ============================================================ */

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

/* Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-size: 1rem;
  font-weight: 700;
  width: var(--sidebar-width);
  flex-shrink: 0;
}

.header-brand .brand-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-brand .brand-icon svg {
  width: 18px;
  height: 18px;
  color: white;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}

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

.btn-logout {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  overflow-y: auto;
  z-index: 90;
  padding: 16px 0;
}

.sidebar-section {
  padding: 0 12px;
  margin-bottom: 4px;
}

.sidebar-section-title {
  color: var(--text-light);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: white;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active svg {
  opacity: 1;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  flex: 1;
  padding: 28px;
  min-height: calc(100vh - var(--header-height));
}

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.card-body {
  padding: 20px;
}

/* Summary Cards Grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.summary-card.blue::before { background: var(--primary); }
.summary-card.green::before { background: var(--accent-green); }
.summary-card.red::before { background: var(--accent-red); }
.summary-card.yellow::before { background: var(--accent-yellow); }
.summary-card.purple::before { background: var(--accent-purple); }

.summary-card-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.summary-card-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.summary-card.green .summary-card-value { color: var(--accent-green); }
.summary-card.red .summary-card-value { color: var(--accent-red); }

.summary-card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

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

.bank-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
}

.bank-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.bank-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.bank-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

.bank-card-balance {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.bank-card-balance .currency {
  font-size: 1.1rem;
  margin-right: 2px;
}

.bank-card-updated {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

/* ============================================================
   Tables
   ============================================================ */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  background: var(--bg);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

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

tbody tr:hover {
  background: #f8fafc;
}

tfoot td {
  padding: 12px 14px;
  background: var(--bg);
  font-weight: 700;
  border-top: 2px solid var(--border);
}

.td-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.td-amount.income { color: var(--accent-green); }
.td-amount.expense { color: var(--accent-red); }

.td-actions {
  text-align: center;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: var(--accent-green-light); color: var(--accent-green); }
.badge-red { background: var(--accent-red-light); color: var(--accent-red); }
.badge-yellow { background: var(--accent-yellow-light); color: var(--accent-yellow); }
.badge-purple { background: var(--accent-purple-light); color: var(--accent-purple); }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ============================================================
   Tab Navigation
   ============================================================ */

.tab-nav {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 6px 6px 0 0;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ============================================================
   Page Sections
   ============================================================ */

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

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Section heading inside page */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

/* ============================================================
   Month Selector
   ============================================================ */

.month-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.month-selector button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: all var(--transition);
}

.month-selector button:hover {
  background: var(--bg);
  color: var(--text);
}

.month-selector span {
  min-width: 100px;
  text-align: center;
}

/* ============================================================
   Modal
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95) translateY(-10px);
  transition: transform var(--transition);
}

.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
}

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

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ============================================================
   File Upload / Drag & Drop
   ============================================================ */

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-zone svg {
  width: 40px;
  height: 40px;
  color: var(--text-light);
  margin: 0 auto 12px;
  display: block;
}

.upload-zone:hover svg,
.upload-zone.drag-over svg {
  color: var(--primary);
}

.upload-zone p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.upload-zone span {
  font-size: 0.8rem;
  color: var(--text-light);
}

.upload-zone .upload-btn-text {
  color: var(--primary);
  font-weight: 600;
}

.file-list {
  margin-top: 16px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.file-item svg {
  width: 16px;
  height: 16px;
  color: var(--accent-red);
  flex-shrink: 0;
}

.file-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.file-item .file-size {
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.file-item .file-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}

.file-item .file-remove:hover {
  color: var(--accent-red);
}

/* ============================================================
   Info/Alert Boxes
   ============================================================ */

.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-info {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid #bfdbfe;
}

.alert-warning {
  background: var(--accent-yellow-light);
  color: var(--accent-yellow);
  border: 1px solid #fde68a;
}

.alert-success {
  background: var(--accent-green-light);
  color: var(--accent-green);
  border: 1px solid #bbf7d0;
}

.alert-error {
  background: var(--accent-red-light);
  color: var(--accent-red);
  border: 1px solid #fca5a5;
}

/* ============================================================
   Loading States
   ============================================================ */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner.dark {
  border-color: var(--border);
  border-top-color: var(--primary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 10;
}

/* ============================================================
   Utility Classes
   ============================================================ */

.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-green); }
.text-danger { color: var(--accent-red); }
.text-primary { color: var(--primary); }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.75rem; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.hidden { display: none !important; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* Carryover info bar */
.carryover-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.carryover-bar .label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.carryover-bar .amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-left: auto;
  margin-right: 12px;
}

/* Transport external link buttons */
.external-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}

.external-link-btn:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.external-link-btn svg {
  width: 16px;
  height: 16px;
}

/* Two-column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* Form card */
.form-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

/* Totals bar */
.totals-bar {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 12px;
  flex-wrap: wrap;
}

.totals-bar .total-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.totals-bar .total-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.totals-bar .total-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.totals-bar .total-value.income { color: var(--accent-green); }
.totals-bar .total-value.expense { color: var(--accent-red); }

/* ============================================================
   Receipts / Invoice Sections
   ============================================================ */

.receipt-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.receipt-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.receipt-section h3 svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
  :root {
    --sidebar-width: 200px;
  }

  .main-content {
    padding: 16px;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}
