/* --- STYLE.CSS FOR HOMESTAY STATEMENT GENERATOR --- */

:root {
  --primary-color: #10b981; /* Emerald */
  --primary-hover: #059669;
  --secondary-color: #6366f1; /* Indigo */
  --bg-color: #f8fafc; /* Slate Light */
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --border-light: #f1f5f9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #ffffff;
  --radius-lg: 12px;
  --radius-md: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;
}

/* --- GENERAL RESET & BASE --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* --- APP CONTAINER & LAYOUT --- */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.logo-area {
  display: flex;
  flex-direction: column;
  margin-bottom: 40px;
}

.logo-icon {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -1px;
}

.logo-icon::before {
  content: '🌸 ';
}

.logo-text {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--primary-color);
  letter-spacing: 2px;
  margin-top: 4px;
  font-weight: 600;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.nav-btn:hover {
  background-color: rgba(255,255,255,0.05);
  color: #ffffff;
}

.nav-btn.active {
  background-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* --- SIDEBAR NAV GROUPS & NESTED SUB-MENUS --- */
.nav-group {
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.nav-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: #64748b; /* A bit more muted */
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  user-select: none;
}

.nav-group-items {
  display: flex;
  flex-direction: column;
  padding-left: 14px;
  gap: 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  margin-left: 24px;
  margin-bottom: 8px;
}

.nav-sub-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.nav-sub-btn:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.nav-sub-btn.active {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--primary-color);
  font-weight: 600;
}

.sub-btn-icon {
  font-size: 13px;
}


.sidebar-footer {
  font-size: 12px;
  color: #475569;
  border-top: 1px solid #1e293b;
  padding-top: 16px;
  line-height: 1.6;
}

/* --- MAIN CONTENT --- */
.main-content {
  flex-grow: 1;
  padding: 32px;
  overflow-y: auto;
  max-width: 1400px;
  margin: 0 auto;
  width: calc(100% - 260px);
}

/* --- TAB CONTENT & ANIMATIONS --- */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- HEADERS & FILTERS --- */
.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  flex-wrap: wrap;
  gap: 20px;
}

.header-title h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #1e293b;
}

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

.header-filters {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

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

.filter-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.filter-group input, .filter-group select {
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 14px;
  background-color: #ffffff;
  outline: none;
  min-width: 150px;
}

.filter-group input:focus, .filter-group select:focus {
  border-color: var(--primary-color);
}

.filter-actions {
  display: flex;
  gap: 8px;
}

/* --- BUTTONS --- */
.btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  text-decoration: none;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.btn-secondary {
  background-color: #e2e8f0;
  color: #334155;
}

.btn-secondary:hover {
  background-color: #cbd5e1;
}

.btn-warning {
  background-color: var(--warning);
  color: #ffffff;
}

.btn-warning:hover {
  background-color: #d97706;
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 4px;
}

.w-full { width: 100%; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }

/* --- STATS GRID --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary-color);
  background-color: rgba(16, 185, 129, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}

/* --- EXPENSE GRID & FORMS --- */
.expenses-split-grid {
  display: grid;
  grid-template-columns: 2.1fr 0.9fr;
  gap: 24px;
}

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

.form-container-card, .table-container-card {
  background-color: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}

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

.card-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-color);
  background-color: rgba(16, 185, 129, 0.1);
  padding: 3px 8px;
  border-radius: 9999px;
}

.badge-warning {
  color: var(--warning);
  background-color: rgba(245, 158, 11, 0.1);
}

/* --- FORM FIELDS --- */
.expense-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-field label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.form-field input, .form-field select {
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 14px;
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.form-field input:focus, .form-field select:focus {
  border-color: var(--primary-color);
}

.form-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid-three {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 12px;
}

/* Upload input styles */
.input-with-upload {
  display: flex;
  position: relative;
}

.input-with-upload input {
  padding-right: 40px;
}

.btn-icon-upload {
  position: absolute;
  right: 6px;
  top: 5px;
  height: 30px;
  width: 30px;
  border: none;
  background-color: var(--border-light);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-icon-upload:hover {
  background-color: #cbd5e1;
}

.upload-status {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 2px;
}

.upload-status.success {
  color: var(--success);
  font-weight: 600;
}

.file-uploader-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px dashed var(--border-color);
  padding: 10px;
  border-radius: var(--radius-md);
}

.file-uploader-box span {
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

.bank-section-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--secondary-color);
  margin-top: 14px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
}

/* --- SETTINGS SUBTABS --- */
.settings-subtabs {
  display: flex;
  gap: 8px;
}

.subtab-btn {
  background: none;
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.subtab-btn:hover {
  background-color: var(--border-light);
}

.subtab-btn.active {
  background-color: #1e293b;
  color: #ffffff;
  border-color: #1e293b;
}

.subtab-content {
  display: none;
}

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

.settings-split-grid {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 24px;
  margin-top: 20px;
}

@media (max-width: 1000px) {
  .settings-split-grid {
    grid-template-columns: 1fr;
  }
}

/* --- REPORT / GENERAL TABLES --- */
.report-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  margin-bottom: 16px;
}

