.buttons-copy {
    margin-top: 0;
}

/* --------------------------------------------------------------------------
   Responsive buttons (global)
   -------------------------------------------------------------------------- */

/* Table action cells: keep buttons tidy; allow wrap on very small screens */
.table tbody td:has(.btn) {
    vertical-align: middle;
}

.table td form,
.table td form[style*="inline"] {
    display: inline-flex !important;
    margin: 0;
}

.table .btn-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    vertical-align: middle;
}

.table .btn-group > .btn {
    border-radius: var(--bs-border-radius, 0.25rem) !important;
}

/* Page header / toolbar button rows */
.row [class*="col-"].text-end,
.row [class*="col-"].text-sm-end {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
}

.mb-3:has(> .btn),
.mb-4:has(> .btn),
.mb-3:has(> a > .btn),
.mb-4:has(> a > .btn) {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.card-header .d-flex,
.d-flex.gap-2.flex-wrap {
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Form footer / action rows */
.row .col-md-12:has(> .btn),
.row .col-12:has(> .btn),
.d-flex.justify-content-end:has(.btn),
.d-flex.justify-content-between:has(.btn) {
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 575.98px) {
    /* Stack card header actions on small screens */
    .card-header .d-flex.justify-content-between {
        flex-direction: column;
        align-items: stretch !important;
    }

    .card-header .d-flex.justify-content-between .btn,
    .card-header .d-flex .btn {
        width: 100%;
        justify-content: center;
    }

    /* Full-width toolbar buttons on mobile */
    .row [class*="col-"].text-end .btn,
    .row [class*="col-"].text-sm-end .btn,
    .mb-3 > .btn,
    .mb-3 > a > .btn,
    .mb-4 > .btn,
    .mb-4 > a > .btn {
        flex: 1 1 100%;
        justify-content: center;
        white-space: normal;
        text-align: center;
    }

    /* Keep compact action buttons inside tables */
    .table td .btn-sm,
    .table td .btn-group .btn {
        flex: 0 0 auto;
        width: auto;
    }

    .table .btn-group {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .btn:not(.btn-sm):not(.btn-link) {
        white-space: normal;
    }
}

/* --------------------------------------------------------------------------
   Modern forms (global)
   -------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    body.nephroconnect-theme .card-body form .row:has([type="submit"]) .btn,
    body.nephroconnect-theme .card-body form .row:has(.btn-primary) .btn,
    body.nephroconnect-theme .nc-form-actions .btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    body.nephroconnect-theme .card-body form .row:has([type="submit"]),
    body.nephroconnect-theme .nc-form-actions {
        flex-direction: column;
    }
}

body.nephroconnect-theme .card-body > form,
body.nephroconnect-theme form.nc-form {
    max-width: 100%;
}

body.nephroconnect-theme .card .card-header + .card-body > form > .alert:first-child,
body.nephroconnect-theme form.nc-form > .alert:first-child {
    margin-bottom: 1.25rem;
}

/* --------------------------------------------------------------------------
   Admin dashboard
   -------------------------------------------------------------------------- */
.admin-dash-hero {
    background: linear-gradient(120deg, #0a2540 0%, #0d3d56 38%, #0f766e 72%, #00b4a8 100%);
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(10, 37, 64, 0.28);
}

.admin-dash-hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(8px);
    pointer-events: none;
    opacity: 0.55;
}

.admin-dash-hero-blob--1 {
    width: 280px;
    height: 280px;
    top: -120px;
    right: -60px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.28), transparent 70%);
}

.admin-dash-hero-blob--2 {
    width: 220px;
    height: 220px;
    bottom: -130px;
    left: 20%;
    background: radial-gradient(circle, rgba(0, 180, 168, 0.45), transparent 70%);
}

.admin-dash-eyebrow {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-dash-clock-wrap {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    padding: 0.5rem 1.25rem;
    backdrop-filter: blur(6px);
}

.admin-dash-clock {
    font-size: 1.75rem;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.admin-dash-hero-chip {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    color: #fff;
    backdrop-filter: blur(6px);
    transition: transform 0.2s ease, background 0.2s ease;
}

.admin-dash-hero-chip:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.22);
}

.admin-dash-hero-chip i {
    font-size: 1.35rem;
    display: block;
    margin-bottom: 0.15rem;
    opacity: 0.9;
}

.admin-dash-hero-chip span {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.1;
}

.admin-dash-hero-chip small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-dash-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
}

