.forgot-password {
  display: block;
  margin: 12px auto 0;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.forgot-password:hover { text-decoration: underline; }
.forgot-password:disabled { opacity: .6; cursor: wait; }
.form-error.form-success { color: #15803d; }
.accounting-shell { min-width: 0; }
.accounting-toolbar { align-items: stretch; flex-direction: column; gap: 12px; }
.accounting-toolbar .page-description { width: 100%; max-width: none; }

.accounting-inquiry {
  width: 100%;
  display: flex;
  align-items: end;
  gap: 10px;
}

.accounting-filter-grid {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(230px, 1.6fr) repeat(4, minmax(145px, 1fr));
  gap: 8px;
  align-items: end;
}

.accounting-filter-grid > * { width: 100%; min-width: 0; }
.accounting-keyword { width: 100%; }

.accounting-date-filter {
  height: 42px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding-left: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
}

.accounting-date-filter span {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.accounting-date-filter .compact-input {
  height: 40px;
  min-width: 112px;
  padding: 0 8px 0 0;
  border: 0;
  outline: 0;
}

.compact-check {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  white-space: nowrap;
}

.accounting-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.accounting-toolbar-actions .action-button { min-height: 42px; white-space: nowrap; }
.accounting-summary { margin: 0 0 14px; }
.accounting-summary .metric-card { min-height: 88px; }
.accounting-summary .metric-value { font-size: 18px; }

.accounting-table {
  max-height: calc(100vh - 326px);
  background: #fff;
}

.accounting-table table { min-width: 960px; }
.accounting-table th,
.accounting-table td { vertical-align: top; }
.accounting-table .number { text-align: right; white-space: nowrap; }
.accounting-table .wrap-cell { min-width: 180px; max-width: 340px; white-space: normal; overflow-wrap: anywhere; line-height: 1.45; }

.coa-name {
  display: block;
  min-width: 180px;
  padding-left: calc(var(--coa-level) * 20px);
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
}

.accounting-dialog { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
.accounting-dialog .modal-content { min-height: 0; overflow: auto; }
.accounting-note { display: block; margin-top: 5px; color: #64748b; font-size: 10px; }
.accounting-detail { min-width: 0; padding: 4px 0; }
.accounting-detail span,
.accounting-detail strong { display: block; }
.accounting-detail span { margin-bottom: 5px; color: #64748b; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.accounting-detail strong { overflow-wrap: anywhere; color: #0f172a; font-size: 12px; }
.accounting-detail-lines { padding: 0 22px 18px; }
.accounting-detail-lines h3 { margin: 0 0 10px; font-size: 13px; }
.accounting-detail-lines .table-container { max-height: 320px; }
.accounting-detail-lines table { min-width: 850px; }

@media (max-width: 1280px) {
  .accounting-inquiry { align-items: stretch; flex-direction: column; }
  .accounting-filter-grid { width: 100%; grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .accounting-keyword { grid-column: span 2; }
  .accounting-toolbar-actions { justify-content: flex-end; }
}

@media (max-width: 900px) {
  .accounting-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accounting-keyword { grid-column: 1 / -1; }
  .accounting-table { max-height: none; }
}

@media (max-width: 640px) {
  .accounting-filter-grid { grid-template-columns: 1fr; }
  .accounting-keyword { grid-column: auto; }
  .accounting-toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .accounting-toolbar-actions .action-button { width: 100%; }
  .accounting-toolbar-actions .action-button:only-child { grid-column: 1 / -1; }
  .accounting-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accounting-dialog { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .accounting-dialog .form-grid { grid-template-columns: 1fr; }
  .accounting-detail-lines { padding: 0 14px 14px; }
}

@media (max-width: 390px) {
  .accounting-summary { grid-template-columns: 1fr; }
  .accounting-toolbar-actions { grid-template-columns: 1fr; }
  .accounting-toolbar-actions .action-button { grid-column: auto; }
}