.report-table th, .report-table td {
  padding: 8px 4px;
  border: 1px solid var(--border-color);
  font-variant-numeric: tabular-nums;
}

.report-table th {
  background-color: var(--border-light);
  font-weight: 600;
  color: #334155;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.report-table tbody tr:hover {
  background-color: var(--border-light);
}

.report-table td input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 2px;
  font-size: 12px;
  outline: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-table td input:focus {
  background-color: #fef08a; /* Soft Yellow highlight on focus */
  border-radius: 2px;
}

.sum-row {
  font-weight: 700;
  background-color: #f8fafc;
}

.sum-row td {
  border-top: 2px double #94a3b8 !important;
}

/* Badges inside tables */
.prop-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: 6px;
}

.badge-cohost {
  color: #2563eb;
  background-color: #dbeafe;
}

.badge-primary {
  color: #059669;
  background-color: #d1fae5;
}

/* --- STATEMENT PRINT WRAPPER --- */
.statement-print-wrapper {
  background-color: #ffffff;
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  max-width: 1200px;
  margin: 0 auto;
}

.statement-header-print {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
}

.statement-title-section {
  display: flex;
  flex-direction: column;
}

.statement-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #000000;
  border-bottom: 2px solid #000000;
  padding-bottom: 6px;
  display: inline-block;
  margin-bottom: 6px;
}

.statement-date-range {
  font-size: 16px;
  font-weight: 600;
  color: #334155;
  margin-left: 4px;
}

.logo-lucky {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  color: #dc2626; /* Red 'lucky' logo */
  letter-spacing: -1px;
  line-height: 1;
}

.logo-lucky::before {
  content: 'lucky ';
  font-size: 14px;
  vertical-align: super;
  color: #000;
}

.company-address {
  font-size: 10px;
  color: #334155;
  text-align: right;
  line-height: 1.4;
  margin-top: 4px;
}

.landlord-salutation {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 24px;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 10px;
}

.salutation-name {
  font-weight: 700;
  font-size: 22px;
}

.print-section {
  margin-bottom: 28px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 8px;
  border-left: 4px solid #1e3a8a;
  padding-left: 8px;
}

.section-title-sub {
  font-size: 13px;
  font-weight: 700;
  color: #000000;
  margin-bottom: 6px;
}

.print-full-width-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.print-bottom-layout {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 30px;
  align-items: flex-start;
  page-break-inside: avoid;
}

.company-details-text {
  font-size: 11px;
  color: #475569;
  line-height: 1.6;
  display: block;
  margin-top: 4px;
}

.print-column {
  display: flex;
  flex-direction: column;
}

/* Balance Summary (精算サマリー) Card */
.balance-card {
  border: 2px solid #000000;
  padding: 16px;
  border-radius: var(--radius-md);
  background-color: #f8fafc;
}

.balance-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  color: #1e293b;
}

.balance-row.border-bottom {
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.negative {
  color: #b91c1c;
}

.balance-row.final-row {
  font-size: 15px;
  padding-top: 6px;
  color: #000000;
}

.balance-row.final-row .highlight {
  font-size: 24px;
  font-weight: 800;
  color: #059669; /* Big Green net amount */
  font-family: var(--font-display);
}

.bank-info-section {
  margin-top: 0;
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  border: none;
}

.bank-info-section p {
  color: #334155;
}

/* Action icons inside tables */
.td-actions {
  display: flex;
  gap: 6px;
}

.td-actions button {
  padding: 3px 6px;
  font-size: 11px;
}

/* File link buttons */
.receipt-link {
  color: var(--secondary-color);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

.receipt-link:hover {
  color: #4f46e5;
}

.no-receipt {
  color: #94a3b8;
  font-style: italic;
}

/* --- PRINT MEDIA QUERIES --- */
@media print {
  /* Hide all interactive/web elements */
  .no-print, 
  .sidebar, 
  .tab-header, 
  .stats-grid, 
  button, 
  .btn,
  .td-actions,
  #csv-upload-label {
    display: none !important;
  }

  /* Reset main layout for A4 print */
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 11px !important;
    min-height: auto;
  }

  .app-container {
    display: block;
    width: 100%;
  }

  .main-content {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Target the statement specifically */
  .statement-print-wrapper {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: transparent !important;
  }

  /* Format tables for print readability */
  .report-table {
    font-size: 10px !important;
    margin-bottom: 12px !important;
  }

  .report-table th, .report-table td {
    padding: 5px 4px !important;
    border: 1px solid #000000 !important; /* Solid black border for printers */
    color: #000000 !important;
  }

  .report-table th {
    background-color: #eaeaea !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .sum-row {
    background-color: #f2f2f2 !important;
    font-weight: bold !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .report-table td input {
    border: none !important;
    background: transparent !important;
    font-weight: normal;
  }

  .balance-card {
    border: 2px solid #000000 !important;
    background-color: #f9f9f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .balance-row.final-row .highlight {
    color: #000000 !important;
    font-weight: bold !important;
  }

  .prop-badge {
    border: 1px solid #000000 !important;
    background: transparent !important;
    color: #000000 !important;
    padding: 1px 3px !important;
  }

  .print-bottom-layout {
    display: grid !important;
    grid-template-columns: 0.7fr 1.3fr !important;
    gap: 20px !important;
  }

  /* Page breaks if table overflows */
  .print-section {
    page-break-inside: avoid;
  }
}

/* --- LOGIN GATE OVERLAY --- */
#login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  animation: fadeIn 0.4s ease;
}

.login-card {
  background-color: #ffffff;
  padding: 36px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border-light);
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -1px;
}

