.aub-modal-overlay {
  z-index: 2147483000 !important;
  position: fixed !important;
  inset: 0 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}
.aub-modal-overlay[style*="display: flex"] { display: flex !important; }

.aub-modal-overlay .modal-content {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.aub-modal-overlay .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  background: #fff;
  flex-shrink: 0;
}

.aub-modal-overlay .modal-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  color: #111827;
}

.aub-modal-overlay .modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.aub-modal-overlay .modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.aub-modal-overlay .modal-body {
  padding: 16px 20px;
  overflow: auto;
}

.aub-modal-overlay .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #eee;
  background: #fff;
  flex-shrink: 0;
}

.aub-modal-content {
  width: 98vw;
  max-width: 98vw;
  height: 95vh;
  max-height: 95vh;
  border-radius: 14px;
}
.aub-table-wrap {
  padding: 0 24px 16px 24px;
  overflow: auto;
  flex: 1;
}
.aub-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
  background: #fff;
}
.aub-table th, .aub-table td {
  border-bottom: 1px solid #eee;
  padding: 12px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}
.aub-table th {
  background: #fafafa;
  position: sticky;
  top: 0;
  z-index: 1;
}
.aub-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, max-content));
  gap: 8px;
  align-content: start;
}
.aub-cashin-tag {
  color: #6b7280;
  font-weight: 500;
  font-size: 0.92em;
}

.aub-pill {
  border: 1px solid #f3c5cf;
  background: #fff7f9;
  color: #7c1d33;
  border-radius: 999px;
  padding: 4px 8px 4px 10px;
  font-size: 12px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  overflow: visible;
}
.aub-pill-text {
  overflow: hidden;
  text-overflow: ellipsis;
}
.aub-pill-menu-wrap {
  position: relative;
  flex-shrink: 0;
}
.aub-pill-menu-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #efcfd9;
  background: #fff8fa;
  color: #9f1239;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  padding: 0;
}
.aub-pill-menu-btn:hover {
  background: #ffeef3;
  border-color: #e9b7c5;
}
.aub-pill-menu {
  position: absolute;
  top: 24px;
  right: 0;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  min-width: 110px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  display: none !important;
  z-index: 25;
}
.aub-pill-menu.active { display: block !important; }
.aub-pill-menu-item {
  width: 100%;
  border: none;
  background: #fff;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
  color: #111827;
}
.aub-pill-menu-item:hover {
  background: #fff2f5;
}
.aub-menu-wrap { position: relative; display: inline-block; }
.aub-menu-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #e3e3e3;
  background: #fff;
  cursor: pointer;
}
.aub-menu {
  position: absolute;
  right: 0;
  top: 38px;
  background: #fff;
  border: 1px solid #e9e9e9;
  border-radius: 8px;
  min-width: 120px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 5;
}
.aub-menu.active { display: block; }
.aub-menu-item {
  width: 100%;
  padding: 9px 12px;
  text-align: left;
  border: none;
  background: #fff;
  cursor: pointer;
}
.aub-menu-item:hover { background: #fff2f5; }
.aub-edit-modal-content {
  width: 92vw;
  max-width: 1100px;
  max-height: 90vh;
}
.aub-edit-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px 220px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
  padding: 10px 0;
}
.aub-edit-grid-head {
  font-size: 12px;
  color: #666;
  font-weight: 600;
}
.aub-edit-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
}
.aub-hint {
  font-size: 12px;
  color: #666;
  margin-top: 8px;
}
.aub-reason-modal-content {
  width: 92vw;
  max-width: 760px;
  max-height: 85vh;
}
.aub-reason-list { display: grid; gap: 12px; }

.aub-reason-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f1f1;
}

.aub-reason-item:last-child {
  border-bottom: none;
}

.aub-reason-label {
  display: block !important;
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}

.aub-reason-input {
  display: block !important;
  width: 100%;
  min-height: 78px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
  background: #fff;
}

