:root {
  --main-color: #3d8bc8;
  --main-color-dark: #2f75aa;
  --bg-color: #f4f7fb;
  --text-color: #1f2937;
  --muted-color: #6b7280;
  --border-color: #dbe3ea;
  --card-bg: #ffffff;
  --danger-color: #dc2626;
  --sidebar-width: 260px;
  --bottom-bar-height: 60px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-color);
  background: var(--bg-color);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.auth-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.auth-logo {
  width: 82px;
  height: 82px;
  object-fit: contain;
  border-radius: 18px;
}

.auth-title {
  margin: 0 0 8px;
  text-align: center;
  font-size: 26px;
  line-height: 1.3;
}

.auth-subtitle {
  margin: 0 0 24px;
  text-align: center;
  color: var(--muted-color);
  font-size: 14px;
}

.form-group,
.form-row {
  margin-top: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 14px;
}

.form-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 16px;
  background: #fff;
}

.form-input:focus {
  outline: 3px solid rgba(61, 139, 200, 0.18);
  border-color: var(--main-color);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--main-color);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  background: var(--main-color-dark);
}

.btn-block {
  width: 100%;
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-list {
  margin: 8px 0 0;
  padding-left: 20px;
}

.app-layout {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-width);
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  padding: 18px 14px;
  overflow-y: auto;
  transition: transform 0.2s ease;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  flex: 0 0 auto;
}

.sidebar-brand-text {
  color: var(--main-color);
  font-size: 19px;
  font-weight: 800;
  white-space: nowrap;
}

.sidebar-close,
.topbar-menu-button,
.bottom-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-color);
  cursor: pointer;
}

.sidebar-close {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  color: #334155;
  font-weight: 700;
}

.sidebar-link:hover,
.sidebar-link.is-active {
  background: rgba(61, 139, 200, 0.12);
  color: var(--main-color-dark);
}

.nav-icon {
  width: 1.6em;
  text-align: center;
  flex: 0 0 auto;
}

.main {
  margin-left: var(--sidebar-width);
  min-width: 0;
  transition: margin-left 0.2s ease;
}

.topbar {
  min-height: 64px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
}