/* --------------------------------------------------------------------------
   Center metrics (redesigned stat cards)
   -------------------------------------------------------------------------- */
.admin-dash-metrics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.25rem 0 0.5rem;
}

.admin-dash-metrics-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.admin-dash-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.admin-dash-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    animation: adminDashLivePulse 2s ease infinite;
}

@keyframes adminDashLivePulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.admin-dash-metric {
    --metric-accent: #3b82f6;
    --metric-accent-soft: rgba(59, 130, 246, 0.12);
    --metric-accent-glow: rgba(59, 130, 246, 0.18);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1.15rem 1.1rem;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e8edf3;
    color: inherit;
    text-decoration: none;
    height: 100%;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.admin-dash-metric::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--metric-accent), transparent);
    opacity: 0.9;
}

.admin-dash-metric::after {
    content: "";
    position: absolute;
    right: -28px;
    top: -28px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--metric-accent-soft);
    z-index: 0;
    transition: transform 0.3s ease;
}

.admin-dash-metric:hover {
    transform: translateY(-4px);
    border-color: var(--metric-accent-glow);
    box-shadow: 0 14px 32px var(--metric-accent-glow);
    color: inherit;
}

.admin-dash-metric:hover::after {
    transform: scale(1.12);
}

.admin-dash-metric:hover .admin-dash-metric__arrow {
    opacity: 1;
    transform: translateX(0);
}

.admin-dash-metric__icon {
    position: relative;
    z-index: 1;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    flex-shrink: 0;
    color: var(--metric-accent);
    background: var(--metric-accent-soft);
    border: 1px solid var(--metric-accent-glow);
}

.admin-dash-metric__body {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.admin-dash-metric__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.admin-dash-metric__value {
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.admin-dash-metric__value small {
    font-size: 0.95rem;
    font-weight: 600;
    color: #94a3b8;
    margin-left: 0.1rem;
}

.admin-dash-metric__value--currency {
    font-size: 1.25rem;
}

.admin-dash-metric__hint {
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.35;
}

.admin-dash-metric__hint strong {
    color: #475569;
    font-weight: 600;
}

.admin-dash-metric__progress {
    height: 5px;
    border-radius: 999px;
    background: #e8edf3;
    overflow: hidden;
    margin: 0.2rem 0 0.1rem;
}

.admin-dash-metric__progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--metric-accent), #00b4a8);
    transition: width 0.6s ease;
}

.admin-dash-metric__trend {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    margin-left: 0.35rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
}

.admin-dash-metric__trend.is-up {
    color: #059669;
    background: rgba(16, 185, 129, 0.12);
}

.admin-dash-metric__trend.is-down {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.12);
}

.admin-dash-metric__arrow {
    position: relative;
    z-index: 1;
    align-self: center;
    font-size: 1.25rem;
    color: #cbd5e1;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.admin-dash-metric:hover .admin-dash-metric__arrow {
    color: var(--metric-accent);
}

.admin-dash-metric--alert {
    animation: adminDashMetricAlert 2.5s ease infinite;
}

