/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #f4f8fb;
    --bg-sidebar: #ffffff;
    --primary-color: #0f766e;
    --primary-deep: #134e4a;
    --accent-blue: #2563eb;
    --accent-teal: #14b8a6;
    --accent-mint: #ccfbf1;
    --accent-rose: #fb7185;
    --accent-gold: #d6a24a;
    --accent-gold-light: #fff7e6;
    
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --text-soft: #94a3b8;
    
    --border-soft: rgba(226, 232, 240, 0.8);
    --border-radius-lg: 14px;
    --border-radius-md: 12px;
    
    --shadow-premium: 0 12px 35px -18px rgba(15, 23, 42, 0.24), 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-hover: 0 22px 50px -24px rgba(15, 23, 42, 0.32), 0 10px 22px -18px rgba(15, 118, 110, 0.28);
    --glass-bg: rgba(255, 255, 255, 0.82);
    --glass-border: rgba(255, 255, 255, 0.5);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

.pagination-shell {
    justify-content: flex-end;
}

.pagination-number,
.pagination-ellipsis {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    font-size: 0.86rem;
    font-weight: 700;
    height: 34px;
    justify-content: center;
    min-width: 34px;
}

.pagination-number {
    background: #fff;
    border: 1px solid var(--border-soft);
    color: var(--text-dark);
    text-decoration: none;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.pagination-number:hover {
    background: rgba(15, 118, 110, 0.08);
    border-color: rgba(15, 118, 110, 0.25);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.pagination-number.is-active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}

.pagination-ellipsis {
    color: var(--text-muted);
    min-width: 24px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        linear-gradient(135deg, rgba(20, 184, 166, 0.12), transparent 32%),
        linear-gradient(315deg, rgba(37, 99, 235, 0.08), transparent 35%),
        var(--bg-main);
    color: var(--text-dark);
    min-height: 100vh;
    letter-spacing: 0;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(15, 118, 110, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 118, 110, 0.045) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 70%);
    z-index: -1;
}

a {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.main-content {
    animation: page-rise 0.55s var(--ease-out) both;
}

.client-welcome {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(19, 78, 74, 0.94), rgba(15, 118, 110, 0.88) 55%, rgba(37, 99, 235, 0.78)),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-hover);
    color: #ffffff;
    display: flex;
    gap: 2rem;
    justify-content: space-between;
    overflow: hidden;
    padding: 1.4rem;
    position: relative;
}

.client-welcome::after {
    content: '';
    position: absolute;
    inset: auto -10% -55% 42%;
    height: 180px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 66%);
    transform: rotate(-8deg);
}

.client-welcome-content,
.client-welcome-actions {
    position: relative;
    z-index: 1;
}

.client-welcome .eyebrow {
    align-items: center;
    color: rgba(255, 255, 255, 0.76);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 0.4rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
}

.client-welcome h2 {
    font-size: clamp(1.25rem, 2vw, 1.8rem);
    font-weight: 800;
    margin: 0 0 0.35rem;
}

.client-welcome p {
    color: rgba(255, 255, 255, 0.78);
    margin: 0;
    max-width: 680px;
}

.client-welcome-actions {
    align-items: stretch;
    display: flex;
    gap: 0.75rem;
}

.mini-action {
    align-items: center;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 0.35rem;
    justify-content: center;
    min-width: 86px;
    padding: 0.85rem 0.75rem;
    text-decoration: none;
}

.mini-action:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    transform: translateY(-2px);
}

.mini-action i {
    font-size: 1.25rem;
}

.mini-stat {
    align-items: flex-start;
    min-width: 132px;
    text-align: left;
}

.mini-stat strong {
    font-size: 1.2rem;
    line-height: 1.1;
}

.mini-stat span {
    font-size: 0.82rem;
    line-height: 1.2;
}

.mini-stat small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
}

@keyframes page-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth Page Luxury Styling */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 20% 10%, rgba(20, 184, 166, 0.28), transparent 34%),
        radial-gradient(circle at 85% 85%, rgba(37, 99, 235, 0.14), transparent 30%),
        linear-gradient(145deg, #f8fafc 0%, #e7f7f4 100%);
    position: relative;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(197, 168, 128, 0.1) 0%, rgba(255,255,255,0) 70%);
    top: -100px;
    right: -100px;
    animation: float-soft 8s ease-in-out infinite;
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-hover);
    width: 100%;
    max-width: 440px;
    padding: 3rem;
    position: relative;
    z-index: 10;
    animation: card-enter 0.7s var(--ease-out) both;
}

