/*
Template Name: Steex - Admin & Dashboard Template
Author: Themesbrand
Website: https://themesbrand.com/
Contact: support@themesbrand.com
File: Custom Css File

Aurolab brand override — primary #016481 (deep teal, structural),
accent #1BB1AF (bright teal, interactive/CTA). Applied on top of the
Velzon design-system variables so every component (buttons, badges,
tables, sidebar, topbar) picks the new palette up automatically.
*/

:root {
  --tb-primary: #1BB1AF;
  --tb-primary-rgb: 27, 177, 175;
  --tb-primary-bg-subtle: rgba(27, 177, 175, 0.15);
  --tb-primary-border-subtle: rgba(27, 177, 175, 0.3);
  --tb-primary-text-emphasis: #0d8785;
  --tb-link-color: #016481;
  --tb-link-hover-color: #1BB1AF;

  /* ---- Phakic Portal design tokens ----
     Use these instead of hard-coded values in page styles. */
  --ap-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ap-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ap-brand-800: #014a5f;
  --ap-brand-700: #016481;   /* structural: sidebar, headings accents */
  --ap-brand-600: #0F6674;   /* text on light brand backgrounds */
  --ap-brand-500: #1BB1AF;   /* interactive: buttons, links, focus */
  --ap-brand-100: #DDF4F6;
  --ap-brand-50:  #f2fafb;

  --ap-gray-900: #101828;
  --ap-gray-800: #1d2939;
  --ap-gray-700: #344054;
  --ap-gray-600: #475467;
  --ap-gray-500: #667085;
  --ap-gray-400: #98a2b3;
  --ap-gray-300: #d0d5dd;
  --ap-gray-200: #e4e7ec;
  --ap-gray-100: #f2f4f7;
  --ap-gray-50:  #f9fafb;

  --ap-success-700: #05603a; --ap-success-500: #12b76a; --ap-success-200: #abefc6; --ap-success-50: #ecfdf3;
  --ap-warning-700: #b54708; --ap-warning-500: #f79009; --ap-warning-200: #fedf89; --ap-warning-50: #fffaeb;
  --ap-danger-700:  #b42318; --ap-danger-600:  #d92d20; --ap-danger-200:  #fecdca; --ap-danger-50:  #fef3f2;
  --ap-info-700:    #175cd3; --ap-info-500:    #2e90fa; --ap-info-200:    #b2ddff; --ap-info-50:    #eff8ff;
  --ap-purple-700:  #6941c6; --ap-purple-50:   #f4f3ff; --ap-purple-200:  #d9d6fe;

  --ap-radius-sm: 6px;
  --ap-radius-md: 8px;
  --ap-radius-lg: 12px;
  --ap-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --ap-shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --ap-shadow-lg: 0 12px 24px -4px rgba(16, 24, 40, 0.12), 0 4px 8px -2px rgba(16, 24, 40, 0.06);
  --ap-focus-ring: 0 0 0 4px rgba(27, 177, 175, 0.18);

  --tb-body-font-family: var(--ap-font);
  --tb-font-family-primary: var(--ap-font);
  --tb-body-color: var(--ap-gray-800);
  --tb-body-bg: #eef4f6;
}

/* The active theme (data-theme="interaction" on <html>, set in _layout.html)
   defines --tb-font-sans-serif as "Nunito" - this is the variable most of
   the theme's own components (sidebar nav links, cards, etc.) actually read,
   separate from --tb-font-family-primary above. Point it at the portal font. */
[data-theme="interaction"] {
  --tb-font-sans-serif: var(--ap-font);
  --tb-font-monospace: var(--ap-font-mono);
}

body,
h1, h2, h3, h4, h5, h6,
button, input, select, textarea, optgroup,
table, th, td,
.btn, .form-control, .form-select {
  font-family: var(--ap-font);
}

/* ---- Sidebar ---- */
/* html[data-sidebar] outranks the theme's [data-sidebar=dark] palette. */
html,
html[data-sidebar] {
  --tb-vertical-menu-bg: #016481;
  --tb-vertical-menu-border: #016481;
  --tb-vertical-menu-item-color: rgba(255, 255, 255, 0.72);
  --tb-vertical-menu-item-hover-color: #fff;
  --tb-vertical-menu-item-hover-bg: rgba(255, 255, 255, 0.08);
  --tb-vertical-menu-item-active-color: #fff;
  --tb-vertical-menu-item-active-bg: rgba(255, 255, 255, 0.14);
  --tb-vertical-menu-sub-item-color: rgba(255, 255, 255, 0.65);
  --tb-vertical-menu-sub-item-hover-color: #fff;
  --tb-vertical-menu-sub-item-active-color: #fff;
  --tb-vertical-menu-title-color: rgba(255, 255, 255, 0.55);
}