.aub-reason-input:focus {
  outline: none;
  border-color: #6f42c1;
  box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.12);
}

.aub-modal-overlay .btn-cancel,
.aub-modal-overlay .btn-save {
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #e5e7eb;
}

.aub-modal-overlay .btn-cancel {
  background: #fff;
  color: #374151;
}

.aub-modal-overlay .btn-save {
  border: none;
  background: linear-gradient(to right, #6f42c1, #5a2ea6);
  color: #fff;
}

.aub-modal-overlay .btn-save:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.aub-logs-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 2147483100;
  display: none;
}
.aub-logs-drawer-overlay.show {
  display: block;
}
.aub-logs-drawer {
  position: fixed;
  top: 0;
  right: -440px;
  width: min(440px, 96vw);
  height: 100vh;
  background: #fff;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
  transition: right 0.25s ease;
  z-index: 2147483110;
  display: flex;
  flex-direction: column;
}
.aub-logs-drawer.show { right: 0; }
.aub-logs-drawer-header {
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.aub-logs-drawer-title {
  font-size: 17px;
  font-weight: 700;
  color: #111827;
}
.aub-logs-drawer-subtitle {
  font-size: 11px;
  color: #6b7280;
}
.aub-logs-drawer-close {
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 20px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border-radius: 8px;
}
.aub-logs-drawer-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}
.aub-logs-drawer-body {
  padding: 12px;
  overflow: auto;
  flex: 1;
  background: #fafafa;
}

.aub-leave-logs-flow {
  position: relative;
  padding-left: 22px;
}
.aub-leave-logs-flow::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #d1d5db;
  border-radius: 2px;
}

.aub-log-item {
  position: relative;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid #d1d5db;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.aub-log-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 18px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #d1d5db;
  background: #9ca3af;
}
.aub-log-item.credit {
  border-color: #10b981;
  background: #f0fdf4;
}
.aub-log-item.credit::before {
  background: #10b981;
  box-shadow: 0 0 0 2px #10b981;
}
.aub-log-item.usage {
  border-color: #ef4444;
  background: #fef2f2;
}
.aub-log-item.usage::before {
  background: #ef4444;
  box-shadow: 0 0 0 2px #ef4444;
}
.aub-log-item.neutral {
  border-color: #f59e0b;
  background: #fffbeb;
}
.aub-log-item.neutral::before {
  background: #f59e0b;
  box-shadow: 0 0 0 2px #f59e0b;
}
.aub-log-title {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}
.aub-log-sub {
  margin-top: 2px;
  font-size: 12px;
  color: #374151;
}
.aub-log-time {
  margin-top: 6px;
  font-size: 11px;
  color: #6b7280;
}

@media (max-width: 1024px) {
  .aub-modal-content {
    width: 99vw;
    max-width: 99vw;
    height: 92vh;
    max-height: 92vh;
  }
  .aub-table {
    min-width: 760px;
  }
}

@media (max-width: 768px) {
  .aub-modal-overlay {
    padding: 10px;
  }
  .aub-modal-overlay .modal-title {
    font-size: 24px;
  }
  .aub-modal-content {
    width: 100%;
    max-width: 100%;
    height: 94vh;
    max-height: 94vh;
    border-radius: 10px;
  }
  .aub-table-wrap {
    padding: 8px 12px 12px 12px;
  }
  .aub-table,
  .aub-table thead,
  .aub-table tbody,
  .aub-table th,
  .aub-table td,
  .aub-table tr {
    display: block;
    width: 100%;
  }
  .aub-table thead {
    display: none;
  }
  .aub-table tr {
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 10px;
    background: #fff;
    padding: 6px 10px;
  }
  .aub-table td {
    border: none;
    padding: 8px 6px;
    text-align: left;
  }
  .aub-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  .aub-pills {
    grid-template-columns: 1fr;
  }
  .aub-menu-wrap {
    display: flex;
    justify-content: flex-start;
  }
}
