@font-face {
    font-family: "Clinic Urdu";
    src: url("../fonts/NotoNastaliqUrdu-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --app-bg:
        radial-gradient(circle at top left, rgba(21, 150, 125, 0.14), transparent 24%),
        radial-gradient(circle at top right, rgba(76, 184, 164, 0.14), transparent 28%),
        linear-gradient(180deg, #f6f8fb 0%, #eef3f9 100%);
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: #ffffff;
    --surface-muted: rgba(247, 250, 253, 0.96);
    --border: rgba(193, 207, 223, 0.72);
    --border-strong: rgba(168, 186, 206, 0.95);
    --text: #132238;
    --text-muted: #66758a;
    --text-soft: #8290a3;
    --primary: #15967d;
    --primary-dark: #0f6b5a;
    --teal: #15967d;
    --orange: #d88d3f;
    --rose: #d47295;
    --sidebar-bg:
        radial-gradient(circle at top, rgba(90, 193, 173, 0.2), transparent 24%),
        linear-gradient(180deg, #0d2f34 0%, #124148 55%, #10363d 100%);
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: rgba(232, 240, 248, 0.88);
    --sidebar-muted: rgba(197, 214, 231, 0.62);
    --sidebar-active-bg: rgba(255, 255, 255, 0.14);
    --sidebar-active-border: rgba(128, 222, 204, 0.55);
    --shadow-soft: 0 18px 40px rgba(17, 33, 56, 0.08);
    --shadow-card: 0 16px 34px rgba(15, 35, 60, 0.08);
    --radius-xl: 22px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Trebuchet MS", Tahoma, sans-serif;
    color: var(--text);
    background: var(--app-bg);
    font-size: 0.88rem;
    line-height: 1.42;
    min-height: 100vh;
}

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

.app-layout {
    min-height: 100vh;
    display: flex;
}

.app-sidebar {
    width: 258px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 18px 16px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 10px 0 32px rgba(8, 20, 35, 0.18);
}

.app-sidebar-brand {
    padding: 4px 0 14px;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 16px;
}

.app-sidebar-brand-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.app-brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.app-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.92rem;
    letter-spacing: 0.08em;
    color: #eff8ff;
    background: linear-gradient(145deg, rgba(108, 210, 192, 0.36), rgba(35, 123, 109, 0.22));
    border: 1px solid rgba(172, 236, 222, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.app-brand-title {
    display: block;
    font-size: 1.06rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.app-brand-subtitle {
    display: block;
    color: var(--sidebar-muted);
    font-size: 0.75rem;
    margin-top: 2px;
}

.app-sidebar-close,
.app-menu-toggle {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.app-sidebar-close {
    position: relative;
    width: 38px;
    height: 38px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex: 0 0 auto;
}

.app-sidebar-close span {
    position: absolute;
    width: 16px;
    height: 2px;
    border-radius: 999px;
    background: #d8f6ef;
}

.app-sidebar-close span:first-child {
    transform: rotate(45deg);
}

.app-sidebar-close span:last-child {
    transform: rotate(-45deg);
}

.app-sidebar-section {
    margin-top: 12px;
    color: var(--sidebar-muted);
    font-size: 0.74rem;
    line-height: 1.45;
}

.app-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.84rem;
    border: 1px solid transparent;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.app-nav-link:hover {
    transform: translateX(3px);
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.app-nav-link.active {
    background: var(--sidebar-active-bg);
    border-color: var(--sidebar-active-border);
    color: #ffffff;
}

.app-nav-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    border-radius: 8px;
    position: relative;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.08);
}

.app-nav-icon::before,
.app-nav-icon::after {
    content: "";
    position: absolute;
}

.app-icon-grid::before {
    inset: 4px;
    border-radius: 4px;
    background:
        linear-gradient(#d8f6ef, #d8f6ef) left top / 5px 5px no-repeat,
        linear-gradient(#d8f6ef, #d8f6ef) right top / 5px 5px no-repeat,
        linear-gradient(#d8f6ef, #d8f6ef) left bottom / 5px 5px no-repeat,
        linear-gradient(#d8f6ef, #d8f6ef) right bottom / 5px 5px no-repeat;
}

.app-icon-team::before {
    left: 4px;
    top: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d8f6ef;
    box-shadow: 6px 0 0 #d8f6ef;
}

.app-icon-team::after {
    left: 3px;
    bottom: 4px;
    width: 14px;
    height: 6px;
    border-radius: 8px 8px 4px 4px;
    border: 2px solid #d8f6ef;
    border-top-width: 3px;
}

.app-icon-chart::before {
    left: 4px;
    bottom: 4px;
    width: 3px;
    height: 6px;
    background: #d8f6ef;
    box-shadow: 5px -2px 0 #d8f6ef, 10px -5px 0 #d8f6ef;
}

.app-icon-gear::before {
    inset: 4px;
    border-radius: 50%;
    border: 2px solid #d8f6ef;
}

.app-icon-gear::after {
    left: 8px;
    top: 8px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #d8f6ef;
}

.app-icon-stethoscope::before {
    left: 5px;
    top: 4px;
    width: 10px;
    height: 9px;
    border: 2px solid #d8f6ef;
    border-top: 0;
    border-radius: 0 0 7px 7px;
}

.app-icon-stethoscope::after {
    left: 8px;
    bottom: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #d8f6ef;
}

.app-icon-document::before {
    left: 5px;
    top: 3px;
    width: 10px;
    height: 13px;
    border-radius: 3px;
    border: 2px solid #d8f6ef;
}

.app-icon-document::after {
    left: 7px;
    top: 8px;
    width: 6px;
    height: 2px;
    background: #d8f6ef;
    box-shadow: 0 4px 0 #d8f6ef;
}

.app-icon-download::before {
    left: 9px;
    top: 3px;
    width: 2px;
    height: 9px;
    background: #d8f6ef;
}

.app-icon-download::after {
    left: 5px;
    top: 9px;
    width: 10px;
    height: 7px;
    border-left: 2px solid #d8f6ef;
    border-bottom: 2px solid #d8f6ef;
    transform: rotate(-45deg);
}

.app-icon-backup::before {
    left: 4px;
    top: 4px;
    width: 12px;
    height: 12px;
    border: 2px solid #d8f6ef;
    border-radius: 50% / 28%;
    background:
        linear-gradient(#d8f6ef, #d8f6ef) center 4px / 8px 2px no-repeat,
        linear-gradient(#d8f6ef, #d8f6ef) center 8px / 8px 2px no-repeat;
}

.app-icon-backup::after {
    right: 2px;
    bottom: 2px;
    width: 7px;
    height: 7px;
    border-right: 2px solid #d8f6ef;
    border-bottom: 2px solid #d8f6ef;
    transform: rotate(45deg);
}

.app-icon-search::before {
    left: 4px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid #d8f6ef;
}

.app-icon-search::after {
    right: 4px;
    bottom: 4px;
    width: 6px;
    height: 2px;
    background: #d8f6ef;
    transform: rotate(45deg);
    transform-origin: center;
}

.app-icon-plus::before,
.app-icon-plus::after {
    background: #d8f6ef;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.app-icon-plus::before {
    width: 10px;
    height: 2px;
}

.app-icon-plus::after {
    width: 2px;
    height: 10px;
}

.app-icon-pulse::before {
    left: 3px;
    top: 9px;
    width: 14px;
    height: 2px;
    background: linear-gradient(90deg, #d8f6ef 0 20%, transparent 20% 22%, #d8f6ef 22% 34%, transparent 34% 36%, #d8f6ef 36% 54%, transparent 54% 56%, #d8f6ef 56% 100%);
}

.app-sidebar-footer {
    margin-top: auto;
    padding-top: 14px;
}

.app-user-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 10px;
}

.app-user-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sidebar-muted);
}

.app-user-name {
    margin-top: 4px;
    font-size: 0.9rem;
    font-weight: 800;
    color: #fff;
}

.app-user-role {
    color: rgba(232, 240, 248, 0.75);
    font-size: 0.76rem;
}

.app-sidebar-footer .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.22);
    color: #f4f8fc;
}

.app-sidebar-footer .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(246, 249, 252, 0.82);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(202, 214, 228, 0.8);
    padding: 16px 22px 14px;
}

.app-topbar-shell {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
}

.app-topbar-actions {
    display: none;
    margin-left: auto;
    flex: 0 0 auto;
}

.app-topbar-logout {
    border-color: rgba(21, 150, 125, 0.34);
    color: var(--primary-dark);
    font-weight: 800;
    background: rgba(255, 255, 255, 0.72);
}

.app-topbar-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.app-menu-toggle {
    width: 42px;
    height: 42px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(183, 198, 214, 0.92);
    box-shadow: 0 10px 22px rgba(19, 39, 63, 0.08);
}

.app-menu-toggle span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: #165d54;
}

.app-topbar-eyebrow {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 4px;
}

.app-page-title {
    margin: 0;
    font-size: 1.42rem;
    line-height: 1.16;
    font-weight: 800;
}

.app-content {
    padding: 18px 22px 22px;
}

.app-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 24;
    background: rgba(8, 19, 33, 0.42);
    backdrop-filter: blur(2px);
}

.guest-body {
    background:
        radial-gradient(circle at 12% 18%, rgba(21, 150, 125, 0.18), transparent 18%),
        radial-gradient(circle at 88% 16%, rgba(45, 181, 154, 0.18), transparent 20%),
        radial-gradient(circle at 74% 78%, rgba(230, 168, 92, 0.14), transparent 18%),
        linear-gradient(135deg, #f4fbf9 0%, #edf7f4 42%, #f9f5f7 100%);
}

.guest-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.guest-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.guest-footer {
    text-align: center;
    color: var(--text-muted);
    padding: 12px 16px 18px;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-card);
}

.card-header {
    background: rgba(255, 255, 255, 0.45);
    border-bottom: 1px solid rgba(214, 223, 233, 0.7);
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text);
}

.card-body {
    padding: 12px 14px;
}

.table {
    --bs-table-striped-bg: rgba(238, 248, 245, 0.78);
    --bs-table-hover-bg: rgba(229, 245, 240, 0.92);
    font-size: 0.8rem;
    margin-bottom: 0;
}

.table thead th {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #516377;
    white-space: nowrap;
}

.table th,
.table td {
    padding: 0.48rem 0.5rem;
    vertical-align: middle;
}

.table-light th {
    background: rgba(230, 244, 239, 0.96);
    border-bottom: 1px solid rgba(186, 214, 205, 0.9);
}

.table-responsive {
    max-height: 74vh;
}

.list-group-item {
    background: transparent;
}

.btn {
    --bs-btn-padding-y: 0.42rem;
    --bs-btn-padding-x: 0.72rem;
    --bs-btn-font-size: 0.81rem;
    --bs-btn-border-radius: 0.85rem;
    font-weight: 700;
}

.btn-primary {
    background: linear-gradient(135deg, #1b9d86 0%, #0f6b5a 100%);
    border-color: #0f6b5a;
    box-shadow: 0 10px 20px rgba(21, 150, 125, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #168d77 0%, #0b584b 100%);
    border-color: #0b584b;
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-success,
.btn-outline-danger {
    background: rgba(255, 255, 255, 0.75);
}

.form-control,
.form-select,
.input-group-text {
    min-height: 37px;
    border-radius: 12px;
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.94);
    font-size: 0.83rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(21, 150, 125, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(21, 150, 125, 0.12);
}

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

.alert {
    border-radius: 14px;
    font-size: 0.8rem;
    padding: 0.68rem 0.82rem;
}

.badge {
    padding: 0.38em 0.58em;
    border-radius: 999px;
    font-size: 0.66rem;
    letter-spacing: 0.04em;
}

.section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

.mb-3 {
    margin-bottom: 0.8rem !important;
}

.mt-4 {
    margin-top: 1rem !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text);
}

h2,
.h2 {
    font-size: 1.08rem;
    margin-bottom: 0.25rem;
}

h5,
.h5 {
    font-size: 0.88rem;
}

.display-5 {
    font-size: 1.9rem;
    line-height: 1.1;
    font-weight: 800;
}

label.form-label {
    margin-bottom: 0.34rem;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #506275;
}

.text-muted,
small {
    color: var(--text-muted) !important;
}

.workspace-hero {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 20px 22px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.44), transparent 24%),
        linear-gradient(135deg, #0d5555 0%, #157c74 46%, #1b9985 100%);
    color: #f3f9ff;
    box-shadow: 0 22px 38px rgba(20, 41, 69, 0.16);
    margin-bottom: 16px;
}

.workspace-hero::after {
    content: "";
    position: absolute;
    right: -36px;
    bottom: -50px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.workspace-hero h2 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.workspace-hero p,
.workspace-hero small {
    color: rgba(233, 249, 245, 0.86) !important;
    max-width: 720px;
    font-size: 0.84rem;
}

.workspace-hero-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.workspace-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.76rem;
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-col-8 {
    grid-column: span 8;
}

.dashboard-col-4 {
    grid-column: span 4;
}

.dashboard-col-12 {
    grid-column: span 12;
}

.role-stat-card {
    position: relative;
    overflow: hidden;
    height: 100%;
    border-radius: 20px;
    padding: 15px 16px;
    border: 1px solid rgba(201, 214, 228, 0.82);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 254, 0.94));
    box-shadow: var(--shadow-card);
}

.role-stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    border-radius: 20px 0 0 20px;
    background: #58bfa8;
}

.role-stat-card::after {
    content: "";
    position: absolute;
    right: -24px;
    top: -28px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.58);
}

.role-stat-card.admin-sky::before,
.doctor-stat-card-sky::before {
    background: #4dbda3;
}

.role-stat-card.admin-mint::before,
.doctor-stat-card-mint::before {
    background: #6fb89a;
}

.role-stat-card.admin-apricot::before,
.doctor-stat-card-apricot::before {
    background: #e2a257;
}

.role-stat-card.admin-rose::before,
.doctor-stat-card-rose::before {
    background: #d98aa2;
}

.role-stat-card.admin-sky,
.doctor-stat-card-sky {
    background: linear-gradient(180deg, #fbfffe, #eefaf7);
}

.role-stat-card.admin-mint,
.doctor-stat-card-mint {
    background: linear-gradient(180deg, #fcfffd, #edf9f3);
}

.role-stat-card.admin-apricot,
.doctor-stat-card-apricot {
    background: linear-gradient(180deg, #fffdfa, #fff3e6);
}

.role-stat-card.admin-rose,
.doctor-stat-card-rose {
    background: linear-gradient(180deg, #fffdfd, #fdeff3);
}

.role-stat-label,
.doctor-stat-label {
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 0.38rem;
}

.role-stat-value,
.doctor-stat-value {
    font-size: 1.24rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text);
}

.role-stat-meta,
.doctor-stat-meta {
    margin-top: 0.42rem;
    color: var(--text-muted);
    font-size: 0.74rem;
}

.dashboard-panel {
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid rgba(198, 210, 224, 0.78);
    box-shadow: var(--shadow-card);
}

.dashboard-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px 10px;
    border-bottom: 1px solid rgba(214, 223, 233, 0.76);
}

.dashboard-panel-title {
    font-size: 0.84rem;
    font-weight: 800;
    color: var(--text);
}

.dashboard-panel-subtitle {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.dashboard-panel-body {
    padding: 12px 14px 14px;
}

.admin-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.quick-link-card {
    display: block;
    text-decoration: none;
    color: var(--text);
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(242, 249, 247, 0.94));
    border: 1px solid rgba(202, 214, 227, 0.9);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.quick-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(16, 38, 61, 0.09);
    border-color: rgba(110, 184, 170, 0.9);
}

.quick-link-title {
    display: block;
    font-size: 0.86rem;
    font-weight: 800;
}

.quick-link-copy {
    display: block;
    font-size: 0.73rem;
    color: var(--text-muted);
    margin-top: 5px;
    line-height: 1.42;
}

.login-shell {
    width: min(460px, 100%);
    margin: 0 auto;
}

.login-kicker {
    display: inline-flex;
    padding: 0.42rem 0.72rem;
    border-radius: 999px;
    background: rgba(236, 244, 251, 0.98);
    border: 1px solid rgba(193, 208, 223, 0.92);
    color: #486074;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(198, 212, 227, 0.82);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 22px 40px rgba(19, 35, 57, 0.1);
    padding: 28px 26px;
    backdrop-filter: blur(16px);
    animation: slideUpFade 0.8s ease both;
}

.login-card::after {
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(21, 150, 125, 0.14), transparent 70%);
}

.login-card-simple::after {
    width: 120px;
    height: 120px;
    top: -34px;
    right: -36px;
}

.login-card-header {
    margin-bottom: 20px;
}

.login-card-header h2 {
    font-size: 1.5rem;
    margin: 14px 0 0.35rem;
}

.login-card-header p {
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.52;
}

.login-card .form-label {
    font-size: 0.72rem;
}

.login-card .form-control {
    min-height: 42px;
}

.login-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

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

.auth-card {
    max-width: 520px;
    width: 100%;
}

.auth-brand {
    margin-bottom: 14px;
    text-align: center;
}

.doctor-panel-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.doctor-panel-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.doctor-stat-card {
    height: 100%;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(201, 214, 228, 0.9);
    border-radius: 20px;
    padding: 14px 16px;
    box-shadow: var(--shadow-card);
}

.doctor-stat-card::before,
.doctor-stat-card::after {
    content: "";
    position: absolute;
}

.doctor-stat-card::before {
    inset: 0 auto 0 0;
    width: 5px;
    border-radius: 20px 0 0 20px;
}

.doctor-stat-card::after {
    right: -18px;
    top: -20px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.56);
}

.doctor-panel-card {
    border-color: rgba(198, 210, 224, 0.88);
}

.doctor-panel-card .card-header {
    background: rgba(255, 255, 255, 0.45);
}

.doctor-panel-card-ice {
    background: linear-gradient(180deg, #ffffff, #f4f9fe);
}

.doctor-panel-card-sand {
    background: linear-gradient(180deg, #fffefc, #fbf5ec);
}

.doctor-panel-card-blush {
    background: linear-gradient(180deg, #fffefe, #faf1f5);
}

.doctor-info-block,
.doctor-readonly-block {
    border: 1px solid rgba(205, 216, 228, 0.92);
    border-radius: 14px;
    background: rgba(249, 252, 255, 0.92);
    padding: 10px 12px;
}

.doctor-info-label,
.template-preview-label {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 4px;
}

.doctor-info-value {
    color: var(--text);
    font-weight: 700;
    line-height: 1.42;
}

.doctor-readonly-block {
    line-height: 1.46;
    color: var(--text);
}

.template-toolbar {
    min-width: min(100%, 360px);
}

.template-toolbar .form-control {
    min-width: 220px;
}

.template-preview-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.template-preview-block {
    border: 1px solid rgba(214, 224, 234, 0.92);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.92);
    padding: 10px 12px;
}

.template-preview-value {
    color: var(--text);
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.doctor-template-table {
    font-size: 0.76rem;
}

.doctor-template-table th,
.doctor-template-table td {
    padding: 0.38rem 0.45rem;
    white-space: nowrap;
}

.doctor-template-name-cell {
    min-width: 220px;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doctor-template-count-cell {
    width: 72px;
    text-align: center;
}

.doctor-template-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
}

.doctor-template-actions .btn {
    --bs-btn-padding-y: 0.28rem;
    --bs-btn-padding-x: 0.56rem;
    --bs-btn-font-size: 0.74rem;
}

.patient-record-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: nowrap;
    overflow-x: auto;
    font-size: 0.76rem;
}

.patient-record-header {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.42rem 0.75rem;
    border-bottom: 1px solid #d8e2ec;
    background: rgba(239, 245, 251, 0.95);
    color: #516377;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow-x: auto;
}

.patient-record-item:last-child {
    border-bottom: none;
}

.patient-record-item:hover {
    background-color: #f8f9fa;
}

.patient-record-token {
    font-weight: 700;
    color: #15967d;
    min-width: 54px;
    flex-shrink: 0;
    white-space: nowrap;
}

.patient-record-patient {
    flex: 0 0 auto;
    min-width: 180px;
    max-width: 220px;
    overflow: hidden;
}

.patient-record-patient-name,
.patient-record-patient-mr {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patient-record-patient-name {
    font-weight: 700;
    color: #132238;
}

.patient-record-patient-mr {
    font-size: 0.72rem;
    color: #66758a;
}

.patient-record-issue {
    flex: 0 0 160px;
    color: #66758a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patient-record-fee {
    min-width: 178px;
    color: #132238;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
}

.patient-record-status {
    min-width: 92px;
    flex-shrink: 0;
}

.status-badge {
    display: inline-block;
    padding: 0.26rem 0.48rem;
    border-radius: 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    width: 92px;
    white-space: nowrap;
}

.status-badge-waiting {
    background-color: #d9f4ec;
    color: #0f6b5a;
}

.status-badge-in_consultation {
    background-color: #fff3cd;
    color: #664d03;
}

.status-badge-completed {
    background-color: #d1e7dd;
    color: #0a3622;
}

.status-badge-under_investigation {
    background-color: #e7e1fb;
    color: #4b2a8a;
}

.patient-record-actions {
    display: flex;
    gap: 0.32rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.patient-record-actions .btn {
    --bs-btn-padding-y: 0.26rem;
    --bs-btn-padding-x: 0.48rem;
    --bs-btn-font-size: 0.7rem;
    white-space: nowrap;
    display: inline-block !important;
    margin: 0 !important;
}

.patient-record-actions form {
    display: inline !important;
    margin: 0 !important;
}

.patient-record-actions form .btn {
    display: inline-block !important;
}

.patient-record-header .patient-record-actions {
    justify-content: flex-end;
}

.doctor-queue-table-wrap {
    max-height: none;
}

.doctor-queue-table {
    font-size: 0.84rem;
}

.doctor-queue-table thead th {
    padding: 0.78rem 0.9rem;
}

.doctor-queue-table td {
    padding: 0.82rem 0.9rem;
}

.doctor-queue-table tbody tr:hover {
    background: rgba(244, 249, 253, 0.88);
}

.doctor-queue-token {
    font-weight: 800;
    color: #15967d;
    white-space: nowrap;
}

.doctor-queue-patient-name {
    font-weight: 800;
    color: var(--text);
}

.doctor-queue-patient-meta {
    margin-top: 0.18rem;
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.doctor-queue-issue-cell {
    min-width: 220px;
    color: #556578;
}

.doctor-queue-fee-cell,
.doctor-queue-status-cell,
.doctor-queue-token-cell {
    white-space: nowrap;
}

.doctor-fee-form {
    margin: 0;
}

.doctor-fee-input-group {
    width: 178px;
}

.doctor-fee-input-group .form-control {
    min-width: 0;
}

.doctor-queue-actions {
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.doctor-queue-actions form {
    margin: 0;
}

.doctor-queue-actions .btn {
    --bs-btn-padding-y: 0.36rem;
    --bs-btn-padding-x: 0.68rem;
    --bs-btn-font-size: 0.76rem;
}

.medicine-row {
    background: rgba(255, 255, 255, 0.74);
}

.urdu-field,
.urdu-text {
    font-family: "Clinic Urdu", "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Nafees Nastaleeq", serif;
    direction: rtl;
    text-align: right;
}

.patient-card-sheet {
    display: flex;
    justify-content: center;
}

.patient-card-printable {
    position: relative;
    width: min(100%, 343px);
    aspect-ratio: 1.586 / 1;
    border: 1px solid rgba(173, 194, 208, 0.95);
    border-radius: 12px;
    background:
        radial-gradient(circle at top right, rgba(21, 150, 125, 0.12), transparent 32%),
        radial-gradient(circle at bottom left, rgba(21, 150, 125, 0.08), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fcfb 100%);
    box-shadow: 0 18px 34px rgba(15, 35, 60, 0.1);
    padding: 10px 11px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.patient-card-brand {
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(210, 223, 233, 0.92);
    text-align: center;
    position: relative;
    z-index: 1;
}

.patient-card-clinic-name {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.15;
}

.patient-card-title {
    margin-top: 2px;
    font-size: 0.63rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.patient-card-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 80px;
    gap: 7px;
    margin-top: 7px;
    min-height: 0;
    flex: 1 1 auto;
    align-items: center;
    position: relative;
    z-index: 1;
}

.patient-card-table-wrap {
    min-height: 0;
}

.patient-card-table {
    width: 100%;
    border-collapse: collapse;
}

.patient-card-table th,
.patient-card-table td {
    padding: 2px 0;
    font-size: 0.52rem;
    line-height: 1.1;
    vertical-align: middle;
    border: 0;
    color: var(--text);
}

.patient-card-table th {
    width: 66px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-soft);
    padding-right: 6px;
    white-space: nowrap;
}

.patient-card-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.patient-card-table-prominent {
    font-size: 0.56rem;
    font-weight: 800;
    text-transform: uppercase;
}

.patient-card-table-mr {
    font-size: 0.9rem;
    font-weight: 900;
    color: #0b5f52;
    letter-spacing: 0.04em;
}

.patient-card-table-mr-row th {
    color: #0b5f52;
}

.patient-card-code-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-left: 6px;
    border-left: 1px solid rgba(210, 223, 233, 0.92);
    min-width: 0;
    min-height: 100%;
}

.patient-card-qr {
    width: 68px;
    height: 68px;
    border-radius: 0;
    border: 1px solid rgba(193, 207, 223, 0.92);
    background: #fff;
    padding: 2px;
    flex: 0 0 auto;
    box-shadow: 0 8px 16px rgba(15, 35, 60, 0.08);
}

.patient-card-empty {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

@keyframes floatGlow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(10px);
    }
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1199.98px) {
    .dashboard-col-8,
    .dashboard-col-4 {
        grid-column: span 12;
    }
}

@media (max-width: 991.98px) {
    .app-layout {
        display: block;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 30;
        width: min(290px, calc(100vw - 28px));
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.24s ease;
        border-right: 1px solid var(--sidebar-border);
        box-shadow: 10px 0 32px rgba(8, 20, 35, 0.18);
        overflow-y: auto;
    }

    .app-layout.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .app-layout.sidebar-open .app-main {
        height: 100vh;
        overflow: hidden;
    }

    .app-topbar {
        padding: 14px 14px 12px;
    }

    .app-menu-toggle,
    .app-sidebar-close {
        display: inline-flex;
    }

    .app-content {
        padding: 14px;
    }

    .doctor-panel-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-topbar-shell {
        justify-content: space-between;
        align-items: flex-start;
    }

    .app-topbar-actions {
        display: block;
    }

    .login-card {
        padding: 24px 20px;
    }
}

@media (max-width: 767.98px) {
    .admin-quick-grid,
    .template-preview-modal-grid {
        grid-template-columns: 1fr;
    }

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

    .app-topbar-shell {
        gap: 10px;
    }

    .app-topbar-heading {
        flex: 1 1 auto;
        width: auto;
        align-items: flex-start;
        gap: 10px;
    }

    .app-topbar-heading > div {
        min-width: 0;
    }

    .workspace-hero {
        padding: 18px 16px;
    }

    .workspace-hero h2 {
        font-size: 1.28rem;
    }

    .guest-content {
        padding: 16px;
    }

    .login-shell {
        width: 100%;
    }

    .login-card {
        border-radius: 20px;
        padding: 22px 16px;
    }

    .login-card-header h2 {
        font-size: 1.3rem;
        margin-top: 12px;
    }

    .login-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .login-actions .btn {
        width: 100%;
    }

    .doctor-template-name-cell {
        min-width: 0;
        max-width: none;
    }

    .patient-record-patient,
    .patient-record-issue {
        min-width: 0;
        max-width: none;
    }

    .doctor-queue-table {
        min-width: 860px;
    }

    .patient-card-brand {
        text-align: left;
    }

    .patient-card-content {
        grid-template-columns: 1fr;
    }

    .patient-card-code-panel {
        padding-left: 0;
        padding-top: 6px;
        border-left: 0;
        border-top: 1px solid rgba(210, 223, 233, 0.92);
        align-items: center;
    }
}

@media print {
    @page {
        size: 85.6mm 54mm;
        margin: 0;
    }

    html,
    body {
        width: 85.6mm;
        height: 54mm;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .app-sidebar,
    .app-topbar,
    .patient-card-search-panel,
    .patient-card-toolbar {
        display: none !important;
    }

    .app-content {
        padding: 0 !important;
    }

    .patient-card-page > .col-xl-7 {
        display: none !important;
    }

    .patient-card-page > .col-xl-5 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .patient-card-preview-panel,
    .patient-card-preview-panel .card-body {
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        background: transparent !important;
    }

    .patient-card-preview-panel .card-header {
        display: none !important;
    }

    .patient-card-sheet {
        padding: 0;
        width: 85.6mm;
        height: 54mm;
        justify-content: flex-start;
    }

    .patient-card-printable {
        width: 85.6mm;
        height: 54mm;
        aspect-ratio: auto;
        border-radius: 0;
        box-shadow: none;
        border-color: rgba(150, 166, 181, 0.92);
        page-break-inside: avoid;
        padding: 3.4mm 3.8mm;
    }
}

/* Searchable select (dropdown with type-to-filter) */
.searchable-select {
    position: relative;
}

.searchable-select-input {
    cursor: pointer;
}

.searchable-select-menu {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1050;
    margin: 0;
    padding: 4px;
    max-height: 240px;
    overflow-y: auto;
    list-style: none;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(15, 62, 56, 0.14);
    display: none;
}

.searchable-select.open .searchable-select-menu {
    display: block;
}

.searchable-select-option {
    padding: 7px 10px;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    color: #16322e;
    cursor: pointer;
}

.searchable-select-option:hover {
    background: #ebf8f4;
    color: #0f6b5a;
}

/* Token source badge (reception vs self appointment) */
.token-source-badge {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