.app-menu {
  padding-bottom: 84px;
  padding-left: 0;
  padding-right: 0;
  /* Modern gradient: soft brand glow at the top, deepening teal below */
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(27, 177, 175, 0.35) 0%, rgba(27, 177, 175, 0) 60%),
    radial-gradient(90% 40% at 100% 100%, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0) 70%),
    linear-gradient(165deg, #0a7d90 0%, #016481 45%, #014b61 100%);
  border-right: 0;
  box-shadow: 1px 0 0 rgba(16, 24, 40, 0.06), 4px 0 24px rgba(1, 75, 97, 0.12);
}
/* The theme's own sidebar background layer would hide the gradient */
.app-menu .sidebar-background { display: none; }

/* Flat menu: rows, not boxed tiles */
.app-menu .navbar-nav {
  display: flex;
  flex-direction: column;
  padding: 0 12px 100px;
  margin: 0;
}
.app-menu .navbar-nav .nav-item {
  margin: 0 0 2px 0;
}
.app-menu .navbar-nav .nav-link,
.app-menu .navbar-nav > li > a {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.005em;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.app-menu .navbar-nav .nav-link i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  min-width: 20px;
  height: 20px;
  background: none;
  border-radius: 0;
  font-size: 1.05rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.15s ease;
}
.app-menu .navbar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: none;
}
.app-menu .navbar-nav .nav-link:hover i { color: #fff; background: none; }
/* Active page: lighter row + white accent bar on the left */
.app-menu .navbar-nav .nav-link.active {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.08) 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 4px 14px rgba(0, 0, 0, 0.12);
}
.app-menu .navbar-nav .nav-link.active i { color: #fff; background: none; }
.app-menu .navbar-nav .nav-link.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #fff;
}
.app-menu .navbar-nav .nav-link:focus { outline: none; box-shadow: none; }
.app-menu .navbar-nav .nav-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: -2px;
  box-shadow: none;
}
.app-menu .menu-title {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 12px 6px;
  margin: 0;
}
.navbar-brand-box {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0;
  padding: 20px 20px 18px;
}
/* The theme gives .logo a full header-height line box (~70px) - keep the
   logo block only as tall as the logo itself. */
.navbar-brand-box .logo {
  display: block;
  line-height: 1;
}

/* ---- Sidebar bottom user card ---- */
.sidebar-user-card {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.2) 100%);
  backdrop-filter: blur(6px);
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 14px 16px 14px 20px;
}
.sidebar-user-card .avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2fd0c9 0%, var(--ap-brand-500) 55%, #128f8d 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), 0 4px 10px rgba(0, 0, 0, 0.15);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-user-card .info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.sidebar-user-card .info .name {
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-card .info .role {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
  font-size: 0.75rem;
}
.sidebar-user-card .logout-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.sidebar-user-card .logout-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.sidebar-user-card .logout-btn:focus { outline: none; box-shadow: none; }
.sidebar-user-card .logout-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 1px;
}