.auth-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-teal), var(--accent-gold));
    border-radius: 0 0 4px 4px;
}

.auth-logo {
    display: inline-block;
    height: 96px !important;
    max-height: 96px;
    max-width: 96px;
    object-fit: contain;
    width: 96px !important;
}

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes float-soft {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(-18px, 16px, 0);
    }
}

/* Sidebar Styling (Luxury Apple/Notion look) */
.sidebar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 253, 252, 0.96)),
        var(--bg-sidebar);
    min-height: 100vh;
    border-right: 1px solid var(--border-soft);
    padding: 2rem 0;
    position: fixed;
    inset: 0 auto 0 0;
    box-shadow: 18px 0 45px -38px rgba(15, 23, 42, 0.45);
}

.sidebar .brand {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    padding: 0 2rem 2rem 2rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: 0;
    border-bottom: 1px solid var(--border-soft);
    position: relative;
}

.sidebar .brand span {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.app-logo {
    display: inline-block;
    flex: 0 0 auto;
    height: 38px !important;
    max-height: 38px;
    max-width: 38px;
    object-fit: contain;
    width: 38px !important;
}

.app-logo-sm {
    height: 34px !important;
    max-height: 34px;
    max-width: 34px;
    width: 34px !important;
}

.sidebar .nav-link {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.85rem 1.5rem;
    margin: 0.35rem 1.5rem;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s var(--ease-out), color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    transition: transform 0.25s ease;
}

.sidebar .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(15, 118, 110, 0.07);
    transform: translateX(4px);
}

.sidebar .nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-teal) 100%);
    box-shadow: 0 10px 20px -10px rgba(15, 118, 110, 0.4);
}

.sidebar .nav-link.active i {
    color: #ffffff;
}

.user-chip {
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--border-soft);
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 28px -22px rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(14px);
}

.mobile-header {
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid var(--border-soft);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-premium);
    padding: 0.9rem 1rem;
    backdrop-filter: blur(14px);
}

/* Premium Layout Panels & Cards */
.card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-soft);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: transform 0.28s var(--ease-out), box-shadow 0.28s ease, border-color 0.28s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(20, 184, 166, 0.28);
    transform: translateY(-2px);
}

.card-header {
    border-bottom-color: var(--border-soft);
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(10px);
}

/* Stat Widget Cards with Gold Accent */
.stat-card {
    border-left: 4px solid var(--accent-teal);
    position: relative;
    overflow: hidden;
    animation: stat-pop 0.5s var(--ease-out) both;
}

.stat-card:hover .stat-icon,
.list-group-item:hover .stat-icon {
    transform: translateY(-2px) rotate(-3deg);
}

.stat-card.revenue-card {
    border-left-color: var(--accent-gold);
}

.stat-card::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(197, 168, 128, 0.03) 0%, rgba(255,255,255,0) 70%);
    bottom: -30px;
    right: -30px;
}

@keyframes stat-pop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: transform 0.28s var(--ease-out);
}

.bg-gold-light {
    background-color: var(--accent-gold-light);
    color: var(--accent-gold);
}

.dashboard-hero {
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(135deg, rgba(19, 78, 74, 0.96), rgba(15, 118, 110, 0.92) 52%, rgba(37, 99, 235, 0.84));
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    box-shadow: var(--shadow-hover);
    color: #ffffff;
    overflow: hidden;
    padding: 1.1rem;
    position: relative;
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    inset: auto -8% -30% auto;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 68%);
    pointer-events: none;
}

.dashboard-hero-top,
.dashboard-meta,
.dashboard-filter-panel {
    position: relative;
    z-index: 1;
}

