.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  background: transparent;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0 8px;
}

.tab {
  border: 0;
  background: transparent;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}

.tab-panel {
  display: none;
}

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

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(228, 233, 238, 0.95);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-top: 10px;
  line-height: 1.2;
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(228, 233, 238, 0.95);
  border-radius: 16px;
  padding: 18px 18px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.panel:last-child {
  margin-bottom: 0;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(228, 233, 238, 0.95);
}

.panel-title.with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-subtitle {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.panel-title.small {
  font-size: 14px;
  margin-bottom: 0;
}

.panel-title > span,
.panel-title.with-action > span,
.panel-title.with-action > div > span {
  letter-spacing: -0.01em;
}

.section-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.section-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.simple-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
}

.simple-table thead th {
  background: #f7faf8;
  color: #66707c;
  font-weight: 500;
  font-size: 12px;
  text-align: left;
  padding: 11px 12px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.simple-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.simple-table tbody tr:hover td {
  background: #f8fcfa;
}

.simple-table tbody tr:last-child td {
  border-bottom: 0;
}

.simple-table tbody tr:only-child td[colspan] {
  padding: 24px 16px;
  text-align: center;
  color: #8a97a6;
  background: linear-gradient(180deg, #fcfefd 0%, #f7fbf9 100%);
}

.simple-table a {
  color: #169e57;
  text-decoration: none;
}

.simple-table a:hover {
  text-decoration: underline;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 16px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.input-label {
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.form-grid input,
.form-grid select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid #d8e0e7;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.form-grid input[type="file"] {
  height: auto;
  padding: 8px 10px;
}

.form-grid input:focus,
.form-grid select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.12);
}

.form-grid input[readonly] {
  background: var(--surface-soft);
  color: var(--text-secondary);
}

.full {
  grid-column: 1 / -1;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fbfa;
}

.permission-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(228, 233, 238, 0.95);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-secondary);
}

.permission-item input[type="checkbox"] {
  margin: 0;
}

.permission-item span {
  font-size: 12px;
  line-height: 1.4;
}

button {
  font-family: inherit;
  font-size: 13px;
}

button.primary,
button.secondary,
button.danger {
  height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.16s, border-color 0.16s, color 0.16s, box-shadow 0.16s, transform 0.16s;
}

button.primary {
  background: linear-gradient(180deg, #12ca68 0%, var(--primary) 100%);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(7, 193, 96, 0.18);
}

button.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

button.secondary {
  background: #fff;
  color: #3f4954;
  border-color: #d9e2e8;
}

button.secondary:hover {
  background: #f6fbf8;
  border-color: rgba(7, 193, 96, 0.28);
  color: #116d40;
}

button.danger {
  background: #fff;
  color: var(--danger);
  border-color: #ead9d9;
}

button.danger:hover {
  background: #fff4f4;
  border-color: var(--danger);
}

button.success {
  background: linear-gradient(180deg, #2ea86d 0%, var(--success) 100%);
  color: #fff;
  border-color: var(--success);
  box-shadow: 0 8px 18px rgba(31, 122, 75, 0.18);
}

button.success:hover {
  background: #1a6b41;
  border-color: #1a6b41;
  transform: translateY(-1px);
}

button.btn-sm,
.simple-table button.primary,
.simple-table button.secondary,
.simple-table button.danger,
.simple-table button.success {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.simple-table button.primary,
.simple-table button.secondary,
.simple-table button.danger {
  border-radius: 8px;
}

label.voucher-upload-btn,
label.voucher-upload-btn * {
  color: #e53935 !important;
}

label.voucher-upload-btn {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #f1b0ad;
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s, border-color 0.16s;
}

label.voucher-upload-btn:hover {
  background: #fdecea;
  border-color: #e53935;
}

.toast {
  position: fixed;
  top: 92px;
  left: calc(var(--sidebar-toast-left, 236px) + 28px);
  right: auto;
  z-index: 2100;
  display: none;
  max-width: min(520px, calc(100vw - 32px));
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(31, 35, 41, 0.92);
  border: 1px solid rgba(31, 35, 41, 0.96);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
  pointer-events: none;
}

.toast.show {
  display: block;
}

.upload-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.upload-inline input[type="file"] {
  font-size: 12px;
}

.subtasks {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.subtask-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--surface);
  box-shadow: none;
}

.subtask-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.subtask-head strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.subtask-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-row input,
.filter-row select {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #d8e0e7;
  border-radius: var(--radius);
  background: #fff;
  font-size: 12px;
  color: var(--text);
  font-family: inherit;
}

.filter-row input:focus,
.filter-row select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.12);
}

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