/* ---- Brand logo image (on dark/teal backgrounds) ---- */
.brand-logo-plate {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 10px;
  padding: 6px 8px;
  width: 100%;
  box-sizing: border-box;
  margin: 10px 0;
}
.brand-logo-plate img {
  display: block;
  height: 58px;
  width: auto;
}
.login-brand.brand-logo-plate {
  padding: 12px 18px;
}
.login-brand.brand-logo-plate img {
  height: 42px;
  width: auto;
}
.brand-logo-plain img {
  display: block;
  height: 60px;
  width: auto;
}
.brand-logo-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Brand wordmark (replaces raster logo) ---- */
.navbar-brand-box .brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #1BB1AF;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}
.navbar-brand-box .brand-wordmark {
  display: block;
  color: #fff;
  font-weight: 800;
  font-size: 30px;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.navbar-brand-box .brand-tagline {
  display: block;
  color: #8FD4D3;
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 0.13em;
  line-height: 1.4;
}
.navbar-brand-box .logo-lg {
  display: flex;
  flex-direction: column;
}

/* ---- Topbar ---- */
html {
  --tb-topbar-user-bg: rgba(1, 100, 129, 0.08);
}
.header-profile-user {
  background: #e6fbfa;
}

/* ---- Buttons ---- */
.btn-primary {
  --tb-btn-bg: #1BB1AF;
  --tb-btn-border-color: #1BB1AF;
  --tb-btn-hover-bg: #159c9a;
  --tb-btn-hover-border-color: #159c9a;
  --tb-btn-active-bg: #148b89;
  --tb-btn-active-border-color: #148b89;
  --tb-btn-shadow: 0 2px 6px rgba(27, 177, 175, 0.25);
}

/* ---- Badges / status pills ---- */
.badge {
  font-weight: 700;
  border-radius: 999px;
  padding: 0.4em 0.85em;
  font-size: 0.75rem;
}
.badge.badge-border {
  border: none;
}

/* ---- Row action buttons (btn-subtle-*) ---- */
.btn-subtle-primary,
.btn-subtle-secondary,
.btn-subtle-success,
.btn-subtle-danger,
.btn-subtle-warning {
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid transparent;
}
.btn-subtle-primary:hover,
.btn-subtle-secondary:hover,
.btn-subtle-success:hover,
.btn-subtle-danger:hover,
.btn-subtle-warning:hover {
  transform: translateY(-1px);
}

/* View / Chat action buttons: use the solid "hover" color as the resting
   state too, for visibility at a glance in dense tables. */
.btn-subtle-primary {
  --tb-btn-color: #fff;
  --tb-btn-bg: #1BB1AF;
  --tb-btn-border-color: #1BB1AF;
  --tb-btn-hover-color: #fff;
  --tb-btn-hover-bg: #159c9a;
  --tb-btn-hover-border-color: #159c9a;
  --tb-btn-active-bg: #148b89;
  --tb-btn-active-border-color: #148b89;
}
.btn-subtle-info {
  --tb-btn-color: #fff;
  --tb-btn-bg: #30E0EC;
  --tb-btn-border-color: #30E0EC;
  --tb-btn-hover-color: #fff;
  --tb-btn-hover-bg: #1FC9D5;
  --tb-btn-hover-border-color: #1FC9D5;
  --tb-btn-active-bg: #16B4C0;
  --tb-btn-active-border-color: #16B4C0;
}
.btn-subtle-success {
  --tb-btn-color: #fff;
  --tb-btn-bg: #2ECC71;
  --tb-btn-border-color: #2ECC71;
  --tb-btn-hover-color: #fff;
  --tb-btn-hover-bg: #27B863;
  --tb-btn-hover-border-color: #27B863;
  --tb-btn-active-bg: #22A458;
  --tb-btn-active-border-color: #22A458;
}
.btn-subtle-danger {
  --tb-btn-color: #fff;
  --tb-btn-bg: #F87171;
  --tb-btn-border-color: #F87171;
  --tb-btn-hover-color: #fff;
  --tb-btn-hover-bg: #EF4444;
  --tb-btn-hover-border-color: #EF4444;
  --tb-btn-active-bg: #DC2626;
  --tb-btn-active-border-color: #DC2626;
}

/* ---- Search inputs (DataTables filter, generic search) ---- */
.dataTables_filter input,
input[type="search"] {
  border-radius: 999px !important;
  padding: 0.45rem 1rem !important;
  border: 1px solid var(--tb-border-color) !important;
}
.dataTables_wrapper .dataTables_filter label {
  font-weight: 400;
}
.dataTables_wrapper .dataTables_info {
  color: #64748B;
  font-size: 0.8125rem;
  padding-top: 1rem !important;
}

/* ---- Pagination ---- */
.pagination .page-item.active .page-link {
  background-color: #016481;
  border-color: #016481;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 8px !important;
  margin-left: 4px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: #016481 !important;
  border-color: #016481 !important;
  color: #fff !important;
}

/* ---- Cards / tables ---- */
.card {
  border-radius: 12px;
  border: 1px solid var(--tb-border-color);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
}
.table > thead {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.78rem;
}
.table > thead th {
  background-color: #DDF4F6;
  color: #0F6674;
  border-bottom-color: #BFE9EC !important;
}
#confirmedpatientstable th {
  text-align: center !important;
}
#confirmedpatientstable td {
  text-align: left !important;
}
#confirmedpatientstable td.dataTables_empty {
  text-align: center !important;
}
.table > tbody > tr:hover {
  background-color: #F7F9FA;
}
#patienttable td a,
#hosptable td a,
#confirmedpatientstable td a {
  color: #016481;
  font-weight: 600;
  text-decoration: none;
}
#patienttable td a:hover,
#hosptable td a:hover,
#confirmedpatientstable td a:hover {
  color: #1BB1AF;
  text-decoration: none;
}
.page-title-box h4 {
  font-weight: 800;
  color: #1E293B;
}