.dashboard-hero-top {
    align-items: flex-start;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.dashboard-copy {
    max-width: 760px;
}

.dashboard-hero .eyebrow {
    align-items: center;
    color: rgba(255, 255, 255, 0.76);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 0.45rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.dashboard-copy .page-title {
    color: #ffffff;
    margin-bottom: 0.35rem;
}

.dashboard-copy p {
    color: rgba(255, 255, 255, 0.82);
    max-width: 720px;
}

.dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.dashboard-hero-actions .btn {
    border-radius: 12px;
    font-weight: 700;
    min-height: 46px;
    padding-inline: 1rem;
}

.dashboard-filter-panel {
    align-items: end;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    display: grid;
    gap: 0.8rem;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) auto;
    margin-bottom: 0.75rem;
    padding: 0.85rem;
}

.filter-field {
    display: grid;
    gap: 0.4rem;
}

.filter-field label {
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dashboard-filter-panel .form-select,
.dashboard-filter-panel .form-control {
    background-color: rgba(255, 255, 255, 0.96);
    border: none;
    border-radius: 12px;
    box-shadow: none;
    min-height: 48px;
}

.filter-actions {
    display: flex;
    gap: 0.75rem;
}

.filter-actions .btn {
    min-height: 48px;
}

.filter-helper {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    grid-column: 1 / -1;
}

.dashboard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.meta-chip {
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: #ffffff;
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 700;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
}

.section-heading h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 0 0.2rem;
}

.section-heading p {
    color: var(--text-muted);
    margin: 0;
}

.dashboard-kpi {
    border-left-width: 5px;
}

.dashboard-kpi .card-body {
    padding: 1.1rem !important;
}

.kpi-scope {
    background: rgba(15, 118, 110, 0.08);
    border-radius: 999px;
    color: var(--primary-color);
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.35rem 0.6rem;
    text-transform: uppercase;
}

.dashboard-kpi .kpi-label {
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 700;
    margin: 0.55rem 0 0;
    text-transform: uppercase;
}

.dashboard-kpi h3 {
    color: var(--text-dark);
    font-size: clamp(1.35rem, 1.8vw, 1.75rem);
}

.kpi-note {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.insight-card .card-header {
    align-items: start;
    gap: 1rem;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.empty-insight {
    color: var(--text-muted);
    padding: 1rem 0;
    text-align: center;
}

.status-stack,
.dentist-stack,
.trend-stack {
    display: grid;
    gap: 1rem;
}

.status-row,
.dentist-row,
.trend-row {
    display: grid;
    gap: 0.55rem;
}

.status-row-head,
.dentist-row-head,
.trend-row-head,
.dentist-foot {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.status-row-label {
    align-items: center;
    display: flex;
    font-weight: 700;
    gap: 0.6rem;
}

.status-row-value,
.dentist-row-head small,
.trend-row-head small,
.dentist-foot small {
    color: var(--text-muted);
}

.status-row-value {
    align-items: baseline;
    display: flex;
    gap: 0.55rem;
}

.status-dot {
    border-radius: 999px;
    display: inline-block;
    height: 10px;
    width: 10px;
}

.status-track,
.dentist-track,
.trend-track {
    background: rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.status-track span,
.dentist-track span,
.trend-track span {
    border-radius: inherit;
    display: block;
    height: 100%;
}

.dentist-track span {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-teal));
}

.trend-track span {
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-teal));
}

.dentist-row strong,
.trend-row strong {
    display: block;
}

.dentist-row small,
.trend-row small {
    display: block;
    margin-top: 0.15rem;
}

.dentist-total {
    background: rgba(20, 184, 166, 0.1);
    border-radius: 999px;
    color: var(--primary-color);
    font-size: 0.76rem;
    font-weight: 800;
    padding: 0.3rem 0.55rem;
    white-space: nowrap;
}

.dentist-foot strong {
    color: var(--primary-color);
}

.insight-summary {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.insight-pill {
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 0.85rem 0.9rem;
}

.insight-pill span {
    color: var(--text-muted);
    display: block;
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.insight-pill strong {
    font-size: 1.05rem;
}

/* Small utility styles for appointments list */
.action-btn {
    background: transparent;
    border: none;
    padding: 6px 8px;
    color: var(--text-dark);
    border-radius: 8px;
    transition: background-color 0.12s ease, transform 0.12s ease;
}
.action-btn:hover {
    background: rgba(15,118,110,0.06);
    transform: translateY(-2px);
}
.status-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.table-hover tbody tr:hover {
    background-color: rgba(15,118,110,0.03);
}

/* Sort header indicator */
.th-sort {
    cursor: pointer;
    user-select: none;
}
.sort-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 6px;
    vertical-align: middle;
}
.sort-indicator::after {
    content: '';
    display: inline-block;
    border: 4px solid transparent;
    border-top-color: var(--text-muted);
    transform: translateY(-2px);
    opacity: 0.6;
}
.sort-asc .sort-indicator::after {
    border-top-color: var(--text-muted);
    border-bottom: none;
}
.sort-desc .sort-indicator::after {
    border-top-color: transparent;
    border-bottom: 4px solid var(--text-muted);
    transform: translateY(2px);
}
.th-sort.active {
    color: var(--primary-color);
    font-weight: 700;
}

/* Interactive Timelines & Status Badges */
.status-badge {
    padding: 0.45em 0.85em;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 100px;
    letter-spacing: 0.2px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.status-badge.bg-success {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #10b981 !important;
}

.status-badge.bg-warning {
    background-color: rgba(245, 158, 11, 0.1) !important;
    color: #f59e0b !important;
}

.status-badge.bg-danger {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
}

/* High-end inputs and buttons */
.form-control, .form-select {
    border: 1px solid var(--border-soft);
    border-radius: var(--border-radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    background-color: rgba(255, 255, 255, 0.86);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
    background-color: #ffffff;
}

.searchable-select {
    position: relative;
}

.searchable-select-results {
    position: absolute;
    z-index: 30;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    padding: 0.35rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--border-radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-lg);
}

.searchable-select-option {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-dark);
    padding: 0.65rem 0.75rem;
    text-align: left;
    font: inherit;
}

.searchable-select-option:hover,
.searchable-select-option:focus {
    background: rgba(13, 148, 136, 0.1);
    color: var(--primary-dark);
    outline: none;
}

.searchable-select-empty {
    padding: 0.75rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.input-group-text {
    border-color: var(--border-soft);
    border-radius: var(--border-radius-md);
}

.btn {
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    border-radius: var(--border-radius-md);
    transition: transform 0.22s var(--ease-out), box-shadow 0.22s ease, background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease;
    overflow: hidden;
    position: relative;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary-color) 50%, var(--accent-teal) 100%);
    border: none;
    box-shadow: 0 12px 22px -14px rgba(15, 118, 110, 0.75);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0d5f58 0%, #0b7a6f 100%);
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-outline-secondary {
    border-color: rgba(100, 116, 139, 0.28);
    color: #475569;
}

.btn-outline-secondary:hover {
    background-color: #f8fafc;
    border-color: rgba(20, 184, 166, 0.42);
    color: var(--primary-color);
}

.alert {
    border: 0;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-premium);
}

.dropdown-menu {
    border: 1px solid var(--border-soft);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-hover);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 10px;
    font-weight: 600;
}