@keyframes adminDashMetricAlert {
    0%, 100% { border-color: #e8edf3; }
    50% { border-color: rgba(239, 68, 68, 0.45); }
}

.admin-dash-metric--primary {
    --metric-accent: #3b82f6;
    --metric-accent-soft: rgba(59, 130, 246, 0.12);
    --metric-accent-glow: rgba(59, 130, 246, 0.2);
}

.admin-dash-metric--success {
    --metric-accent: #22c55e;
    --metric-accent-soft: rgba(34, 197, 94, 0.12);
    --metric-accent-glow: rgba(34, 197, 94, 0.2);
}

.admin-dash-metric--info {
    --metric-accent: #06b6d4;
    --metric-accent-soft: rgba(6, 182, 212, 0.12);
    --metric-accent-glow: rgba(6, 182, 212, 0.2);
}

.admin-dash-metric--warning {
    --metric-accent: #f59e0b;
    --metric-accent-soft: rgba(245, 158, 11, 0.14);
    --metric-accent-glow: rgba(245, 158, 11, 0.22);
}

.admin-dash-metric--purple {
    --metric-accent: #8b5cf6;
    --metric-accent-soft: rgba(139, 92, 246, 0.12);
    --metric-accent-glow: rgba(139, 92, 246, 0.2);
}

.admin-dash-metric--teal {
    --metric-accent: #14b8a6;
    --metric-accent-soft: rgba(20, 184, 166, 0.12);
    --metric-accent-glow: rgba(20, 184, 166, 0.2);
}

.admin-dash-metric--danger {
    --metric-accent: #ef4444;
    --metric-accent-soft: rgba(239, 68, 68, 0.12);
    --metric-accent-glow: rgba(239, 68, 68, 0.2);
}

.admin-dash-metric--revenue {
    --metric-accent: #0f766e;
    --metric-accent-soft: rgba(15, 118, 110, 0.12);
    --metric-accent-glow: rgba(15, 118, 110, 0.22);
    background: linear-gradient(145deg, #ffffff 0%, #f0fdfa 55%, #ecfeff 100%);
}

.admin-dash-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    height: 100%;
    transition: all 0.2s ease;
}

.admin-dash-action i {
    font-size: 1.5rem;
    color: #00b4a8;
}

.admin-dash-action:hover {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.3);
}

.admin-dash-action:hover i {
    color: #fff;
}

.admin-dash-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.65rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.admin-dash-alert i {
    font-size: 1.35rem;
    margin-top: 0.1rem;
}

.admin-dash-alert strong {
    display: block;
    font-size: 0.9rem;
}

.admin-dash-alert small {
    color: #64748b;
}