/* ---- Footer ---- */
.footer {
  color: #64748B;
}

/* ---- Breadcrumb ---- */
.page-breadcrumb {
  font-size: 0.8125rem;
  color: var(--tb-secondary-color);
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-breadcrumb a {
  color: #1BB1AF;
  text-decoration: none;
  font-weight: 500;
}
.page-breadcrumb a:hover {
  color: #016481;
}
.page-breadcrumb .sep {
  color: var(--tb-border-color);
}
.page-breadcrumb .current {
  color: var(--tb-body-color);
  font-weight: 600;
}
.main-content.no-topbar .page-content {
  padding-top: var(--tb-grid-gutter-width);
}

/* ---- Table toolbar (count + refresh/filter/export + search) ---- */
.table-toolbar {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--tb-border-color);
}
.table-count {
  font-size: 0.8125rem;
  color: var(--tb-secondary-color);
}
.table-count strong {
  color: #1BB1AF;
  font-weight: 700;
}
.btn-icon-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--tb-border-color);
  background: transparent;
  color: var(--tb-secondary-color);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-icon-outline:hover {
  background: var(--tb-light);
  border-color: #1BB1AF;
  color: #1BB1AF;
}
.table-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--tb-border-color);
  border-radius: 999px;
  padding: 0 14px;
  height: 34px;
  width: 220px;
}
.table-search-box i {
  color: var(--tb-secondary-color);
  font-size: 0.95rem;
}
.table-search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.8125rem;
  color: var(--tb-body-color);
  width: 100%;
}

/* =====================================================================
   Phakic Portal design system - shared components
   (tokens are defined at the top of this file: --ap-*)
   ===================================================================== */

body {
  color: var(--ap-gray-800);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Accessibility: visible keyboard focus everywhere ---- */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
[role="button"]:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--ap-brand-500);
  outline-offset: 2px;
  box-shadow: none;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; }
}

/* ---- Brand logo in the sidebar ---- */
.brand-logo-img {
  height: 18px;
  width: auto;
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

/* ---- Page header (title + subtitle + actions) ---- */
.page-title-box {
  padding-bottom: 1.25rem;
  gap: 12px;
}
.page-title-box h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ap-gray-900);
  letter-spacing: -0.01em;
  margin-bottom: 0;
}
.page-title-box .page-subtitle {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--ap-gray-500);
}
.page-title-box .page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---- Cards ---- */
.card {
  border-radius: var(--ap-radius-lg);
  border: 1px solid var(--ap-gray-200);
  box-shadow: var(--ap-shadow-xs);
}

/* ---- Stat (KPI) cards ---- */
.stat-card {
  height: 100%;
  margin-bottom: 0;
}
.stat-card .card-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
}
.stat-card .stat-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: var(--ap-brand-50);
  color: var(--ap-brand-600);
}
.stat-card .stat-icon.is-success { background: var(--ap-success-50); color: var(--ap-success-700); }
.stat-card .stat-icon.is-warning { background: var(--ap-warning-50); color: var(--ap-warning-700); }
.stat-card .stat-icon.is-info    { background: var(--ap-info-50);    color: var(--ap-info-700); }
.stat-card .stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ap-gray-500);
  margin-bottom: 4px;
}
.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ap-gray-900);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ---- Buttons ---- */
.btn {
  border-radius: var(--ap-radius-md);
  font-weight: 600;
}
.btn-primary:focus-visible { box-shadow: var(--ap-focus-ring); }
.btn-outline-danger {
  --tb-btn-color: var(--ap-danger-700);
  --tb-btn-border-color: var(--ap-danger-200);
  --tb-btn-bg: #fff;
  --tb-btn-hover-color: #fff;
  --tb-btn-hover-bg: var(--ap-danger-600);
  --tb-btn-hover-border-color: var(--ap-danger-600);
  --tb-btn-active-bg: var(--ap-danger-700);
  --tb-btn-active-border-color: var(--ap-danger-700);
}
.btn-outline-secondary {
  --tb-btn-color: var(--ap-gray-700);
  --tb-btn-border-color: var(--ap-gray-300);
  --tb-btn-bg: #fff;
  --tb-btn-hover-color: var(--ap-gray-900);
  --tb-btn-hover-bg: var(--ap-gray-50);
  --tb-btn-hover-border-color: var(--ap-gray-300);
}