.dropdown-item:hover {
    background-color: rgba(20, 184, 166, 0.09);
    color: var(--primary-color);
}

.ripple-dot {
    animation: ripple 0.55s ease-out;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    height: 12px;
    pointer-events: none;
    position: absolute;
    transform: translate(-50%, -50%);
    width: 12px;
}

@keyframes ripple {
    from {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(18);
    }
}

/* Premium Profile Header & Balance widget */
.balance-widget {
    background: linear-gradient(135deg, var(--text-dark) 0%, #1e293b 100%);
    color: #ffffff;
    border: none;
}

.balance-widget .text-gold {
    color: var(--accent-gold) !important;
}

.balance-widget .border-end {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Progress bar for payments status */
.progress {
    height: 8px;
    border-radius: 100px;
    background-color: var(--bg-main);
}

.progress-bar {
    background: linear-gradient(90deg, var(--accent-teal), var(--accent-gold));
}

/* Custom layout adjustments */
.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.1;
}

.table {
    --bs-table-hover-bg: rgba(20, 184, 166, 0.055);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-dark);
    --bs-table-border-color: var(--border-soft);
}

.table-light {
    --bs-table-bg: rgba(248, 250, 252, 0.88);
    --bs-table-color: var(--text-muted);
    --bs-table-border-color: var(--border-soft);
}

.table thead th {
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding-bottom: 0.9rem;
    padding-top: 0.9rem;
    text-transform: uppercase;
}

.table tbody td {
    border-color: rgba(226, 232, 240, 0.65);
    padding-bottom: 1rem;
    padding-top: 1rem;
}

.table tbody tr {
    transition: background-color 0.2s ease, transform 0.2s var(--ease-out);
}

.table tbody tr:hover {
    transform: translateX(2px);
}

.catalog-row {
    opacity: 1;
}

.catalog-row.is-hidden {
    display: none !important;
}

.treatment-dot {
    align-items: center;
    background: rgba(20, 184, 166, 0.12);
    border-radius: 10px;
    color: var(--primary-color);
    display: inline-flex;
    height: 28px;
    justify-content: center;
    margin-right: 0.6rem;
    width: 28px;
}

.tooth-chart {
    background:
        linear-gradient(180deg, rgba(251, 113, 133, 0.08), transparent 44%, rgba(251, 113, 133, 0.08)),
        #fff;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    padding: 1rem;
}

.tooth-arch {
    display: grid;
    gap: 0.35rem;
    grid-template-columns: repeat(16, minmax(0, 1fr));
}

.tooth-btn {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    padding: 0;
}

.tooth-shape {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 45% 45% 35% 35%;
    box-shadow: inset 0 -5px 0 rgba(15, 23, 42, 0.04);
    display: block;
    height: 34px;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    width: 24px;
}