.admin-dash-alert--warning { background: #fffbeb; border: 1px solid #fde68a; }
.admin-dash-alert--warning i { color: #d97706; }
.admin-dash-alert--danger { background: #fef2f2; border: 1px solid #fecaca; }
.admin-dash-alert--danger i { color: #dc2626; }
.admin-dash-alert--success { background: #f0fdf4; border: 1px solid #bbf7d0; }
.admin-dash-alert--success i { color: #16a34a; }
.admin-dash-alert--muted { background: #f8fafc; border: 1px solid #e2e8f0; }
.admin-dash-alert--muted i { color: #64748b; }

.admin-dash-stock-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px dashed #e2e8f0;
    font-size: 0.85rem;
}

.admin-dash-stock-list li:last-child {
    border-bottom: none;
}

.admin-dash-schedule-card {
    overflow: hidden;
}

.admin-dash-schedule-header {
    background: linear-gradient(135deg, #0a2540 0%, #0f766e 100%);
    border: none;
    color: #fff;
    padding: 1.25rem 1.5rem;
}

.admin-dash-schedule-header h4 {
    color: #fff;
}

.admin-dash-date-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    height: 68px;
    padding: 0.5rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    transition: all 0.2s ease;
}

.admin-dash-date-btn span {
    font-size: 0.75rem;
}

.admin-dash-date-btn strong {
    font-size: 0.8rem;
    color: #1e293b;
}

.admin-dash-date-btn:hover,
.admin-dash-date-btn.active {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
}

.admin-dash-date-btn:hover strong,
.admin-dash-date-btn.active strong {
    color: #fff;
}

.admin-dash-table thead {
    background: #f8fafc;
}

.admin-dash-table thead th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.admin-dash-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0a2540, #00b4a8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.admin-dash-avatar--lg {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
}

.admin-dash-patient-card {
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    height: 100%;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.admin-dash-patient-card:hover {
    border-color: #c7d2fe;
    box-shadow: 0 4px 16px rgba(79, 110, 247, 0.1);
}

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

.admin-dash-schedule-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border-radius: 8px;
}

.admin-dash-date-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

/* Panel polish for the bento dashboard */
.admin-dash .nc-panel {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-dash .nc-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
}

.admin-dash .nc-panel-title,
.admin-dash .card-title {
    position: relative;
    display: flex;
    align-items: center;
}

/* Accent bar before section titles inside cards */
.admin-dash .card-title:not(.mb-0)::before {
    content: "";
    width: 4px;
    height: 1.05em;
    border-radius: 4px;
    margin-right: 0.6rem;
    background: linear-gradient(180deg, #00b4a8, #0f766e);
}

.admin-dash .admin-dash-action {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.admin-dash .mini-stats-wid {
    border-radius: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-dash .mini-stats-wid:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

/* Staggered entrance animation for dashboard tiles */
@keyframes adminDashFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-dash-hero,
.admin-dash .bento-grid > * {
    animation: adminDashFadeUp 0.5s ease both;
}

.admin-dash .bento-grid > *:nth-child(1) { animation-delay: 0.02s; }
.admin-dash .bento-grid > *:nth-child(2) { animation-delay: 0.06s; }
.admin-dash .bento-grid > *:nth-child(3) { animation-delay: 0.1s; }
.admin-dash .bento-grid > *:nth-child(4) { animation-delay: 0.14s; }
.admin-dash .bento-grid > *:nth-child(5) { animation-delay: 0.18s; }
.admin-dash .bento-grid > *:nth-child(6) { animation-delay: 0.22s; }
.admin-dash .bento-grid > *:nth-child(7) { animation-delay: 0.26s; }
.admin-dash .bento-grid > *:nth-child(8) { animation-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
    .admin-dash-hero,
    .admin-dash .bento-grid > * {
        animation: none;
    }

    .admin-dash-live-dot,
    .admin-dash-metric--alert {
        animation: none;
    }
}

/* --------------------------------------------------------------------------
   Bento grid layout (admin dashboard)
   -------------------------------------------------------------------------- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(10px, auto);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

/* Each direct child is a bento tile: equal stretch, no stray margins */
.bento-grid > * {
    margin: 0 !important;
    min-width: 0;
}

/* Base: single column on mobile */
.bento-grid > [class*="bento-col-"],
.bento-grid > .bento-third {
    grid-column: span 12;
}

/* Tile surface (applied to wrappers that aren't already cards/panels) */
.bento-tile {
    background: #ffffff;
    border: 1px solid #e8edf3;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

/* Unify radius of existing cards/panels when used as bento tiles */
.bento-grid > .card,
.bento-grid > .nc-panel,
.bento-grid > .admin-dash-metric {
    border-radius: 16px !important;
}

.bento-grid > .card {
    height: 100%;
}

.bento-grid > .nc-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Small screens: stats two-up */
@media (min-width: 576px) {
    .bento-grid > .bento-col-3,
    .bento-grid > .bento-col-2 {
        grid-column: span 6;
    }
}

/* Tablets */
@media (min-width: 768px) {
    .bento-grid > .bento-third {
        grid-column: span 6;
    }
}

/* Laptops */
@media (min-width: 992px) {
    .bento-grid > .bento-col-3 {
        grid-column: span 3;
    }
    .bento-grid > .bento-col-2 {
        grid-column: span 4;
    }
    .bento-grid > .bento-col-4 {
        grid-column: span 12;
    }
    .bento-grid > .bento-col-6 {
        grid-column: span 6;
    }
    .bento-grid > .bento-col-8 {
        grid-column: span 12;
    }
    .bento-grid > .bento-third {
        grid-column: span 4;
    }
}

/* Desktops / wide */
@media (min-width: 1200px) {
    .bento-grid > .bento-col-2 {
        grid-column: span 2;
    }
    .bento-grid > .bento-col-3 {
        grid-column: span 3;
    }
    .bento-grid > .bento-col-4 {
        grid-column: span 4;
    }
    .bento-grid > .bento-col-6 {
        grid-column: span 6;
    }
    .bento-grid > .bento-col-8 {
        grid-column: span 8;
    }
    .bento-grid > .bento-third {
        grid-column: span 4;
    }
}

/* Metric tiles fill their bento cell */
.bento-grid > .admin-dash-metric {
    height: 100%;
}

/* Quick actions tile body fills nicely */
.bento-grid > .card > .card-body {
    width: 100%;
}

/* --------------------------------------------------------------------------
   Dark mode overrides for admin dashboard components
   -------------------------------------------------------------------------- */
html[data-bs-theme="dark"] .bento-tile {
    background: #131c2e;
    border-color: #25324a;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
}

html[data-bs-theme="dark"] .admin-dash-metrics-title {
    color: #e2e8f0;
}

html[data-bs-theme="dark"] .admin-dash-live-badge {
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
}

html[data-bs-theme="dark"] .admin-dash-metric {
    background: #131c2e;
    border-color: #25324a;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

html[data-bs-theme="dark"] .admin-dash-metric--revenue {
    background: linear-gradient(145deg, #131c2e 0%, #0f1f28 55%, #0e2e2b 100%);
}

html[data-bs-theme="dark"] .admin-dash-metric__label {
    color: #93a4bd;
}

html[data-bs-theme="dark"] .admin-dash-metric__value {
    color: #f1f5f9;
}

html[data-bs-theme="dark"] .admin-dash-metric__value small {
    color: #64748b;
}

html[data-bs-theme="dark"] .admin-dash-metric__hint {
    color: #64748b;
}

html[data-bs-theme="dark"] .admin-dash-metric__hint strong {
    color: #cbd5e1;
}

html[data-bs-theme="dark"] .admin-dash-metric__progress {
    background: #1e293b;
}

html[data-bs-theme="dark"] .admin-dash-metric__arrow {
    color: #475569;
}

html[data-bs-theme="dark"] .admin-dash-action {
    background: linear-gradient(180deg, #16223a, #0f1828);
    border-color: #25324a;
    color: #cbd5e1;
}

html[data-bs-theme="dark"] .admin-dash-action i {
    color: #2dd4bf;
}

html[data-bs-theme="dark"] .admin-dash-action:hover {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

html[data-bs-theme="dark"] .admin-dash-action:hover i {
    color: #fff;
}

html[data-bs-theme="dark"] .admin-dash-date-btn {
    background: #0f1828;
    border-color: #25324a;
    color: #93a4bd;
}

html[data-bs-theme="dark"] .admin-dash-date-btn strong {
    color: #e2e8f0;
}

html[data-bs-theme="dark"] .admin-dash-table thead {
    background: #0f1828;
}

html[data-bs-theme="dark"] .admin-dash-table thead th {
    color: #93a4bd;
    border-bottom-color: #25324a;
}

html[data-bs-theme="dark"] .admin-dash-patient-card {
    background: #131c2e;
    border-color: #25324a;
}

html[data-bs-theme="dark"] .admin-dash-patient-card:hover {
    border-color: #0f766e;
    box-shadow: 0 4px 16px rgba(0, 180, 168, 0.25);
}

html[data-bs-theme="dark"] .admin-dash-stock-list li {
    border-bottom-color: #25324a;
}

html[data-bs-theme="dark"] .admin-dash-schedule-loading {
    background: rgba(11, 18, 32, 0.75);
}

/* Alert tiles: translucent tinted backgrounds on dark */
html[data-bs-theme="dark"] .admin-dash-alert--warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
}
html[data-bs-theme="dark"] .admin-dash-alert--danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}
html[data-bs-theme="dark"] .admin-dash-alert--success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}
html[data-bs-theme="dark"] .admin-dash-alert--muted {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.25);
}

html[data-bs-theme="dark"] .admin-dash-alert strong {
    color: #e2e8f0;
}

html[data-bs-theme="dark"] .admin-dash-alert small {
    color: #93a4bd;
}

/* --------------------------------------------------------------------------
   HD Session Quick Access
   -------------------------------------------------------------------------- */
.hd-quick {
    --hd-surface: #ffffff;
    --hd-border: #e8edf3;
    --hd-muted: #64748b;
    --hd-ink: #0f172a;
    background:
        radial-gradient(circle at top right, rgba(20, 184, 166, 0.08), transparent 42%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--hd-border);
    border-radius: 18px;
    padding: 1.15rem 1.25rem 1.25rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.hd-quick__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.hd-quick__title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--hd-ink);
}

.hd-quick__title i {
    color: #0d9488;
    font-size: 1.2rem;
}

.hd-quick__subtitle {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--hd-muted);
}

.hd-quick__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0f766e;
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(20, 184, 166, 0.22);
    white-space: nowrap;
}

.hd-quick__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.hd-quick__grid:has(> :nth-child(5)) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hd-quick__tile {
    --tone: #0d9488;
    --tone-soft: rgba(13, 148, 136, 0.12);
    --tone-glow: rgba(13, 148, 136, 0.18);
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 88px;
    padding: 0.95rem 0.95rem 0.95rem 0.85rem;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid var(--hd-border);
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.hd-quick__tile::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--tone);
}

.hd-quick__tile::after {
    content: "";
    position: absolute;
    right: -24px;
    top: -28px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--tone-soft);
    z-index: 0;
    transition: transform 0.25s ease;
}

.hd-quick__tile:hover {
    transform: translateY(-3px);
    border-color: var(--tone-glow);
    box-shadow: 0 14px 28px var(--tone-glow);
    color: inherit;
}

.hd-quick__tile:hover::after {
    transform: scale(1.15);
}

.hd-quick__tile:hover .hd-quick__arrow {
    opacity: 1;
    transform: translateX(0);
}

.hd-quick__tile.is-active {
    background: var(--tone);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 28px var(--tone-glow);
}

.hd-quick__tile.is-active::before,
.hd-quick__tile.is-active::after {
    display: none;
}

.hd-quick__tile.is-active .hd-quick__step,
.hd-quick__tile.is-active .hd-quick__hint,
.hd-quick__tile.is-active .hd-quick__arrow {
    color: rgba(255, 255, 255, 0.82);
}

.hd-quick__tile.is-active .hd-quick__icon {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.hd-quick__step {
    position: relative;
    z-index: 1;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #94a3b8;
    align-self: flex-start;
    margin-top: 0.15rem;
}

.hd-quick__icon {
    position: relative;
    z-index: 1;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    color: var(--tone);
    background: var(--tone-soft);
    border: 1px solid var(--tone-glow);
}

.hd-quick__copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
    flex: 1;
}

.hd-quick__label {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    color: inherit;
}

.hd-quick__hint {
    font-size: 0.72rem;
    color: var(--hd-muted);
    line-height: 1.3;
}

.hd-quick__arrow {
    position: relative;
    z-index: 1;
    font-size: 1.15rem;
    color: #cbd5e1;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.hd-quick__tile--teal {
    --tone: #0d9488;
    --tone-soft: rgba(13, 148, 136, 0.12);
    --tone-glow: rgba(13, 148, 136, 0.2);
}

.hd-quick__tile--rose {
    --tone: #e11d48;
    --tone-soft: rgba(225, 29, 72, 0.12);
    --tone-glow: rgba(225, 29, 72, 0.18);
}

.hd-quick__tile--sky {
    --tone: #0284c7;
    --tone-soft: rgba(2, 132, 199, 0.12);
    --tone-glow: rgba(2, 132, 199, 0.18);
}

.hd-quick__tile--amber {
    --tone: #d97706;
    --tone-soft: rgba(217, 119, 6, 0.14);
    --tone-glow: rgba(217, 119, 6, 0.2);
}

.hd-quick__tile--emerald {
    --tone: #059669;
    --tone-soft: rgba(5, 150, 105, 0.12);
    --tone-glow: rgba(5, 150, 105, 0.18);
}

.hd-quick__tile--indigo {
    --tone: #4f46e5;
    --tone-soft: rgba(79, 70, 229, 0.12);
    --tone-glow: rgba(79, 70, 229, 0.18);
}

@media (max-width: 1199.98px) {
    .hd-quick__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .hd-quick {
        padding: 1rem;
    }

    .hd-quick__grid {
        grid-template-columns: 1fr;
    }

    .hd-quick__arrow {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hd-quick__tile,
    .hd-quick__tile::after,
    .hd-quick__arrow {
        transition: none;
    }
}

html[data-bs-theme="dark"] .hd-quick {
    --hd-surface: #131c2e;
    --hd-border: #25324a;
    --hd-muted: #93a4bd;
    --hd-ink: #e2e8f0;
    background:
        radial-gradient(circle at top right, rgba(20, 184, 166, 0.12), transparent 42%),
        linear-gradient(180deg, #131c2e 0%, #0f1828 100%);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

html[data-bs-theme="dark"] .hd-quick__tile {
    background: #16223a;
    border-color: #25324a;
}

html[data-bs-theme="dark"] .hd-quick__hint {
    color: #93a4bd;
}

/* --------------------------------------------------------------------------
   Wellness reminders
   -------------------------------------------------------------------------- */
.nc-wellness-popup {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 11000;
    max-width: 360px;
    width: calc(100vw - 2rem);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.28s ease, transform 0.28s ease;
    pointer-events: none;
}

.nc-wellness-popup.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nc-wellness-popup__inner {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1rem 1rem 0.95rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e8edf3;
    box-shadow: 0 16px 40px rgba(10, 37, 64, 0.16);
}

.nc-wellness-popup__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #0f766e;
    background: rgba(0, 180, 168, 0.12);
}

.nc-wellness-popup__eyebrow {
    margin: 0 0 0.15rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0f766e;
}

.nc-wellness-popup__title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.nc-wellness-popup__message {
    margin: 0;
    font-size: 0.86rem;
    color: #64748b;
    line-height: 1.4;
}

.nc-wellness-popup__close {
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 1.35rem;
    line-height: 1;
    padding: 0 0.15rem;
    cursor: pointer;
    flex-shrink: 0;
}

.nc-wellness-popup__close:hover {
    color: #0f172a;
}

html[data-bs-theme="dark"] .nc-wellness-popup__inner {
    background: #131c2e;
    border-color: #25324a;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

html[data-bs-theme="dark"] .nc-wellness-popup__title {
    color: #e2e8f0;
}

html[data-bs-theme="dark"] .nc-wellness-popup__message {
    color: #93a4bd;
}

html[data-bs-theme="dark"] .nc-wellness-popup__close:hover {
    color: #fff;
}

/* --------------------------------------------------------------------------
   System-wide mobile / DataTables responsiveness
   -------------------------------------------------------------------------- */

.nc-dt-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nc-dt-wrap .dataTables_wrapper {
    width: 100%;
}

.nc-dt-toolbar .dt-buttons,
.nc-dt-buttons .dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* DataTables export buttons: keep labels visible (avoid secondary + outline clash) */
div.dt-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

div.dt-buttons .btn,
div.dt-buttons .dt-button,
div.dt-buttons .buttons-html5,
div.dt-buttons .buttons-copy,
div.dt-buttons .buttons-excel,
div.dt-buttons .buttons-pdf,
div.dt-buttons .buttons-print,
div.dt-buttons .buttons-csv {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-width: auto;
    min-height: 34px;
    padding: 0.35rem 0.8rem !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    letter-spacing: 0;
    color: #0a2540 !important;
    background: #fff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    box-shadow: none;
    overflow: visible !important;
    text-indent: 0 !important;
    white-space: nowrap;
}

div.dt-buttons .btn span,
div.dt-buttons .dt-button span {
    display: inline !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    font-size: inherit !important;
    color: inherit !important;
    opacity: 1 !important;
    overflow: visible !important;
}

div.dt-buttons .btn:hover,
div.dt-buttons .dt-button:hover {
    color: #fff !important;
    background: #00b4a8 !important;
    border-color: #00b4a8 !important;
}

.nc-dt-filter .dataTables_filter {
    float: none !important;
    text-align: left !important;
    width: 100%;
}

.nc-dt-filter .dataTables_filter label {
    display: flex;
    width: 100%;
    margin: 0;
}

.nc-dt-filter .dataTables_filter input {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100%;
}

.nc-dt-footer .dataTables_info {
    padding-top: 0.5rem !important;
}

.nc-dt-footer .dataTables_paginate {
    float: none !important;
    text-align: left !important;
    padding-top: 0.25rem !important;
}

.nc-dt-footer .dataTables_paginate .pagination {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.15rem;
}

@media (min-width: 768px) {
    .nc-dt-filter .dataTables_filter {
        text-align: right !important;
    }

    .nc-dt-footer .dataTables_paginate {
        text-align: right !important;
    }

    .nc-dt-footer .dataTables_paginate .pagination {
        justify-content: flex-end;
    }
}

/* Generic DataTables: stack controls on small screens */
@media (max-width: 767.98px) {
    div.dataTables_wrapper div.dataTables_length,
    div.dataTables_wrapper div.dataTables_filter,
    div.dataTables_wrapper div.dataTables_info,
    div.dataTables_wrapper div.dataTables_paginate {
        float: none !important;
        text-align: left !important;
        width: 100%;
        margin-bottom: 0.65rem;
    }

    div.dataTables_wrapper div.dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        display: block;
    }

    div.dataTables_wrapper div.dataTables_length select {
        display: inline-block;
        width: auto;
    }

    div.dataTables_wrapper .dt-buttons {
        float: none !important;
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        margin-bottom: 0.75rem;
    }

    div.dataTables_wrapper .dt-buttons .btn,
    div.dataTables_wrapper .dt-buttons .dt-button {
        margin: 0 !important;
    }

    .table.nowrap,
    table.nowrap,
    table.dt-responsive.nowrap {
        white-space: nowrap;
    }

    .card-body {
        padding: 1rem !important;
    }

    .page-content .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .nc-page-header {
        margin-bottom: 1rem;
    }

    .nc-page-header h2 {
        font-size: 1.35rem;
    }

    /* Forms: full-width actions */
    .d-flex.gap-2.flex-wrap .btn,
    .nc-page-header .btn {
        white-space: nowrap;
    }
}

/* Prevent horizontal page blowout from wide tables */
.main-content .page-content {
    overflow-x: hidden;
    overflow-x: clip;
}

.card .table-responsive,
.card .nc-dt-wrap {
    margin-left: 0;
    margin-right: 0;
}

/* Ensure Bootstrap table-responsive always scrolls on touch */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* Schedule status select colors */
.status-select.nc-status-scheduled { border-color: #3b82f6; color: #1d4ed8; }
.status-select.nc-status-congested { border-color: #f59e0b; color: #b45309; background: #fffbeb; }
.status-select.nc-status-completed { border-color: #10b981; color: #047857; }
.status-select.nc-status-cancelled { border-color: #ef4444; color: #b91c1c; }