.task-form-block,
.task-batch-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(228, 233, 238, 0.95);
  border-radius: 14px;
  background: linear-gradient(180deg, #fcfefd 0%, #f7fbf9 100%);
}

.task-batch-panel {
  margin-top: 16px;
}

.task-form-toolbar {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.task-form-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--text-secondary);
  font-size: 12px;
}

.task-form-toolbar input,
.task-form-toolbar select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d8e0e7;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

.compact-form {
  padding: 10px 12px;
  border: 1px solid rgba(228, 233, 238, 0.95);
  border-radius: 12px;
  background: linear-gradient(180deg, #fdfefe 0%, #f7fbf9 100%);
}

.compact-form .actions-group {
  padding: 6px 8px;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed rgba(207, 216, 223, 0.95);
}

.compact-form.form-grid {
  gap: 8px 12px;
}

.compact-form input,
.compact-form select {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
}

#finance-filter-form label,
#task-filter-form label,
#voucher-filter-form label {
  font-size: 12px;
  gap: 3px;
}

#finance-filter-form select,
#finance-filter-form input,
#task-filter-form select,
#task-filter-form input,
#voucher-filter-form select,
#voucher-filter-form input {
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  border-radius: 6px;
}

#finance-filter-form .actions-group,
#task-filter-form .actions-group,
#voucher-filter-form .actions-group {
  gap: 6px;
}

#finance-filter-form .actions-group button,
#task-filter-form .actions-group button,
#voucher-filter-form .actions-group button {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

#task-filter-form label {
  gap: 2px;
}

#task-filter-form select,
#task-filter-form input {
  height: 30px;
  padding: 0 6px;
  font-size: 12px;
}

#task-filter-form .actions-group button {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

#voucher-filter-form label {
  gap: 2px;
}

#voucher-filter-form select,
#voucher-filter-form input {
  height: 30px;
  padding: 0 6px;
  font-size: 12px;
}

#voucher-filter-form .actions-group button {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(19, 34, 56, 0.38);
}

.modal-card {
  width: min(1180px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid rgba(228, 233, 238, 0.95);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 20px 22px;
}

.preview-modal-card {
  display: grid;
  gap: 14px;
}

.dashboard-hero {
  align-items: center;
  padding: 18px 20px;
  border: 1px solid rgba(228, 233, 238, 0.95);
  border-radius: 18px;
  background: linear-gradient(135deg, #fcfefd 0%, #f3faf6 100%);
  box-shadow: var(--shadow-sm);
}

.dashboard-hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #e9fbf1;
  border: 1px solid rgba(7, 193, 96, 0.16);
  color: #157347;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stat-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 148px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfefd 100%);
}

.stat-card.compact {
  min-height: 116px;
}

.stat-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #118a4d;
  background: linear-gradient(180deg, #effcf4 0%, #e4f9ec 100%);
  border: 1px solid rgba(7, 193, 96, 0.12);
}

.stat-value.compact {
  font-size: 24px;
}

.stat-note {
  color: #8a97a6;
  font-size: 12px;
  line-height: 1.6;
}

#task-center .panel,
#reconciliation .panel,
#base-data .panel,
#system .panel {
  border-radius: 18px;
}

#task-center .actions-group[style*="margin-bottom:16px"],
#reconciliation .actions-group,
#system .actions-group {
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fcfefd 0%, #f7fbf9 100%);
  border: 1px solid rgba(228, 233, 238, 0.95);
}
