/* ============================================================
   HEALPRO ADMIN — Design System
   ============================================================ */

:root {
  --c-primary: #0f172a;
  --c-primary-hover: #1e293b;
  --c-accent: #0d9488;
  --c-accent-hover: #0f766e;
  --c-accent-soft: #f0fdfa;
  --c-bg: #f6f7fb;
  --c-surface: #ffffff;
  --c-sidebar: #ffffff;
  --c-sidebar-active: #f0fdfa;
  --c-sidebar-border: #e2e8f0;
  --c-sidebar-text: #334155;
  --c-sidebar-text-soft: #64748b;
  --c-sidebar-label: #94a3b8;
  --c-text: #0f172a;
  --c-text-muted: #64748b;
  --c-text-soft: #94a3b8;
  --c-border: #e2e8f0;
  --c-border-soft: #f1f5f9;
  --c-success: #10b981;
  --c-success-soft: #ecfdf5;
  --c-danger: #ef4444;
  --c-danger-soft: #fef2f2;
  --c-warning: #f59e0b;
  --c-warning-soft: #fffbeb;
  --c-info: #0ea5e9;
  --c-info-soft: #f0f9ff;
  --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.04);
  --shadow-md: 0 4px 16px -4px rgb(15 23 42 / 0.08);
  --shadow-lg: 0 12px 32px -8px rgb(15 23 42 / 0.12);
  --shadow-toast:
    0 10px 38px -10px rgba(15, 23, 42, 0.25),
    0 10px 20px -15px rgba(15, 23, 42, 0.15);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --sidebar-w: 260px;
}

* {
  box-sizing: border-box;
}

html,
body {
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-size: 14px;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.icon-sm {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.icon-lg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.icon-xl {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.admin-shell {
  min-height: 100vh;
  display: flex;
}

/* ===== LOGO / BRAND ===== */
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
  background: linear-gradient(135deg, var(--c-accent) 0%, #14b8a6 100%);
  color: white;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.logo-sidebar {
  width: 40px;
  height: 40px;
  font-size: 14px;
}
.logo-topbar {
  width: 32px;
  height: 32px;
  font-size: 12px;
  border-radius: 10px;
}
.logo-login {
  width: 64px;
  height: 64px;
  font-size: 20px;
  border-radius: 18px;
  box-shadow: 0 8px 24px -6px rgba(13, 148, 136, 0.45);
}
.brand-logo-initial {
  /* already styled above */
}
img.brand-logo {
  padding: 4px;
  background: white;
  border: 1px solid var(--c-border);
}
img.logo-login {
  padding: 6px;
  background: white;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--c-sidebar-text);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  border-right: 1px solid var(--c-sidebar-border);
  box-shadow: 12px 0 32px -24px rgba(15, 23, 42, 0.12);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 20px;
  border-bottom: 1px solid var(--c-sidebar-border);
  margin-bottom: 18px;
}
.sidebar-brand-text h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text);
  margin: 0;
  line-height: 1.2;
}
.sidebar-brand-text p {
  font-size: 11px;
  color: var(--c-sidebar-text-soft);
  margin: 2px 0 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
}
.sidebar-section {
  margin-bottom: 18px;
}
.sidebar-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-sidebar-label);
  font-weight: 700;
  padding: 0 10px 8px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--c-sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
  margin-bottom: 2px;
}
.sidebar-item:hover {
  background: #f8fafc;
  color: var(--c-accent);
}
.sidebar-item.is-active {
  background: var(--c-sidebar-active);
  color: var(--c-accent);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.12);
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--c-sidebar-border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px 12px;
}
.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent), #14b8a6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.sidebar-user-info {
  min-width: 0;
}
.sidebar-user-name {
  font-size: 13px;
  color: var(--c-text);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-email {
  font-size: 11px;
  color: var(--c-sidebar-text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 10.5px;
  color: var(--c-accent);
  font-weight: 600;
  margin-top: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: #fff5f5;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition:
    background 0.15s,
    color 0.15s;
}
.logout-btn:hover {
  background: #fef2f2;
  color: #b91c1c;
}

/* ===== TOPBAR / MOBILE ===== */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  background: white;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  align-items: center;
  justify-content: space-between;
}
.mobile-menu-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 50;
}
.mobile-overlay.is-open {
  display: block;
}