.tooth-arch-lower .tooth-shape {
    border-radius: 35% 35% 45% 45%;
    box-shadow: inset 0 5px 0 rgba(15, 23, 42, 0.04);
}

.tooth-label {
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
}

.tooth-btn:hover .tooth-shape,
.tooth-btn:focus-visible .tooth-shape {
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.tooth-btn.is-selected {
    color: var(--primary-deep);
}

.tooth-btn.is-selected .tooth-shape {
    background: var(--accent-mint);
    border-color: var(--primary-color);
    box-shadow: inset 0 -5px 0 rgba(15, 118, 110, 0.12), 0 0 0 2px rgba(15, 118, 110, 0.1);
}

.mouth-gap {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    font-size: 0.72rem;
    font-weight: 700;
    justify-content: space-between;
    margin: 0.7rem 0;
}

.price-chip {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(37, 99, 235, 0.08));
    border: 1px solid rgba(20, 184, 166, 0.18);
    border-radius: 999px;
    color: var(--primary-deep);
    display: inline-flex;
    padding: 0.42rem 0.72rem;
}

.treatment-money-summary {
    max-width: 560px;
}

.money-chip {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    color: var(--text-dark);
    display: inline-flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 108px;
    padding: 0.45rem 0.65rem;
    text-align: left;
}

.money-chip small {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
}

.money-chip strong {
    font-size: 0.88rem;
    line-height: 1.15;
    white-space: nowrap;
}

.money-chip-paid strong {
    color: #10b981;
}

.money-chip-rest strong {
    color: #ef4444;
}

.money-chip-surplus strong {
    color: #10b981;
}

.appointment-payment-summary {
    align-items: center;
    display: flex;
    gap: 0.75rem;
    min-width: 275px;
}