.login-logo::before {
  content: '🌸 ';
}

.login-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin-top: 8px;
}

.login-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.login-error {
  background-color: #fef2f2;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  padding: 10px;
  border-radius: var(--radius-md);
  margin-top: 12px;
  text-align: center;
  border: 1px solid #fee2e2;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* --- MAPPING PAGE CUSTOM STYLES --- */
select.mapping-select {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  height: 32px;
  font-size: 13px;
  padding: 0 8px;
  width: 100%;
  outline: none;
  background-color: #fef9c3; /* Soft action warning color */
  color: #1e293b;
  font-weight: 500;
  transition: all 0.2s;
}

select.mapping-select.mapped {
  background-color: #d1fae5; /* Green check color once mapped */
  border-color: #10b981;
  color: #065f46;
}

select.mapping-select:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.badge-import-success {
  background-color: #d1fae5;
  color: #065f46;
}

/* --- LANDLORD ATTACHMENTS --- */
.attachments-list-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #f8fafc;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  font-size: 13px;
}

.attachment-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
}

.attachment-item-info:hover {
  color: var(--primary-color);
}

.btn-delete-attachment {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  line-height: 1;
}

.btn-delete-attachment:hover {
  opacity: 0.8;
}

/* --- COMMENTS & TIMELINE (TRELLO STYLE) --- */
.comment-write-box {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: #f8fafc;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.comment-write-box textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 13px;
  outline: none;
  background-color: #ffffff;
  resize: vertical;
  color: var(--text-color);
  font-family: inherit;
}

.comment-write-box textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.comments-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 450px;
  overflow-y: auto;
  padding-right: 8px;
}

.comment-node {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
  border: 1px solid #cbd5e1;
}

.comment-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.comment-author {
  font-weight: 600;
  color: #1e293b;
}

.comment-time {
  color: var(--text-muted);
}

.comment-edited {
  color: var(--text-muted);
  font-style: italic;
  font-size: 11px;
}

.comment-content-box {
  background-color: #f8fafc;
  padding: 10px 14px;
  border-radius: 0 8px 8px 8px;
  border: 1px solid var(--border-light);
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
  white-space: pre-wrap; /* Support multi-line layout */
}

.comment-actions {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  padding-left: 4px;
}

.comment-action-link {
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.comment-action-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* --- STATEMENT STATUS & MANUAL BOOKING MODAL & EXCLUDED ROWS --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.status-draft {
  background-color: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}
.status-finalized {
  background-color: #d1fae5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.25s ease;
}
.modal-overlay.hidden {
  display: none !important;
}
.modal-card {
  background-color: #ffffff;
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 500px;
  border: 1px solid var(--border-light);
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}
.modal-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-close-btn:hover {
  color: var(--text-dark);
}
.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.excluded-row {
  opacity: 0.55;
  background-color: #f8fafc;
}
.excluded-row td {
  text-decoration: line-through;
  color: #94a3b8 !important;
}
.excluded-row input {
  text-decoration: line-through;
  color: #94a3b8 !important;
  pointer-events: none;
  background: transparent;
}
.action-link {
  color: var(--primary-color);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 11px;
}
.action-link:hover {
  text-decoration: underline;
}
.action-link.danger-link {
  color: #ef4444;
}

/* --- EYE ICON BUTTON STYLES --- */
.action-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: transparent;
  padding: 0;
}
.action-icon-btn:hover {
  background-color: #f1f5f9;
  transform: scale(1.1);
}
.action-icon-btn svg {
  display: block;
  pointer-events: none;
}







/* Number columns monospace formatting */
.report-table tbody tr td:nth-child(1),
.report-table tbody tr td:nth-child(2),
.report-table tbody tr td:nth-child(3),
.report-table tbody tr td:nth-child(4),
.report-table tbody tr td:nth-child(n+7),
.report-table tbody tr td:nth-child(n+7) input,
.report-table tfoot tr td:nth-child(n+4),
.report-table tr.subtotal-row td:nth-child(n+4),
.report-table tr[style*="background-color: #1e3a8a"] td:nth-child(n+4) {
  font-family: 'Consolas', 'Courier New', monospace !important;
  font-variant-numeric: tabular-nums;
}

.report-table tr.subtotal-row td:first-child,
.report-table tr[style*="background-color: #1e3a8a"] td:first-child {
  font-family: 'Inter', 'Noto Sans JP', sans-serif !important;
}