/* ---- Form controls ---- */
.form-control,
.form-select {
  border-color: var(--ap-gray-300);
  border-radius: var(--ap-radius-md);
  color: var(--ap-gray-900);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--ap-brand-500);
  box-shadow: var(--ap-focus-ring);
}
.form-control::placeholder { color: var(--ap-gray-400); }
.form-label {
  color: var(--ap-gray-700);
  font-weight: 600;
}
.table-search-box:focus-within {
  border-color: var(--ap-brand-500);
  box-shadow: var(--ap-focus-ring);
}
.stock-filter select:focus,
.table-toolbar select:focus {
  outline: none;
  border-color: var(--ap-brand-500);
  box-shadow: var(--ap-focus-ring);
}

/* ---- Tables ---- */
.table > :not(caption) > * > * {
  border-bottom-color: var(--ap-gray-200);
}
.table-toolbar {
  border-bottom-color: var(--ap-gray-200);
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  font-weight: 600;
}
td.dataTables_empty {
  padding: 40px 16px !important;
  color: var(--ap-gray-500);
}

/* ---- Data table theme (.ap-table) ----
   One look for every list table: Hospital, Patient, Stock, Sales.
   Solid brand header, bordered grid, centred cells, zebra + hover rows,
   uniform row buttons. DataTables forces border-collapse: separate, so the
   frame is drawn as top/left on the table and right/bottom on cells. */
table.ap-table {
  border-collapse: separate !important;
  border-spacing: 0;
  border-top: 1px solid var(--ap-gray-200);
  border-left: 1px solid var(--ap-gray-200);
  font-variant-numeric: tabular-nums;
  margin-top: 0 !important;
}
table.ap-table > thead > tr > th,
table.ap-table > tbody > tr > td {
  border-right: 1px solid var(--ap-gray-200);
  border-bottom: 1px solid var(--ap-gray-200) !important;
  text-align: center !important;
  vertical-align: middle;
}
table.ap-table > thead {
  text-transform: uppercase;
}
table.ap-table > thead > tr > th {
  position: relative;
  background: var(--ap-brand-500);
  color: #fff;
  border-color: #17a09e;
  border-bottom-color: #17a09e !important;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
  padding: 12px 28px;   /* equal sides keep labels centred; room for sort arrows */
}
table.ap-table > thead > tr > th.sorting_disabled {
  padding-left: 12px;
  padding-right: 12px;
}
table.ap-table > thead > tr > th:before,
table.ap-table > thead > tr > th:after {
  color: #fff;
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%);
  font-size: 0.7rem;
}
table.ap-table > thead > tr > th.sorting_asc,
table.ap-table > thead > tr > th.sorting_desc {
  background: #17a09e;
}
table.ap-table > tbody > tr > td {
  padding: 10px 12px;
  font-size: 0.8125rem;
  color: var(--ap-gray-800);
  background: #fff;
}
table.ap-table > tbody > tr:nth-child(even) > td { background: #fbfcfd; }
table.ap-table > tbody > tr:hover > td { background: var(--ap-brand-50); }
table.ap-table td.dataTables_empty { color: var(--ap-gray-500); }
table.ap-table td a { font-weight: 600; }

/* Compact density for wide tables (Sales) */
table.ap-table.is-compact > thead > tr > th { padding: 10px 24px; font-size: 0.68rem; }
table.ap-table.is-compact > thead > tr > th.sorting_disabled { padding-left: 10px; padding-right: 10px; }
table.ap-table.is-compact > tbody > tr > td { padding: 8px 10px; font-size: 0.75rem; white-space: nowrap; }

/* Row buttons: one size everywhere (inline padding from server-built
   buttons is overridden). */
table.ap-table > tbody .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-width: 78px;
  padding: 0 10px !important;
  font-size: 0.75rem !important;
  font-weight: 600;
  border-radius: var(--ap-radius-md);
  box-shadow: none;
  white-space: nowrap;
}
table.ap-table > tbody .btn i { font-size: 0.9rem; }