@media (max-width: 1023px) {
  .mobile-topbar {
    display: flex;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 60;
  }
  .sidebar.is-open {
    transform: translateX(0);
  }
}

/* ===== MAIN ===== */
.main {
  flex: 1;
  min-width: 0;
  padding: 22px 26px 40px;
}
@media (max-width: 640px) {
  .main {
    padding: 16px;
  }
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  margin-bottom: 10px;
}
.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
  font-size: 12.5px;
}
.breadcrumb-item a {
  color: var(--c-text-muted);
  text-decoration: none;
  padding: 3px 6px;
  border-radius: 6px;
  transition:
    background 0.15s,
    color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.breadcrumb-item a:hover {
  color: var(--c-accent);
  background: var(--c-accent-soft);
}
.breadcrumb-item.is-current span {
  color: var(--c-text);
  font-weight: 600;
  padding: 3px 6px;
}
.breadcrumb-sep {
  color: var(--c-text-soft);
  padding: 0 2px;
  font-size: 14px;
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}
.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.2;
}
.page-desc {
  font-size: 13.5px;
  color: var(--c-text-muted);
  margin-top: 4px;
}
.page-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  padding: 8px 14px;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  font-size: 13px;
}
.page-header-meta-label {
  color: var(--c-text-muted);
}
.page-header-meta-value {
  font-weight: 600;
  color: var(--c-text);
}

/* ===== CARD ===== */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-body {
  padding: 22px 24px;
}
.card-section {
  padding: 22px 24px;
  border-bottom: 1px solid var(--c-border-soft);
}
.card-section:last-child {
  border-bottom: none;
}

/* ===== STAT CARDS ===== */
.stat-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(1, 1fr);
  margin-bottom: 20px;
}
@media (min-width: 640px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.stat-icon.is-accent {
  background: var(--c-accent-soft);
  color: var(--c-accent);
}
.stat-icon.is-info {
  background: var(--c-info-soft);
  color: var(--c-info);
}
.stat-icon.is-warning {
  background: var(--c-warning-soft);
  color: var(--c-warning);
}
.stat-label {
  font-size: 13px;
  color: var(--c-text-muted);
  font-weight: 500;
}
.stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--c-text);
  margin: 4px 0 10px;
  line-height: 1;
}
.stat-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--c-text-muted);
}
.stat-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stat-dot-active {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-success);
}
.stat-dot-inactive {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cbd5e1;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 40px);
  width: 380px;
  pointer-events: none;
}
@media (max-width: 640px) {
  .toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}
.toast {
  pointer-events: auto;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-toast);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-left: 4px solid transparent;
  animation: toastIn 0.28s cubic-bezier(0.2, 0.8, 0.25, 1);
  position: relative;
  transition:
    transform 0.25s,
    opacity 0.25s;
}
.toast.is-leaving {
  opacity: 0;
  transform: translateX(24px);
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.toast-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.toast-body {
  flex: 1;
  min-width: 0;
}
.toast-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.3;
}
.toast-msg {
  font-size: 13px;
  color: var(--c-text-muted);
  margin-top: 2px;
  word-wrap: break-word;
}
.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  color: var(--c-text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    color 0.15s;
}
.toast-close:hover {
  background: #f1f5f9;
  color: var(--c-text);
}

.toast-success {
  border-left-color: var(--c-success);
}
.toast-success .toast-icon {
  background: var(--c-success-soft);
  color: var(--c-success);
}
.toast-error {
  border-left-color: var(--c-danger);
}
.toast-error .toast-icon {
  background: var(--c-danger-soft);
  color: var(--c-danger);
}
.toast-warning {
  border-left-color: var(--c-warning);
}
.toast-warning .toast-icon {
  background: var(--c-warning-soft);
  color: var(--c-warning);
}
.toast-info {
  border-left-color: var(--c-info);
}
.toast-info .toast-icon {
  background: var(--c-info-soft);
  color: var(--c-info);
}

/* Progress bar for auto-dismiss */
.toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.3;
  animation: toastProgress 5s linear forwards;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}
@keyframes toastProgress {
  from {
    width: 100%;
  }
  to {
    width: 0%;
  }
}