.appointment-payment-summary span {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.appointment-payment-summary small {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
}

.appointment-payment-summary strong {
    font-size: 0.8rem;
    white-space: nowrap;
}

.payment-history-toggle {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    color: var(--primary-color);
    display: inline-flex;
    height: 30px;
    justify-content: center;
    margin-left: 0.25rem;
    width: 30px;
}

.payment-history-toggle i {
    transition: transform 0.2s ease;
}

.payment-history-toggle.is-open i {
    transform: rotate(180deg);
}

.appointment-payment-details-row td {
    background: rgba(20, 184, 166, 0.06);
    padding: 0 1rem 1rem 1rem !important;
}

.appointment-payment-details {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    display: grid;
    gap: 0;
    margin-left: 1rem;
    overflow: hidden;
}

.appointment-payment-details-title {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    padding: 0.65rem 0.85rem;
}

.appointment-payment-detail-line {
    align-items: center;
    border-top: 1px solid var(--border-soft);
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 110px 90px minmax(0, 1fr) 120px;
    padding: 0.7rem 0.85rem;
}

.payment-detail-date,
.payment-detail-method,
.payment-detail-note {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.payment-detail-note {
    overflow-wrap: anywhere;
}

.appointment-payment-detail-line strong {
    color: var(--primary-color);
    text-align: right;
    white-space: nowrap;
}

.appointment-treatment-panel {
    display: grid;
    gap: 0.75rem;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.appointment-treatment-item {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    padding: 0.85rem;
}

.search-card {
    position: sticky;
    top: 1rem;
    z-index: 4;
}

.search-control .form-control {
    min-height: 48px;
}

.modal-content {
    border: 1px solid var(--border-soft);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-hover);
    overflow: hidden;
}

.modal-header,
.modal-footer {
    border-color: var(--border-soft);
    background: rgba(248, 250, 252, 0.86);
}

.list-group-item {
    border-radius: var(--border-radius-md);
    transition: background-color 0.22s ease, transform 0.22s var(--ease-out);
}

.list-group-item:hover {
    background-color: rgba(20, 184, 166, 0.07);
    transform: translateX(3px);
}

.badge {
    font-weight: 700;
}

.text-teal {
    color: var(--primary-color) !important;
}

::selection {
    background: rgba(20, 184, 166, 0.24);
}

@media (max-width: 767.98px) {
    .main-content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .page-title {
        font-size: 1.55rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 1rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 > .d-flex.gap-2 {
        flex-wrap: wrap;
        width: 100%;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 .btn {
        justify-content: center;
        width: 100%;
    }

    .dashboard-hero {
        padding: 1.15rem;
    }

    .dashboard-hero-top,
    .dashboard-hero-actions,
    .filter-actions {
        flex-direction: column;
    }

    .dashboard-hero-actions .btn,
    .filter-actions .btn {
        width: 100%;
    }

    .dashboard-filter-panel {
        grid-template-columns: 1fr;
    }

    .dashboard-meta {
        gap: 0.55rem;
    }

    .meta-chip {
        width: 100%;
    }

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

    .client-welcome,
    .client-welcome-actions {
        flex-direction: column;
    }

    .client-welcome-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

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

    .search-card {
        top: 0.5rem;
    }
}

@media (max-width: 991.98px) {
    .dashboard-hero-top {
        flex-direction: column;
    }

    .dashboard-hero-actions {
        justify-content: flex-start;
    }

    .dashboard-filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-actions,
    .filter-helper {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767.98px) {
    .dashboard-filter-panel {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Fix Bootstrap dropdown clipping inside table-responsive on desktop screens */
@media (min-width: 768px) {
    .table-responsive {
        overflow: visible !important;
    }
}

/* Custom Premium Action Buttons */
.action-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    background: #ffffff;
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: all 0.2s var(--ease-out);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.action-btn i {
    transition: transform 0.2s ease;
}

.action-btn:hover i {
    transform: scale(1.1);
}

.action-btn-view {
    color: var(--primary-color);
    border-color: rgba(15, 118, 110, 0.15);
}
.action-btn-view:hover {
    background-color: var(--accent-mint);
    border-color: rgba(15, 118, 110, 0.35);
    color: var(--primary-deep);
}

.action-btn-edit {
    color: var(--accent-gold);
    border-color: rgba(214, 162, 74, 0.15);
}
.action-btn-edit:hover {
    background-color: var(--accent-gold-light);
    border-color: rgba(214, 162, 74, 0.35);
    color: var(--accent-gold);
}

.action-btn-delete {
    color: var(--accent-rose);
    border-color: rgba(251, 113, 133, 0.15);
}
.action-btn-delete:hover {
    background-color: rgba(251, 113, 133, 0.08);
    border-color: rgba(251, 113, 133, 0.35);
    color: var(--accent-rose);
}

.action-btn-success {
    color: var(--accent-teal);
    border-color: rgba(20, 184, 166, 0.15);
}
.action-btn-success:hover {
    background-color: var(--accent-mint);
    border-color: rgba(20, 184, 166, 0.35);
    color: var(--primary-color);
}

.action-btn-warning {
    color: var(--accent-gold);
    border-color: rgba(214, 162, 74, 0.15);
}
.action-btn-warning:hover {
    background-color: var(--accent-gold-light);
    border-color: rgba(214, 162, 74, 0.35);
    color: var(--accent-gold);
}

.payments-table {
    table-layout: fixed;
    min-width: 0;
    width: 100%;
}

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

.payment-date-col {
    width: 13%;
}

.payment-method-col {
    width: 18%;
}

.payment-amount-col {
    width: 230px;
}

.payment-nowrap,
.payment-amount-cell {
    white-space: nowrap;
}

.payment-amount-action {
    align-items: center;
    display: inline-flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.payment-notes-cell {
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.payment-motif {
    background: rgba(20, 184, 166, 0.08);
    border-left: 3px solid var(--accent-teal);
    border-radius: 6px;
    color: var(--text-dark);
    padding: 0.45rem 0.6rem;
}

@media (max-width: 992px) {
    .payments-table {
        min-width: 760px;
    }

    .payment-amount-col {
        width: 190px;
    }

    .payment-amount-action {
        align-items: flex-end;
        flex-direction: column;
        gap: 0.45rem;
    }
}

/* Practical appointments page */
.appointments-hero {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.appointments-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.appointment-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.appointment-summary .col:nth-child(n+5) {
    display: none;
}

.appointment-summary .col {
    width: auto;
}

.appointment-summary .card {
    border: 1px solid var(--border-soft) !important;
    border-left: 0 !important;
    border-radius: 8px;
    box-shadow: none;
    min-height: 76px;
    padding: 0.9rem 1rem !important;
}

.appointment-summary .card:hover,
.appointment-panel:hover {
    transform: none;
}

.appointment-summary .card .text-muted {
    font-size: 0.72rem;
    letter-spacing: 0;
    text-transform: none !important;
}

.appointment-summary .card h4 {
    font-size: 1.45rem;
    margin-top: 0.35rem !important;
}

.appointment-summary .progress {
    display: none;
}

.appointment-panel {
    border-radius: 8px;
    box-shadow: none;
}

.appointment-filter-header {
    padding: 0.9rem;
}

.appointment-filter-header .form-control,
.appointment-filter-header .form-select,
.appointment-filter-header .input-group-text {
    border-radius: 8px;
    min-height: 38px;
    padding-bottom: 0.45rem;
    padding-top: 0.45rem;
}

.daily-payment-total {
    align-items: center;
    background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 52%, #fff7ed 100%);
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
}

.daily-payment-total-icon {
    align-items: center;
    background: var(--primary-color);
    border-radius: 8px;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 40px;
    font-size: 1.2rem;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.daily-payment-total-copy {
    display: grid;
    gap: 0.1rem;
}

.daily-payment-total-copy span {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
}

.daily-payment-total-copy strong {
    color: var(--primary-dark);
    font-size: clamp(1.25rem, 2.4vw, 1.7rem);
    line-height: 1.05;
}

.daily-payment-total-copy small {
    color: var(--accent-gold);
    font-weight: 700;
}

.appointment-sort {
    min-width: 92px;
}

#list-table tbody td {
    padding-bottom: 0.8rem;
    padding-top: 0.8rem;
}

.appointment-status-select {
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
    min-width: 145px;
    padding: 0.42rem 2.2rem 0.42rem 1rem;
    border: 1px solid transparent;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    transition: all 0.2s ease-in-out;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.appointment-status-select:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.appointment-status-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
    border-color: var(--accent-teal) !important;
}

.appointment-status-select:disabled {
    cursor: wait;
    opacity: 0.72;
}

.queue-number-badge {
    align-items: center;
    background: var(--accent-mint);
    border: 1px solid rgba(15, 118, 110, 0.22);
    border-radius: 999px;
    color: var(--primary-deep);
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 800;
    height: 30px;
    justify-content: center;
    min-width: 30px;
    padding: 0 0.55rem;
}

.queue-strip {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    padding: 0.9rem;
}

.queue-patient {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    color: var(--text-dark);
    display: inline-flex;
    gap: 0.65rem;
    min-width: 230px;
    padding: 0.75rem;
    text-align: left;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ease-out);
}

.queue-patient:hover {
    border-color: rgba(15, 118, 110, 0.32);
    box-shadow: var(--shadow-premium);
    transform: translateY(-1px);
}

.queue-patient-main {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    display: inline-flex;
    flex: 1;
    gap: 0.65rem;
    min-width: 0;
    padding: 0;
    text-align: left;
}

.queue-patient-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.queue-patient-info strong,
.queue-patient-info small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-patient-info small {
    color: var(--text-muted);
}

@media (max-width: 991.98px) {
    .appointment-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .appointments-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .appointments-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        justify-content: stretch;
    }

    .appointments-actions .btn {
        justify-content: center;
        min-width: 0;
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    .appointment-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .appointment-summary .card {
        min-height: 70px;
        padding: 0.75rem !important;
    }

    .tooth-arch {
        grid-template-columns: repeat(8, minmax(0, 1fr));
        row-gap: 0.6rem;
    }

}

/* --- FullCalendar Premium Customization --- */
.fc {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    background: #ffffff;
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.fc .fc-toolbar-title {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-dark);
}
.fc .fc-button-primary {
    background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary-color) 50%, var(--accent-teal) 100%) !important;
    border: none !important;
    box-shadow: 0 4px 10px rgba(15, 118, 110, 0.3) !important;
    border-radius: var(--border-radius-md) !important;
    font-weight: 600 !important;
    text-transform: capitalize !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease !important;
}
.fc .fc-button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(15, 118, 110, 0.4) !important;
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: var(--primary-deep) !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2) !important;
}
.fc-theme-standard td, .fc-theme-standard th, .fc-theme-standard .fc-scrollgrid {
    border-color: var(--border-soft) !important;
}
.fc .fc-col-header-cell-cushion {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 10px !important;
}
.fc .fc-daygrid-day-number {
    font-weight: 600;
    color: var(--text-dark);
    padding: 8px !important;
}
.fc .fc-day-today {
    background-color: rgba(20, 184, 166, 0.05) !important;
}
.fc-timegrid-slot-label-cushion {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}
.fc-v-event {
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important;
    padding: 3px 5px !important;
    transition: transform 0.2s ease;
}
.fc-v-event:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15) !important;
    z-index: 10 !important;
}
.fc-event-main {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
}

/* Mobile polish only: keeps desktop layout unchanged. */
@media (max-width: 767.98px) {
    body::before {
        background-size: 32px 32px;
    }

    .container-fluid {
        padding-left: 0;
        padding-right: 0;
    }

    .main-content {
        padding-top: 0.85rem !important;
    }

    .mobile-header {
        border-radius: 0;
        margin-left: -1rem;
        margin-right: -1rem;
        margin-top: -0.85rem;
        padding: 0.75rem 1rem;
        position: sticky;
        top: 0;
        z-index: 1020;
    }

    .mobile-header .fw-bold.fs-5 {
        font-size: 0.95rem !important;
        line-height: 1.15;
        max-width: calc(100vw - 112px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-logo-sm {
        height: 30px;
        width: 30px;
    }

    .page-title {
        font-size: 1.35rem;
        line-height: 1.2;
    }

    .dashboard-hero {
        border-radius: 12px;
        margin-bottom: 1rem !important;
        padding: 0.9rem;
    }

    .dashboard-hero .eyebrow {
        font-size: 0.68rem;
        margin-bottom: 0.35rem;
    }

    .dashboard-copy .page-title {
        font-size: 1.3rem;
    }

    .dashboard-copy p {
        font-size: 0.88rem;
    }

    .dashboard-hero-actions .btn {
        min-height: 42px;
    }

    .dashboard-filter-panel {
        border-radius: 12px;
        gap: 0.65rem;
        padding: 0.75rem;
    }

    .dashboard-filter-panel .form-control,
    .dashboard-filter-panel .form-select,
    .filter-actions .btn {
        min-height: 42px;
    }

    .filter-helper {
        font-size: 0.76rem;
    }

    .meta-chip {
        border-radius: 10px;
        font-size: 0.78rem;
        justify-content: center;
        padding: 0.5rem 0.65rem;
    }

    .section-heading {
        margin-bottom: 0.75rem !important;
    }

    .section-heading h2 {
        font-size: 1.05rem;
    }

    .section-heading p {
        font-size: 0.86rem;
    }

    .dashboard-kpi .card-body {
        padding: 0.9rem !important;
    }

    .dashboard-kpi h3 {
        font-size: 1.35rem;
    }

    .kpi-scope {
        font-size: 0.65rem;
        padding: 0.28rem 0.5rem;
    }

    .dashboard-kpi .kpi-label {
        font-size: 0.76rem;
    }

    .kpi-note {
        font-size: 0.74rem;
    }

    .stat-icon {
        border-radius: 10px;
        height: 40px;
        min-width: 40px;
        width: 40px;
    }

    .card {
        border-radius: 12px;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 0.55rem;
        padding: 0.85rem 1rem !important;
    }

    .card-title {
        font-size: 1rem;
    }

    .card-subtitle {
        font-size: 0.8rem;
    }

    .btn {
        min-height: 42px;
        padding: 0.55rem 0.8rem;
    }

    .input-group {
        flex-wrap: nowrap;
    }

    .input-group-text {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .form-control,
    .form-select {
        min-height: 42px;
    }

    textarea.form-control {
        min-height: 86px;
    }

    .row.g-3,
    .row.g-4 {
        --bs-gutter-y: 0.85rem;
    }

    .table-responsive {
        border-radius: 0 0 12px 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 720px;
    }

    .table th,
    .table td {
        font-size: 0.82rem;
        padding-bottom: 0.7rem;
        padding-top: 0.7rem;
        white-space: nowrap;
    }

    .table td .small,
    .table small {
        white-space: normal;
    }

    .action-btn {
        height: 36px;
        min-width: 36px;
        padding: 0;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-dialog-centered {
        min-height: calc(100% - 1rem);
    }

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

    .modal-body .border-end {
        border-right: 0 !important;
        border-bottom: 1px solid var(--border-soft);
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .modal-body .ps-lg-4 {
        padding-left: 0 !important;
    }

    .appointments-actions {
        grid-template-columns: 1fr;
    }

    .appointment-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .appointment-summary .card h4 {
        font-size: 1.05rem;
    }

    .queue-strip {
        display: grid;
        gap: 0.6rem;
        padding: 0.75rem;
    }

    .queue-patient {
        min-width: 0;
        width: 100%;
    }

    .appointment-filter-header .row > [class*="col-"] {
        width: 100%;
    }

    #calendar {
        min-height: 520px;
    }

    .fc {
        border-radius: 12px;
        padding: 0.5rem;
    }

    .fc .fc-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 0.5rem;
    }

    .fc .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }

    .fc .fc-toolbar-title {
        font-size: 1rem;
    }

    .fc .fc-button-primary {
        padding: 0.35rem 0.5rem !important;
    }

    .auth-card {
        margin: 1rem;
        padding: 2rem 1.25rem;
    }

    .auth-logo {
        height: 82px;
        width: 82px;
    }
}