/* Icon-only row actions (label in a tooltip) */
table.ap-table > tbody .btn.btn-icon-action {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0 !important;
}
table.ap-table > tbody .btn.btn-icon-action i { font-size: 1rem; margin: 0; }

/* Mild tones: soft tint + coloured icon, a shade stronger on hover */
.btn-icon-action { border: 1px solid transparent; transition: background-color .15s, border-color .15s, color .15s; }
.btn-icon-action.tone-primary   { background: #eaf5f7; color: #0f7489; border-color: #d3e9ee; }
.btn-icon-action.tone-success   { background: #ebf7f1; color: #1f8a5b; border-color: #d2ecdf; }
.btn-icon-action.tone-danger    { background: #fdf0f0; color: #c94a4a; border-color: #f6dada; }
.btn-icon-action.tone-secondary { background: #f2f4f7; color: #5b6676; border-color: #e1e5eb; }
.btn-icon-action.tone-primary:hover   { background: #d7edf1; color: #0b5f71; border-color: #b9dce4; }
.btn-icon-action.tone-success:hover   { background: #d8f0e4; color: #17724a; border-color: #b6e0cb; }
.btn-icon-action.tone-danger:hover    { background: #fbe1e1; color: #b23b3b; border-color: #f0c2c2; }
.btn-icon-action.tone-secondary:hover { background: #e6e9ee; color: #3f4957; border-color: #d1d6de; }

/* Fixed-width, left-filled action group centred in the cell, so the same
   action lines up in the same place on every row. Fits --slots buttons
   (default 3). */
.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  width: calc(var(--slots, 3) * 32px + (var(--slots, 3) - 1) * 8px);
  margin: 0 auto;
}

/* ---- Status pills (shared) ---- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-pill.is-open      { background: var(--ap-info-50);    color: var(--ap-info-700);    border-color: var(--ap-info-200); }
.status-pill.is-requested { background: var(--ap-purple-50);  color: var(--ap-purple-700);  border-color: var(--ap-purple-200); }
.status-pill.is-approved  { background: var(--ap-warning-50); color: var(--ap-warning-700); border-color: var(--ap-warning-200); }
.status-pill.is-confirmed { background: var(--ap-success-50); color: var(--ap-success-700); border-color: var(--ap-success-200); }
.status-pill.is-booked    { background: #eef2fd;              color: #3b5bcc;               border-color: #d4ddf8; }
.status-pill.is-completed { background: #e7f6ef;              color: #0e7a4f;               border-color: #b5e4cd; }
.status-pill.is-waiting   { background: #fff4e5;              color: #b54708;               border-color: #fedf89; }
.status-pill.is-closed    { background: var(--ap-gray-100);   color: var(--ap-gray-700);    border-color: var(--ap-gray-200); }
.status-pill.is-danger    { background: var(--ap-danger-50);  color: var(--ap-danger-700);  border-color: var(--ap-danger-200); }

/* ---- Record header (Patient / Surgery details) ---- */
.record-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--ap-brand-100);
  border-radius: var(--ap-radius-lg);
  background:
    radial-gradient(80% 140% at 100% 0%, rgba(27, 177, 175, 0.10) 0%, rgba(27, 177, 175, 0) 60%),
    linear-gradient(135deg, #e9f7f8 0%, #f6fbfc 55%, #ffffff 100%);
}
.record-header .record-avatar {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2fd0c9 0%, var(--ap-brand-500) 50%, var(--ap-brand-700) 100%);
  box-shadow: 0 6px 16px rgba(1, 100, 129, 0.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
}
.record-header .record-main { flex: 1; min-width: 200px; }
.record-header .record-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 1.2rem;
  font-weight: 700;
  color: #0b3d4a;
  margin: 0;
}
.record-header .record-title label { margin: 0 !important; font-size: inherit; font-weight: inherit; color: inherit; }
.record-header .record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--ap-gray-600);
}
.record-header .record-meta span { display: inline-flex; align-items: center; gap: 5px; }
.record-header .record-meta i { color: var(--ap-brand-500); }
.record-header .record-meta b { color: #0b3d4a; font-weight: 600; }
.record-header .record-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}
.record-header .record-actions .btn-primary {
  background: linear-gradient(135deg, var(--ap-brand-500) 0%, #128f8d 100%);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(27, 177, 175, 0.35);
  padding-left: 22px;
  padding-right: 22px;
}
.record-header .record-actions .btn-primary:hover {
  background: linear-gradient(135deg, #18a19f 0%, #0f7d7b 100%);
}

/* Main form card: thin brand accent along the top */
.card-body.form-steps { position: relative; }
.card-body.form-steps::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--ap-radius-lg) var(--ap-radius-lg) 0 0;
  background: linear-gradient(90deg, var(--ap-brand-500) 0%, var(--ap-brand-700) 100%);
}
/* Tab body sits on a faint brand-tinted panel so white fields stand out */
.form-steps > .tab-content {
  padding: 22px 20px 12px;
  border: 1px solid var(--ap-gray-200);
  border-radius: var(--ap-radius-lg);
  background: linear-gradient(180deg, #f5fafb 0%, #ffffff 160px);
}
.form-steps .form-label { color: #0b3d4a; }
.form-steps .form-control,
.form-steps .form-select { background-color: #fff; }

/* ---- Step tabs (Patient / Surgery details) ---- */
.step-arrow-nav .nav-pills.custom-nav {
  background: var(--ap-brand-50);
  border: 1px solid var(--ap-brand-100);
  border-radius: var(--ap-radius-lg);
  padding: 5px;
  gap: 5px;
}
.step-arrow-nav .nav-pills.custom-nav .nav-link {
  border-radius: var(--ap-radius-md) !important;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ap-brand-600);
  background: transparent;
  padding: 10px 12px;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.step-arrow-nav .nav-pills.custom-nav .nav-link::before,
.step-arrow-nav .nav-pills.custom-nav .nav-link::after { display: none; }
.step-arrow-nav .nav-pills.custom-nav .nav-link:hover {
  color: var(--ap-brand-700);
  background: rgba(255, 255, 255, 0.85);
}
.step-arrow-nav .nav-pills.custom-nav .nav-link.active {
  background: linear-gradient(135deg, var(--ap-brand-500) 0%, var(--ap-brand-700) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(1, 100, 129, 0.25);
}

/* ---- Toast notifications (assets/js/ui.js: notify()) ---- */
.ap-toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 40px));
  pointer-events: none;
}
.ap-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--ap-gray-200);
  border-left: 4px solid var(--ap-brand-500);
  border-radius: var(--ap-radius-md);
  box-shadow: var(--ap-shadow-lg);
  font-size: 0.875rem;
  color: var(--ap-gray-800);
  animation: ap-toast-in 0.18s ease-out;
}
.ap-toast i { font-size: 1.15rem; line-height: 1.25rem; color: var(--ap-brand-500); }
.ap-toast .ap-toast-body { flex: 1; min-width: 0; word-break: break-word; }
.ap-toast .ap-toast-close {
  border: 0;
  background: transparent;
  color: var(--ap-gray-400);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.ap-toast .ap-toast-close:hover { color: var(--ap-gray-700); }
.ap-toast.is-success { border-left-color: var(--ap-success-500); }
.ap-toast.is-success i { color: var(--ap-success-500); }
.ap-toast.is-warning { border-left-color: var(--ap-warning-500); }
.ap-toast.is-warning i { color: var(--ap-warning-500); }
.ap-toast.is-error   { border-left-color: var(--ap-danger-600); }
.ap-toast.is-error i { color: var(--ap-danger-600); }
.ap-toast.is-leaving { opacity: 0; transform: translateX(12px); transition: opacity 0.2s, transform 0.2s; }
@keyframes ap-toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---- SweetAlert dialogs: typography & shape only (button colours are
       left to each dialog, so destructive confirms keep their colour) ---- */
.swal2-popup {
  font-family: var(--ap-font) !important;
  border-radius: var(--ap-radius-lg) !important;
  padding: 1.5rem 1.5rem 1.25rem !important;
}
.swal2-title {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: var(--ap-gray-900) !important;
}
.swal2-html-container {
  font-size: 0.9rem !important;
  color: var(--ap-gray-600) !important;
}
.swal2-actions .swal2-styled {
  border-radius: var(--ap-radius-md) !important;
  font-weight: 600 !important;
  font-size: 0.875rem !important;
  padding: 0.55rem 1.1rem !important;
}
.swal2-input,
.swal2-popup .form-control {
  border-radius: var(--ap-radius-md) !important;
  font-size: 0.9rem !important;
}

/* ---- Footer ---- */
.footer {
  color: var(--ap-gray-500);
  font-size: 0.78rem;
  border-top: 1px solid var(--ap-gray-200);
  background: #fff;
}
.footer .footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}