.topbar > div:first-child {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-menu-button {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 20px;
}

.topbar-title {
  font-weight: 800;
}

.topbar-user {
  color: var(--muted-color);
  font-size: 14px;
  white-space: nowrap;
}

.content {
  padding: 24px;
  width: 100%;
  min-width: 0;
}

.page-title {
  margin: 0 0 18px;
  font-size: 28px;
  line-height: 1.3;
}

.card {
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
}

.card-title {
  margin: 0 0 12px;
  font-size: 18px;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-description {
  margin: -8px 0 0;
  color: var(--muted-color);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.summary-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px;
}

.summary-label {
  display: block;
  color: var(--muted-color);
  font-size: 13px;
  font-weight: 700;
}

.summary-value {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.2;
}

.admin-card + .admin-card {
  margin-top: 16px;
}

.search-form {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.search-field {
  flex: 1 1 280px;
}

.search-field-status {
  flex: 0 0 180px;
}

.search-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-sub {
  background: #e5eef7;
  color: var(--main-color-dark);
}

.btn-sub:hover {
  background: #d8e7f5;
}

.admin-table-wrap,
.table-responsive {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.admin-table th {
  color: #334155;
  background: #f8fafc;
  font-weight: 800;
  white-space: nowrap;
}

.table-subtext {
  display: block;
  margin-top: 4px;
  color: var(--muted-color);
  font-size: 12px;
  line-height: 1.5;
}

.table-empty {
  padding: 28px 10px;
  color: var(--muted-color);
  text-align: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-active {
  background: #ecfdf3;
  color: #166534;
}

.status-paid {
  background: #dcfce7;
  color: #15803d;
}

.status-inactive {
  background: #f1f5f9;
  color: #475569;
}

.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(61, 139, 200, 0.12);
  color: var(--main-color-dark);
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.table-action + .table-action,
.table-action + .inline-form,
.inline-form + .table-action,
.inline-form + .inline-form {
  margin-left: 6px;
}

.table-action-danger {
  background: #fef2f2;
  color: #991b1b;
}

.inline-form {
  display: inline-flex !important;
  align-items: center;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

.admin-table td:last-child {
  white-space: nowrap;
}

.admin-table td:last-child .table-action,
.admin-table td:last-child .inline-form {
  vertical-align: middle;
}

.form-section + .form-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border-color);
}

.form-section-title {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.4;
}

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

.form-group-wide {
  grid-column: 1 / -1;
}

.form-textarea {
  min-height: 110px;
  resize: vertical;
}

.required-label {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 11px;
  font-weight: 800;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.sidebar-overlay {
  display: none;
}

.bottom-menu-bar {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 60;
  min-height: var(--bottom-bar-height);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  align-items: center;
  gap: 12px;
}

.bottom-menu-button {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 22px;
  flex: 0 0 auto;
}

.bottom-site-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
  color: var(--main-color-dark);
}

.bottom-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 9px;
}

body.sidebar-collapsed .sidebar {
  transform: translateX(-100%);
}

body.sidebar-collapsed .main {
  margin-left: 0;
}

body.sidebar-collapsed .bottom-menu-bar {
  display: none;
}

@media (max-width: 900px) {
  body {
    padding-bottom: calc(var(--bottom-bar-height) + 28px);
  }

  .sidebar {
    transform: translateX(-100%);
    width: min(86vw, var(--sidebar-width));
    box-shadow: none;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    padding: 12px 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-menu-button {
    display: none;
  }

  .sidebar-close {
    display: inline-flex;
  }

  .content {
    padding: 16px;
  }

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

  .page-head {
    display: block;
  }

  .page-head .btn {
    margin-top: 12px;
    width: 100%;
  }

  .search-form {
    display: block;
  }

  .search-field + .search-field,
  .search-actions {
    margin-top: 14px;
  }

  .search-actions .btn,
  .form-actions .btn {
    width: 100%;
  }

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

  body.sidebar-collapsed .bottom-menu-bar {
    display: flex;
  }

  body.sidebar-mobile-open .bottom-menu-bar {
    display: none;
  }

  body.sidebar-mobile-open .sidebar {
    transform: translateX(0);
    box-shadow: 18px 0 40px rgba(15, 23, 42, 0.18);
  }

  body.sidebar-mobile-open .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(15, 23, 42, 0.35);
  }
}

.template-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.template-info-grid > div {
  min-width: 0;
}

.template-info-grid strong {
  display: block;
  margin-top: 6px;
  word-break: break-word;
}

.placement-table {
  min-width: 1180px;
}

.placement-table th,
.placement-table td {
  vertical-align: middle;
}

.placement-input {
  width: 96px;
  min-height: 38px;
  padding: 7px 9px;
}

.placement-align {
  width: 110px;
  min-height: 38px;
  padding: 7px 9px;
}

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


/* 請求書明細テーブル */
.invoice-item-date-cell {
  min-width: 150px;
}

.invoice-item-type-cell {
  min-width: 150px;
}

.invoice-item-content-cell {
  min-width: 260px;
}

.invoice-item-row .item-type {
  min-width: 138px;
  padding-right: 34px;
}

.invoice-item-row .item-date {
  min-width: 140px;
}

.invoice-item-row .item-quantity {
  min-width: 92px;
}

.invoice-item-row .item-unit {
  min-width: 108px;
}

.invoice-item-row .item-unit-price,
.invoice-item-row .item-amount {
  min-width: 128px;
}

/* 請求書メール送信準備 */
.section-title {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.4;
}

.form-field {
  min-width: 0;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.form-control {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 16px;
  background: #fff;
}

.form-control:focus {
  outline: 3px solid rgba(61, 139, 200, 0.18);
  border-color: var(--main-color);
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
  line-height: 1.7;
}

.readonly-box {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text-color);
  line-height: 1.7;
  word-break: break-word;
}

.invoice-payment-status-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.invoice-payment-status-box.is-paid {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.invoice-payment-status-date {
  color: var(--muted-color);
  font-size: 13px;
  font-weight: 700;
}

.required {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 11px;
  font-weight: 800;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

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

.btn:disabled:hover {
  background: var(--main-color);
}

.form-error {
  margin: 6px 0 0;
  color: #991b1b;
  font-size: 13px;
  font-weight: 700;
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nowrap {
  white-space: nowrap;
}

.status-pending {
  background: #fffbeb;
  color: #92400e;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.placeholder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: #f8fafc;
}

.placeholder-item code {
  flex: 0 0 auto;
  color: var(--main-color-dark);
  font-weight: 800;
}

.placeholder-item span {
  color: var(--muted-color);
  font-size: 13px;
}

@media (max-width: 900px) {
  .page-actions {
    margin-top: 12px;
    justify-content: stretch;
  }

  .page-actions .btn {
    width: 100%;
  }

  .placeholder-grid {
    grid-template-columns: 1fr;
  }
}


/* 請求書明細並び替え */
.invoice-item-sort-cell {
  width: 106px;
  min-width: 106px;
}

.invoice-sort-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.invoice-drag-handle,
.invoice-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  color: var(--main-color-dark);
  font-weight: 800;
  cursor: pointer;
}

.invoice-drag-handle {
  cursor: grab;
}

.invoice-drag-handle:active {
  cursor: grabbing;
}

.invoice-sort-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.invoice-item-row.is-dragging {
  opacity: 0.45;
}

.invoice-item-row.is-dragging td {
  background: #eff6ff;
}

/* 一覧テーブル列幅調整 */
.user-list-table th:nth-child(2),
.user-list-table td:nth-child(2) {
  min-width: 80px;
}

.user-list-table th:nth-child(4),
.user-list-table td:nth-child(4) {
  min-width: 150px;
}

.user-list-table th:nth-child(5),
.user-list-table td:nth-child(5) {
  min-width: 90px;
}

.estimate-list-table.is-system-admin th:nth-child(3),
.estimate-list-table.is-system-admin td:nth-child(3),
.estimate-list-table.is-company-user th:nth-child(2),
.estimate-list-table.is-company-user td:nth-child(2) {
  min-width: 140px;
}

.estimate-list-table.is-system-admin th:nth-child(4),
.estimate-list-table.is-system-admin td:nth-child(4),
.estimate-list-table.is-company-user th:nth-child(3),
.estimate-list-table.is-company-user td:nth-child(3) {
  min-width: 180px;
}

.estimate-list-table.is-system-admin th:nth-child(7),
.estimate-list-table.is-system-admin td:nth-child(7),
.estimate-list-table.is-company-user th:nth-child(6),
.estimate-list-table.is-company-user td:nth-child(6),
.estimate-list-table.is-system-admin th:nth-child(8),
.estimate-list-table.is-system-admin td:nth-child(8),
.estimate-list-table.is-company-user th:nth-child(7),
.estimate-list-table.is-company-user td:nth-child(7) {
  min-width: 140px;
}

.estimate-list-table.is-system-admin th:nth-child(10),
.estimate-list-table.is-system-admin td:nth-child(10),
.estimate-list-table.is-company-user th:nth-child(9),
.estimate-list-table.is-company-user td:nth-child(9) {
  min-width: 90px;
}

.invoice-list-table.is-system-admin th:nth-child(3),
.invoice-list-table.is-system-admin td:nth-child(3),
.invoice-list-table.is-company-user th:nth-child(2),
.invoice-list-table.is-company-user td:nth-child(2) {
  min-width: 140px;
}

.invoice-list-table.is-system-admin th:nth-child(4),
.invoice-list-table.is-system-admin td:nth-child(4),
.invoice-list-table.is-company-user th:nth-child(3),
.invoice-list-table.is-company-user td:nth-child(3) {
  min-width: 70px;
}

.invoice-list-table.is-system-admin th:nth-child(7),
.invoice-list-table.is-system-admin td:nth-child(7),
.invoice-list-table.is-company-user th:nth-child(6),
.invoice-list-table.is-company-user td:nth-child(6) {
  min-width: 140px;
}

.invoice-list-table.is-system-admin th:nth-child(10),
.invoice-list-table.is-system-admin td:nth-child(10),
.invoice-list-table.is-company-user th:nth-child(9),
.invoice-list-table.is-company-user td:nth-child(9) {
  min-width: 90px;
}

.invoice-reminder-list-table th:nth-child(1),
.invoice-reminder-list-table td:nth-child(1) {
  min-width: 90px;
}

.invoice-reminder-list-table.is-system-admin th:nth-child(3),
.invoice-reminder-list-table.is-system-admin td:nth-child(3),
.invoice-reminder-list-table.is-company-user th:nth-child(2),
.invoice-reminder-list-table.is-company-user td:nth-child(2) {
  min-width: 140px;
}

.invoice-reminder-list-table.is-system-admin th:nth-child(4),
.invoice-reminder-list-table.is-system-admin td:nth-child(4),
.invoice-reminder-list-table.is-company-user th:nth-child(3),
.invoice-reminder-list-table.is-company-user td:nth-child(3) {
  min-width: 180px;
}

.invoice-reminder-list-table.is-system-admin th:nth-child(5),
.invoice-reminder-list-table.is-system-admin td:nth-child(5),
.invoice-reminder-list-table.is-company-user th:nth-child(4),
.invoice-reminder-list-table.is-company-user td:nth-child(4) {
  min-width: 80px;
}

.table-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.table-actions form {
  display: inline-flex;
  margin: 0;
}

/* 未入金一覧 */
.dashboard-unpaid-card {
  margin-top: 24px;
}

.summary-card-alert {
  border-color: #fecaca;
  background: #fff7f7;
}

.summary-card-alert .summary-label,
.summary-card-alert .summary-value {
  color: #991b1b;
}

.status-overdue {
  background: #fef2f2;
  color: #991b1b;
}

.invoice-unpaid-table,
.dashboard-unpaid-table {
  table-layout: fixed;
}

.invoice-unpaid-table.is-system-admin {
  min-width: 1280px;
}

.invoice-unpaid-table.is-company-user {
  min-width: 1180px;
}

.dashboard-unpaid-table.is-system-admin {
  min-width: 1120px;
}

.dashboard-unpaid-table.is-company-user {
  min-width: 980px;
}

.invoice-unpaid-table th,
.invoice-unpaid-table td,
.dashboard-unpaid-table th,
.dashboard-unpaid-table td {
  vertical-align: middle;
}

.invoice-unpaid-table.is-system-admin th:nth-child(1),
.invoice-unpaid-table.is-system-admin td:nth-child(1),
.dashboard-unpaid-table.is-system-admin th:nth-child(1),
.dashboard-unpaid-table.is-system-admin td:nth-child(1) {
  width: 150px;
}

.invoice-unpaid-table.is-system-admin th:nth-child(2),
.invoice-unpaid-table.is-system-admin td:nth-child(2),
.invoice-unpaid-table.is-company-user th:nth-child(1),
.invoice-unpaid-table.is-company-user td:nth-child(1),
.dashboard-unpaid-table.is-system-admin th:nth-child(2),
.dashboard-unpaid-table.is-system-admin td:nth-child(2),
.dashboard-unpaid-table.is-company-user th:nth-child(1),
.dashboard-unpaid-table.is-company-user td:nth-child(1) {
  width: 170px;
}

.invoice-unpaid-table.is-system-admin th:nth-child(3),
.invoice-unpaid-table.is-system-admin td:nth-child(3),
.invoice-unpaid-table.is-company-user th:nth-child(2),
.invoice-unpaid-table.is-company-user td:nth-child(2),
.dashboard-unpaid-table.is-system-admin th:nth-child(3),
.dashboard-unpaid-table.is-system-admin td:nth-child(3),
.dashboard-unpaid-table.is-company-user th:nth-child(2),
.dashboard-unpaid-table.is-company-user td:nth-child(2) {
  width: 140px;
}

.invoice-unpaid-table.is-system-admin th:nth-child(4),
.invoice-unpaid-table.is-system-admin td:nth-child(4),
.invoice-unpaid-table.is-company-user th:nth-child(3),
.invoice-unpaid-table.is-company-user td:nth-child(3),
.dashboard-unpaid-table.is-system-admin th:nth-child(4),
.dashboard-unpaid-table.is-system-admin td:nth-child(4),
.dashboard-unpaid-table.is-company-user th:nth-child(3),
.dashboard-unpaid-table.is-company-user td:nth-child(3) {
  width: 220px;
}

.invoice-unpaid-table.is-system-admin th:nth-child(5),
.invoice-unpaid-table.is-system-admin td:nth-child(5),
.invoice-unpaid-table.is-company-user th:nth-child(4),
.invoice-unpaid-table.is-company-user td:nth-child(4),
.invoice-unpaid-table.is-system-admin th:nth-child(7),
.invoice-unpaid-table.is-system-admin td:nth-child(7),
.invoice-unpaid-table.is-company-user th:nth-child(6),
.invoice-unpaid-table.is-company-user td:nth-child(6),
.dashboard-unpaid-table.is-system-admin th:nth-child(5),
.dashboard-unpaid-table.is-system-admin td:nth-child(5),
.dashboard-unpaid-table.is-company-user th:nth-child(4),
.dashboard-unpaid-table.is-company-user td:nth-child(4),
.dashboard-unpaid-table.is-system-admin th:nth-child(7),
.dashboard-unpaid-table.is-system-admin td:nth-child(7),
.dashboard-unpaid-table.is-company-user th:nth-child(6),
.dashboard-unpaid-table.is-company-user td:nth-child(6) {
  width: 118px;
}

.invoice-unpaid-table.is-system-admin th:nth-child(6),
.invoice-unpaid-table.is-system-admin td:nth-child(6),
.invoice-unpaid-table.is-company-user th:nth-child(5),
.invoice-unpaid-table.is-company-user td:nth-child(5),
.dashboard-unpaid-table.is-system-admin th:nth-child(6),
.dashboard-unpaid-table.is-system-admin td:nth-child(6),
.dashboard-unpaid-table.is-company-user th:nth-child(5),
.dashboard-unpaid-table.is-company-user td:nth-child(5) {
  width: 130px;
}

.invoice-unpaid-table.is-system-admin th:nth-child(8),
.invoice-unpaid-table.is-system-admin td:nth-child(8),
.invoice-unpaid-table.is-company-user th:nth-child(7),
.invoice-unpaid-table.is-company-user td:nth-child(7),
.dashboard-unpaid-table.is-system-admin th:nth-child(8),
.dashboard-unpaid-table.is-system-admin td:nth-child(8),
.dashboard-unpaid-table.is-company-user th:nth-child(7),
.dashboard-unpaid-table.is-company-user td:nth-child(7) {
  width: 150px;
}

.invoice-unpaid-table.is-system-admin th:nth-child(9),
.invoice-unpaid-table.is-system-admin td:nth-child(9),
.invoice-unpaid-table.is-company-user th:nth-child(8),
.invoice-unpaid-table.is-company-user td:nth-child(8) {
  width: 100px;
}

.invoice-unpaid-table.is-system-admin th:nth-child(10),
.invoice-unpaid-table.is-system-admin td:nth-child(10),
.invoice-unpaid-table.is-company-user th:nth-child(9),
.invoice-unpaid-table.is-company-user td:nth-child(9) {
  width: 260px;
  min-width: 260px;
}

.unpaid-subject-cell {
  word-break: break-word;
}

.unpaid-number-cell,
.unpaid-date-cell,
.unpaid-amount-cell,
.unpaid-status-cell,
.unpaid-action-cell,
.unpaid-elapsed-cell {
  white-space: nowrap;
}

.unpaid-amount-cell {
  text-align: right;
  font-weight: 800;
}

.unpaid-link {
  color: var(--main-color-dark);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.unpaid-elapsed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.unpaid-elapsed.is-overdue {
  background: #fef2f2;
  color: #991b1b;
}

.unpaid-elapsed.is-due-today {
  background: #fffbeb;
  color: #92400e;
}

.invoice-unpaid-table tr.is-overdue td,
.dashboard-unpaid-table tr.is-overdue td {
  background: #fff7f7;
}

.invoice-unpaid-table tr.is-due-today td,
.dashboard-unpaid-table tr.is-due-today td {
  background: #fffdf2;
}

@media (max-width: 900px) {
  .invoice-unpaid-table th,
  .invoice-unpaid-table td,
  .dashboard-unpaid-table th,
  .dashboard-unpaid-table td {
    padding: 10px 8px;
    font-size: 13px;
  }

  .unpaid-elapsed {
    min-width: 96px;
    padding: 4px 8px;
  }
}