/* ===== FORM ===== */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--c-text);
  background: white;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  font-family: inherit;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}
.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: var(--c-danger);
  background: #fffafa;
}
.form-input.is-invalid:focus,
.form-select.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text);
  margin-bottom: 6px;
}
.form-label-required::after {
  content: " *";
  color: var(--c-danger);
}
.form-error {
  font-size: 12.5px;
  color: var(--c-danger);
  margin-top: 5px;
}
.form-hint {
  font-size: 12.5px;
  color: var(--c-text-muted);
  margin-top: 5px;
}
.form-group {
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(1, 1fr);
}
@media (min-width: 768px) {
  .form-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 992px) {
  .form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}
.form-col-full {
  grid-column: 1 / -1;
}

.form-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--c-border-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ===== CHECKBOX / TOGGLE ===== */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--c-border);
  background: white;
  transition:
    background 0.15s,
    border-color 0.15s;
  cursor: pointer;
}
.check-row:hover {
  background: #fafbfc;
}
.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--c-accent);
  cursor: pointer;
  flex-shrink: 0;
}
.check-row-label {
  font-size: 13px;
  color: var(--c-text);
  flex: 1;
}
.check-row-desc {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 2px;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.toggle-switch input {
  display: none;
}
.toggle-track {
  position: relative;
  width: 42px;
  height: 24px;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background 0.2s;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: left 0.2s;
}
.toggle-switch input:checked + .toggle-track {
  background: var(--c-accent);
}
.toggle-switch input:checked + .toggle-track .toggle-thumb {
  left: 20px;
}

/* Permission group card */
.perm-group {
  background: #fafbfc;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--radius-md);
  padding: 16px;
}
.perm-group-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--c-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.perm-list {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .perm-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== DROPZONE ===== */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  border: 1.5px dashed var(--c-border);
  border-radius: var(--radius-md);
  background: #fafbfc;
  color: var(--c-text-muted);
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
  text-align: center;
}
.dropzone:hover {
  border-color: var(--c-accent);
  background: var(--c-accent-soft);
  color: var(--c-accent);
}
.dropzone-icon {
  color: var(--c-text-soft);
  margin-bottom: 8px;
}
.dropzone-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--c-text);
}
.dropzone-hint {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 4px;
}

.preview-image {
  width: 160px;
  height: 112px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  background: #f8fafc;
}
.preview-image-lg {
  width: 100%;
  height: 180px;
}

/* ===== BUTTON ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    transform 0.08s,
    border-color 0.15s;
  font-family: inherit;
}
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--c-primary);
  color: white;
}
.btn-primary:hover {
  background: var(--c-primary-hover);
}
.btn-accent {
  background: var(--c-accent);
  color: white;
}
.btn-accent:hover {
  background: var(--c-accent-hover);
}
.btn-danger {
  background: var(--c-danger);
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
}
.btn-outline {
  background: white;
  color: var(--c-text);
  border-color: var(--c-border);
}
.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.btn-ghost {
  background: transparent;
  color: var(--c-text-muted);
}
.btn-ghost:hover {
  background: #f1f5f9;
  color: var(--c-text);
}
.btn-sm {
  padding: 7px 14px;
  font-size: 12.5px;
}
.btn-lg {
  padding: 13px 24px;
  font-size: 14px;
}

/* ===== TABLE ===== */
.table-wrap {
  margin-top: 4px;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border-soft);
}
.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table thead {
  background: #fafbfc;
}
.data-table th {
  text-align: left;
  padding: 13px 16px;
  font-weight: 600;
  color: var(--c-text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border-soft);
  color: var(--c-text);
  vertical-align: middle;
}
.data-table tbody tr:hover {
  background: #fbfcfd;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}

.col-no {
  width: 60px;
}
.col-img {
  width: 88px;
}
.col-action {
  width: 140px;
  text-align: right;
}

.thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--c-border);
  background: #f8fafc;
}
.thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-soft);
}

.text-main {
  color: var(--c-text);
  font-weight: 500;
}
.text-muted {
  color: var(--c-text-muted);
}
.text-price {
  color: var(--c-text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.empty-state {
  padding: 48px 16px !important;
  text-align: center;
}
.empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--c-info-soft);
  color: var(--c-info);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}
.empty-desc {
  font-size: 13px;
  color: var(--c-text-muted);
}

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-success {
  background: var(--c-success-soft);
  color: #047857;
}
.badge-muted {
  background: #f1f5f9;
  color: #475569;
}
.badge-accent {
  background: var(--c-accent-soft);
  color: var(--c-accent);
}
.badge-warning {
  background: var(--c-warning-soft);
  color: #b45309;
}
.badge-info {
  background: var(--c-info-soft);
  color: #0369a1;
}
.badge-danger {
  background: var(--c-danger-soft);
  color: #b91c1c;
}

/* ===== ACTION BUTTONS ===== */
.action-group {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.action-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--c-border);
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-muted);
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.action-btn:hover {
  background: #f8fafc;
}
.action-edit:hover {
  color: var(--c-info);
  border-color: #bae6fd;
  background: var(--c-info-soft);
}
.action-delete:hover {
  color: var(--c-danger);
  border-color: #fecaca;
  background: var(--c-danger-soft);
}
.action-key:hover {
  color: var(--c-warning);
  border-color: #fde68a;
  background: var(--c-warning-soft);
}

/* ===== PAGINATION ===== */
.pagination {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--c-border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
}
.pagination-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--c-border);
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--c-text);
  font-size: 13px;
  font-weight: 500;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.page-btn:hover {
  background: #f8fafc;
}
.page-btn.is-active {
  background: var(--c-primary);
  color: white;
  border-color: var(--c-primary);
}
.page-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}
.page-gap {
  padding: 0 6px;
  color: var(--c-text-muted);
}

/* ===== TOOLBAR ===== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 380px;
}
.search-box .icon-search {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-text-soft);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  background: white;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.search-box input:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
}
.modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.modal-body {
  position: relative;
  z-index: 1;
  background: white;
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.18s ease;
}
.modal-body-lg {
  max-width: 560px;
}
@keyframes modalIn {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
.modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--c-danger-soft);
  color: var(--c-danger);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.modal-icon.is-warning {
  background: var(--c-warning-soft);
  color: var(--c-warning);
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  color: var(--c-text);
}
.modal-desc {
  font-size: 13.5px;
  text-align: center;
  color: var(--c-text-muted);
  margin: 6px 0 22px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== TAB ===== */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 22px;
}
.tab-btn {
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--c-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  transition:
    color 0.15s,
    border-color 0.15s;
  font-family: inherit;
}
.tab-btn:hover {
  color: var(--c-text);
}
.tab-btn.is-active {
  color: var(--c-accent);
  border-bottom-color: var(--c-accent);
  font-weight: 600;
}

/* ===== LOGIN PAGE ===== */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f766e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.login-bg::before,
.login-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
}
.login-bg::before {
  width: 400px;
  height: 400px;
  background: #14b8a6;
  top: -100px;
  right: -100px;
}
.login-bg::after {
  width: 300px;
  height: 300px;
  background: #0ea5e9;
  bottom: -80px;
  left: -80px;
}

.login-card {
  position: relative;
  background: white;
  border-radius: 20px;
  padding: 38px 34px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.login-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--c-text);
  margin-top: 4px;
}
.login-desc {
  font-size: 13.5px;
  text-align: center;
  color: var(--c-text-muted);
  margin-top: 4px;
  margin-bottom: 26px;
}

.password-wrap {
  position: relative;
}
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px;
  color: var(--c-text-soft);
  cursor: pointer;
  border-radius: 6px;
}
.password-toggle:hover {
  color: var(--c-text);
  background: #f1f5f9;
}

/* ===== MISC ===== */
.divider {
  height: 1px;
  background: var(--c-border-soft);
  margin: 18px 0;
}
.text-center {
  text-align: center;
}
.mt-2 {
  margin-top: 8px;
}
.mt-4 {
  margin-top: 16px;
}
.mb-4 {
  margin-bottom: 16px;
}
.flex {
  display: flex;
}
.items-center {
  align-items: center;
}
.gap-2 {
  gap: 8px;
}
.gap-3 {
  gap: 12px;
}
.w-full {
  width: 100%;
}
.hidden {
  display: none !important;
}

/* ===== CODE / KBD ===== */
code,
.code {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--c-accent-hover);
}
