:root {
    --sidebar-width: 282px;
    --sidebar-collapsed-width: 84px;
    --topbar-height: 82px;
    --sidebar-bg: #0b1220;
    --sidebar-bg-2: #111b2f;
    --sidebar-surface: rgba(255,255,255,.055);
    --sidebar-border: rgba(255,255,255,.09);
    --primary: #4f46e5;
    --primary-600: #4338ca;
    --primary-soft: #eef2ff;
    --cyan: #0891b2;
    --teal: #0f766e;
    --success: #16815d;
    --success-soft: #eaf8f2;
    --warning: #b7791f;
    --warning-soft: #fff8e8;
    --danger: #c0362c;
    --danger-soft: #fff1f0;
    --purple: #7c3aed;
    --purple-soft: #f4f0ff;
    --ink: #172033;
    --ink-2: #354158;
    --muted: #6e7b91;
    --muted-2: #98a3b7;
    --page-bg: #f5f7fb;
    --surface: #ffffff;
    --surface-alt: #f9fafc;
    --border: #e2e7f0;
    --border-strong: #d2d9e6;
    --shadow-xs: 0 1px 2px rgba(16,24,40,.04);
    --shadow-sm: 0 4px 14px rgba(24,34,55,.06);
    --shadow-md: 0 12px 30px rgba(24,34,55,.09);
    --shadow-lg: 0 24px 60px rgba(15,23,42,.16);
    --radius-sm: 9px;
    --radius: 14px;
    --radius-lg: 20px;
    --transition: 180ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--page-bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--primary); }
a:hover { color: var(--primary-600); }
button, input, select, textarea { font: inherit; }
code { color: #6d28d9; background: #f4f0ff; border-radius: 6px; padding: .12rem .34rem; font-size: .88em; }

/* Application shell */
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1045;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    color: #fff;
    background:
        radial-gradient(circle at 8% 5%, rgba(79,70,229,.28), transparent 30%),
        linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
    border-right: 1px solid rgba(255,255,255,.04);
    box-shadow: 8px 0 28px rgba(8,15,30,.08);
    transition: width var(--transition), transform var(--transition);
}
.brand {
    min-height: 82px;
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--sidebar-border);
}
.brand-link { min-width: 0; display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand-link:hover { color: #fff; }
.brand-mark {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    font-size: 21px;
    background: linear-gradient(145deg, #6366f1, #06b6d4);
    box-shadow: 0 9px 22px rgba(79,70,229,.38), inset 0 1px 0 rgba(255,255,255,.25);
}
.brand-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.18; }
.brand-copy strong { font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.brand-copy small { margin-top: 4px; color: #93a4c2; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; }
.sidebar-close { margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; }
.sidebar-context {
    margin: 14px 14px 4px;
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--sidebar-border);
    border-radius: 14px;
    background: var(--sidebar-surface);
}
.context-icon { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #a5b4fc; background: rgba(99,102,241,.16); font-size: 16px; }
.context-copy { min-width: 0; display: flex; flex-direction: column; }
.context-copy small { color: #8494b1; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.context-copy strong { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.context-chevron { margin-left: auto; color: #70809c; }
.sidebar-scroll { flex: 1; min-height: 0; overflow: auto; padding: 14px 12px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
.navigation-label { padding: 5px 12px 9px; color: #657693; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; }
.sidebar-nav { display: flex; flex-direction: column; gap: 5px; }
.sidebar-menu-group { display: flex; flex-direction: column; gap: 3px; }
.sidebar-link {
    position: relative;
    min-height: 44px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 12px;
    border: 0;
    border-radius: 12px;
    color: #bac7dc;
    background: transparent;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    text-align: left;
    transition: color var(--transition), background var(--transition), transform var(--transition);
}
.sidebar-link:hover, .sidebar-link:focus-visible { color: #fff; background: rgba(255,255,255,.075); outline: none; }
.sidebar-link.active { color: #fff; background: linear-gradient(90deg, rgba(79,70,229,.34), rgba(79,70,229,.13)); box-shadow: inset 0 0 0 1px rgba(129,140,248,.18); }
.sidebar-link.active .nav-icon { color: #c7d2fe; background: rgba(99,102,241,.22); }
.nav-icon { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: #8fa1bd; font-size: 16px; transition: var(--transition); }
.nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-chevron { margin-left: auto; color: #64748b; font-size: 11px; transition: transform var(--transition); }
.sidebar-parent[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }
.sidebar-submenu { padding: 3px 0 3px 12px; }
.sidebar-child { min-height: 40px; padding-top: 6px; padding-bottom: 6px; font-size: 12.5px; }
.sidebar-child .nav-icon { width: 28px; height: 28px; font-size: 13px; }
.active-marker { position: absolute; right: 7px; width: 4px; height: 18px; border-radius: 10px; background: #818cf8; box-shadow: 0 0 10px rgba(129,140,248,.9); }
.sidebar-footer { padding: 13px 14px; border-top: 1px solid var(--sidebar-border); background: rgba(0,0,0,.08); }
.sidebar-user { min-width: 0; display: flex; align-items: center; gap: 10px; }
.sidebar-user-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.sidebar-user-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.sidebar-user-copy small { color: #7f90ac; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-user-menu { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; color: #9baac1; background: transparent; }
.sidebar-user-menu:hover { color: #fff; background: rgba(255,255,255,.08); }
.user-avatar { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: #3730a3; background: linear-gradient(145deg,#eef2ff,#e0e7ff); font-size: 12px; font-weight: 800; letter-spacing: .04em; box-shadow: inset 0 0 0 1px rgba(79,70,229,.10); }
.user-avatar-sidebar { color: #eef2ff; background: rgba(99,102,241,.22); box-shadow: inset 0 0 0 1px rgba(165,180,252,.18); }

.main-area { width: calc(100% - var(--sidebar-width)); min-width: 0; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-height: 100vh; transition: margin-left var(--transition), width var(--transition); }
.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 11px 24px;
    background: rgba(255,255,255,.88);
    border-bottom: 1px solid rgba(222,228,239,.9);
    box-shadow: 0 5px 20px rgba(17,24,39,.035);
    backdrop-filter: blur(15px);
}
.topbar-left, .topbar-actions { min-width: 0; display: flex; align-items: center; gap: 13px; }
.topbar-heading { min-width: 0; }
.page-kicker { display: flex; align-items: center; gap: 5px; margin-bottom: 1px; color: #7b87a0; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.page-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: clamp(17px,2vw,21px); font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
.page-subtitle { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.topbar-icon-button { width: 42px; height: 42px; flex: 0 0 auto; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 12px; color: #4b5870; background: #fff; text-decoration: none; font-size: 18px; box-shadow: var(--shadow-xs); transition: var(--transition); }
.topbar-icon-button:hover { color: var(--primary); background: var(--primary-soft); border-color: #cfd5ff; transform: translateY(-1px); }
.topbar-status { align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #dfe5f0; border-radius: 999px; color: #536078; background: #fff; font-size: 11px; font-weight: 700; }
.status-indicator { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.11); }
.user-menu-button { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 4px 8px 4px 5px; border: 1px solid transparent; border-radius: 13px; background: transparent; color: var(--ink); transition: var(--transition); }
.user-menu-button:hover, .user-menu-button[aria-expanded="true"] { border-color: var(--border); background: #fff; box-shadow: var(--shadow-sm); }
.user-menu-copy { min-width: 0; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.user-menu-copy strong { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.user-menu-copy small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.account-dropdown { min-width: 245px; padding: 8px; border-radius: 15px; }
.account-dropdown .dropdown-header { display: flex; align-items: center; gap: 10px; padding: 9px; color: var(--ink); }
.account-dropdown .dropdown-header > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.account-dropdown .dropdown-header strong { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dropdown .dropdown-header small { color: var(--muted); font-size: 10px; }
.account-dropdown .dropdown-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.account-dropdown .dropdown-item i { width: 18px; color: #7b87a0; }
.content-area { flex: 1; width: 100%; max-width: 1800px; margin: 0 auto; padding: 24px 26px 34px; }
.app-footer { min-height: 48px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 26px; color: #8b96a9; border-top: 1px solid var(--border); background: rgba(255,255,255,.55); font-size: 10px; }
.app-footer span { display: flex; align-items: center; gap: 5px; }
.sidebar-backdrop { display: none; }

/* Collapsed desktop navigation */
.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); }
.sidebar-collapsed .main-area { width: calc(100% - var(--sidebar-collapsed-width)); margin-left: var(--sidebar-collapsed-width); }
.sidebar-collapsed .brand { justify-content: center; padding-inline: 10px; }
.sidebar-collapsed .brand-copy,
.sidebar-collapsed .context-copy,
.sidebar-collapsed .context-chevron,
.sidebar-collapsed .navigation-label,
.sidebar-collapsed .nav-text,
.sidebar-collapsed .nav-chevron,
.sidebar-collapsed .active-marker,
.sidebar-collapsed .sidebar-user-copy,
.sidebar-collapsed .sidebar-user-menu { display: none; }
.sidebar-collapsed .sidebar-context { justify-content: center; margin-inline: 12px; padding-inline: 7px; }
.sidebar-collapsed .sidebar-scroll { padding-inline: 11px; }
.sidebar-collapsed .sidebar-link { justify-content: center; padding-inline: 7px; }
.sidebar-collapsed .sidebar-submenu { padding-left: 0; }
.sidebar-collapsed .sidebar-parent[aria-expanded="true"] + .sidebar-submenu { display: none; }
.sidebar-collapsed .sidebar-footer { display: flex; justify-content: center; padding-inline: 8px; }

/* Page headings and modern containers */
.page-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-heading-row > div:first-child { min-width: 0; }
.page-eyebrow { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; color: var(--primary); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.page-heading { margin: 0; color: var(--ink); font-size: clamp(23px,3vw,31px); font-weight: 850; letter-spacing: -.035em; }
.page-description { max-width: 850px; margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.page-heading-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.page-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-xs); }
.page-toolbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-toolbar-title .toolbar-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); font-size: 18px; }
.page-toolbar-title h2 { margin: 0; font-size: 15px; font-weight: 800; }
.page-toolbar-title p { margin: 1px 0 0; color: var(--muted); font-size: 11px; }
.page-toolbar-actions { display: flex; align-items: center; gap: 8px; }

.modern-card, .card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.modern-card-header, .card-header {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 58px;
    padding: 13px 17px;
    color: var(--ink);
    background: linear-gradient(180deg,#fff,#fdfdff);
    border-bottom: 1px solid var(--border);
    font-weight: 750;
}
.modern-card-header h3 { margin: 0; font-size: 14px; font-weight: 800; }
.modern-card-header p { margin: 2px 0 0; color: var(--muted); font-size: 10.5px; font-weight: 500; }
.modern-card-body, .card-body { padding: 18px; }
.card-footer { padding: 12px 17px; background: var(--surface-alt); border-top: 1px solid var(--border); }
.card-heading-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; font-size: 17px; }
.icon-indigo { color: #4338ca; background: #eef2ff; }
.icon-cyan { color: #0e7490; background: #ecfeff; }
.icon-teal { color: #0f766e; background: #ecfdf5; }
.icon-amber { color: #b45309; background: #fff7ed; }
.icon-slate { color: #475569; background: #f1f5f9; }
.icon-danger { color: #b42318; background: #fff1f0; }
.icon-primary { color: #4338ca; background: #eef2ff; }
.icon-purple { color: #7c3aed; background: #f5f3ff; }
.icon-warning { color: #b45309; background: #fff7ed; }

/* Buttons and iconic actions */
.btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; padding: .48rem .85rem; font-size: 12.5px; font-weight: 750; box-shadow: none; transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { border-color: var(--primary); background: linear-gradient(145deg,#5b55e7,#4338ca); box-shadow: 0 7px 16px rgba(79,70,229,.20); }
.btn-primary:hover, .btn-primary:focus { border-color: #3730a3; background: linear-gradient(145deg,#4f46e5,#3730a3); box-shadow: 0 9px 20px rgba(79,70,229,.26); }
.btn-success { border-color: #16815d; background: linear-gradient(145deg,#1a936a,#137252); }
.btn-danger { border-color: #c0362c; background: linear-gradient(145deg,#d14a3f,#ad2f27); }
.btn-warning { border-color: #d49b36; color: #4d3511; background: #ffdc8d; }
.btn-light { border-color: var(--border); color: #4d596e; background: #fff; }
.btn-light:hover { border-color: #ccd4e2; color: var(--ink); background: #f8fafc; }
.btn-outline-primary { color: var(--primary); border-color: #cbd0ff; background: #fff; }
.btn-outline-primary:hover { color: #fff; border-color: var(--primary); background: var(--primary); }
.btn-outline-secondary, .btn-outline-dark { color: #59667c; border-color: var(--border-strong); background: #fff; }
.btn-outline-secondary:hover, .btn-outline-dark:hover { color: #fff; border-color: #526079; background: #526079; }
.btn-outline-danger { color: var(--danger); border-color: #f1c5c1; background: #fff; }
.btn-outline-danger:hover { color: #fff; border-color: var(--danger); background: var(--danger); }
.btn-soft-primary { color: var(--primary); border-color: #d9dcff; background: var(--primary-soft); }
.btn-soft-primary:hover { color: #fff; border-color: var(--primary); background: var(--primary); }
.btn-sm { min-height: 34px; padding: .36rem .67rem; border-radius: 9px; font-size: 11.5px; }
.btn-icon, .action-btn {
    width: 38px;
    height: 38px;
    min-height: 38px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border-radius: 10px;
    line-height: 1;
}
.btn-icon i, .action-btn i { margin: 0 !important; font-size: 14px; }
.action-cluster { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; }
.action-view, .action-open { color: #0e7490; border: 1px solid #b9e7ef; background: #ecfeff; }
.action-view:hover, .action-open:hover { color: #fff; border-color: #0891b2; background: #0891b2; }
.action-edit { color: var(--primary); border: 1px solid #d4d8ff; background: var(--primary-soft); }
.action-edit:hover { color: #fff; border-color: var(--primary); background: var(--primary); }
.action-delete { color: var(--danger); border: 1px solid #f2cbc7; background: var(--danger-soft); }
.action-delete:hover { color: #fff; border-color: var(--danger); background: var(--danger); }
.action-permission { color: #7c3aed; border: 1px solid #ddd0ff; background: var(--purple-soft); }
.action-permission:hover { color: #fff; border-color: #7c3aed; background: #7c3aed; }
.action-start { color: #137252; border: 1px solid #bae5d4; background: #ecfdf5; }
.action-start:hover { color: #fff; border-color: #16815d; background: #16815d; }
.action-pdf { color: #b42318; border: 1px solid #f2cbc7; background: #fff1f0; }
.action-pdf:hover { color: #fff; border-color: #b42318; background: #b42318; }
.action-warning { color: #9a6700; border: 1px solid #f0d69a; background: #fff8e8; }
.action-warning:hover { color: #fff; border-color: #b7791f; background: #b7791f; }

/* Forms */
.form-label { margin-bottom: .36rem; color: #46536a; font-size: 11px; font-weight: 800; }
.required::after { content: " *"; color: var(--danger); }
.form-control, .form-select {
    min-height: 42px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    color: var(--ink);
    background-color: #fff;
    font-size: 13px;
    box-shadow: inset 0 1px 1px rgba(16,24,40,.015);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
textarea.form-control { min-height: auto; }
.form-control::placeholder { color: #a0aabd; }
.form-control:hover, .form-select:hover { border-color: #bac4d5; }
.form-control:focus, .form-select:focus { border-color: #8b87ee; box-shadow: 0 0 0 .22rem rgba(79,70,229,.10); }
.form-control[readonly], .form-control:disabled, .form-select:disabled { color: #667085; background: #f7f8fb; }
.form-check-input { width: 1.05rem; height: 1.05rem; border-color: #bfc8d7; }
.form-check-input:checked { border-color: var(--primary); background-color: var(--primary); }
.form-check-input:focus { border-color: #8b87ee; box-shadow: 0 0 0 .2rem rgba(79,70,229,.12); }
.input-group-text { border-color: var(--border-strong); color: #667085; background: #f8fafc; font-size: 12px; }
.input-with-icon { position: relative; }
.input-with-icon > i { position: absolute; z-index: 2; left: 13px; top: 50%; transform: translateY(-50%); color: #8b96aa; font-size: 14px; pointer-events: none; }
.input-with-icon > .form-control, .input-with-icon > .form-select { padding-left: 38px; }
.input-with-action > .form-control { padding-right: 43px; }
.input-action { position: absolute; z-index: 3; right: 5px; top: 50%; width: 34px; height: 34px; transform: translateY(-50%); display: grid; place-items: center; border: 0; border-radius: 8px; color: #748097; background: transparent; }
.input-action:hover { color: var(--primary); background: var(--primary-soft); }
.form-hint, .form-text { display: flex; align-items: flex-start; gap: 5px; margin-top: 5px; color: var(--muted); font-size: 10.5px; }
.field-validation-error, .text-danger { font-size: 10.5px; }
.form-action-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.92); box-shadow: var(--shadow-sm); }
.form-action-note { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.form-action-buttons { display: flex; align-items: center; gap: 8px; }

/* Tables and data views */
.table-responsive { scrollbar-width: thin; scrollbar-color: #cdd5e1 transparent; }
.table { --bs-table-bg: transparent; margin: 0; vertical-align: middle; color: var(--ink-2); }
.table > :not(caption) > * > * { padding: .78rem .95rem; border-bottom-color: #edf0f5; }
.table thead th { padding-top: .7rem; padding-bottom: .7rem; color: #738097; background: #f8f9fc; border-bottom: 1px solid var(--border); font-size: 9.5px; font-weight: 850; text-transform: uppercase; letter-spacing: .075em; white-space: nowrap; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: #fafbff; }
.table tbody td { font-size: 12.5px; }
.table tbody td strong { color: var(--ink); }
.table code { white-space: nowrap; }
.table-action-cell { white-space: nowrap; text-align: right; }
.data-primary { display: flex; align-items: center; gap: 10px; }
.data-avatar { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: #4338ca; background: #eef2ff; font-weight: 800; }
.data-copy { min-width: 0; }
.data-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-copy small { display: block; color: var(--muted); }
.empty-state { display: grid; place-items: center; text-align: center; padding: 64px 20px; color: var(--muted); }
.empty-state > i { margin-bottom: 11px; color: #bac4d4; font-size: 52px; }
.empty-state h5 { color: var(--ink); font-weight: 800; }

/* Badges and status */
.badge { padding: .39rem .55rem; border-radius: 999px; font-size: 9.5px; font-weight: 800; letter-spacing: .015em; }
.text-bg-light { color: #59667c !important; border: 1px solid #e1e6ee; background: #f8fafc !important; }
.text-bg-success { color: #126247 !important; border: 1px solid #bee8d8; background: #eaf8f2 !important; }
.text-bg-danger { color: #a42c25 !important; border: 1px solid #f0c8c4; background: #fff1f0 !important; }
.text-bg-warning { color: #8b5a13 !important; border: 1px solid #efd69d; background: #fff8e8 !important; }
.text-bg-info { color: #0e6c83 !important; border: 1px solid #bde3ec; background: #ecfeff !important; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status-pill.status-success { color: #126247; background: #eaf8f2; }
.status-pill.status-warning { color: #8b5a13; background: #fff8e8; }
.status-pill.status-danger { color: #a42c25; background: #fff1f0; }
.status-pill.status-neutral { color: #59667c; background: #f1f4f8; }

/* Alerts, toast and modal */
.modern-alert { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border: 1px solid; border-radius: 13px; box-shadow: var(--shadow-xs); }
.modern-alert .alert-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; font-size: 16px; }
.modern-alert > div { display: flex; flex-direction: column; }
.modern-alert strong { font-size: 11px; }
.modern-alert span:not(.alert-icon) { font-size: 11px; }
.alert-success.modern-alert { color: #125d45; border-color: #c6eadb; background: #f1fbf7; }
.alert-success.modern-alert .alert-icon { color: #16815d; background: #ddf5ea; }
.alert-danger.modern-alert { color: #922d27; border-color: #f1ccc8; background: #fff6f5; }
.alert-danger.modern-alert .alert-icon { color: #c0362c; background: #ffe6e3; }
.app-toast { border: 0; border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.app-toast .toast-body { display: flex; align-items: flex-start; gap: 10px; padding: 13px; }
.app-toast .toast-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; }
.app-toast.toast-success .toast-icon { color: #16815d; background: #eaf8f2; }
.app-toast.toast-danger .toast-icon { color: #c0362c; background: #fff1f0; }
.app-toast.toast-warning .toast-icon { color: #b7791f; background: #fff8e8; }
.modal-content { border: 0; border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { padding: 15px 18px; border-bottom-color: var(--border); }
.modal-title { font-size: 15px; font-weight: 800; }
.modal-body { padding: 18px; }
.modal-footer { padding: 12px 18px; border-top-color: var(--border); background: #fafbfc; }

/* Dashboard */
.dashboard-welcome { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 22px 24px; border-radius: 20px; color: #fff; background: linear-gradient(125deg,#25235f,#4f46e5 58%,#0891b2); box-shadow: 0 18px 40px rgba(49,46,129,.20); }
.dashboard-welcome::after { content: ""; position: absolute; right: -70px; top: -100px; width: 270px; height: 270px; border: 50px solid rgba(255,255,255,.07); border-radius: 50%; }
.dashboard-welcome-copy { position: relative; z-index: 1; }
.dashboard-welcome-copy small { display: block; margin-bottom: 6px; color: #c7d2fe; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.dashboard-welcome h1 { margin: 0; font-size: 24px; font-weight: 850; letter-spacing: -.03em; }
.dashboard-welcome p { max-width: 680px; margin: 7px 0 0; color: rgba(255,255,255,.78); font-size: 12px; }
.dashboard-welcome-actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; }
.dashboard-welcome .btn-light { border-color: rgba(255,255,255,.35); color: #312e81; }
.stat-card { position: relative; min-height: 118px; display: flex; align-items: center; gap: 14px; padding: 17px; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -22px; bottom: -28px; width: 85px; height: 85px; border-radius: 50%; background: rgba(79,70,229,.045); }
.stat-icon { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; color: var(--primary); background: var(--primary-soft); font-size: 20px; }
.stat-card.stat-cyan .stat-icon { color: #0e7490; background: #ecfeff; }
.stat-card.stat-amber .stat-icon { color: #b45309; background: #fff7ed; }
.stat-card.stat-green .stat-icon { color: #137252; background: #ecfdf5; }
.stat-card.stat-purple .stat-icon { color: #7c3aed; background: #f5f3ff; }
.stat-copy { min-width: 0; }
.stat-value { color: var(--ink); font-size: 27px; font-weight: 850; letter-spacing: -.035em; line-height: 1.1; }
.stat-label { margin-top: 4px; color: var(--muted); font-size: 10.5px; font-weight: 700; }

/* OpenAI settings */
.integration-hero { position: relative; overflow: hidden; display: grid; grid-template-columns:auto minmax(260px,1fr) auto; align-items: center; gap: 17px; padding: 20px; border: 1px solid #d8dcff; border-radius: 20px; background: linear-gradient(125deg,#f8f8ff,#f0f4ff 55%,#ecfeff); box-shadow: var(--shadow-sm); }
.integration-hero::after { content:""; position:absolute; right:-50px; top:-80px; width:210px; height:210px; border-radius:50%; border:36px solid rgba(79,70,229,.05); }
.integration-hero-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; color: #fff; background: linear-gradient(145deg,#6d63ee,#4338ca); box-shadow: 0 12px 25px rgba(79,70,229,.25); font-size: 25px; }
.integration-hero-copy { position: relative; z-index: 1; }
.integration-hero-copy h2 { margin: 0; font-size: 18px; font-weight: 850; }
.integration-hero-copy p { max-width: 680px; margin: 5px 0 0; color: var(--muted); font-size: 11.5px; }
.integration-metrics { position: relative; z-index: 1; display: flex; align-items: stretch; gap: 7px; }
.integration-metric { min-width: 115px; display: flex; flex-direction: column; justify-content: center; padding: 10px 12px; border: 1px solid rgba(211,216,235,.9); border-radius: 12px; background: rgba(255,255,255,.72); }
.integration-metric span { color: var(--muted); font-size: 8.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.integration-metric strong { max-width: 155px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.settings-card-wide { grid-column: 1 / -1; }
.modern-switch { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.modern-switch > input { position: absolute; opacity: 0; pointer-events: none; }
.modern-switch-track { width: 42px; height: 23px; padding: 3px; display: flex; align-items: center; border-radius: 999px; background: #cbd3df; transition: var(--transition); }
.modern-switch-thumb { width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: transform var(--transition); }
.modern-switch input:checked + .modern-switch-track { background: var(--primary); }
.modern-switch input:checked + .modern-switch-track .modern-switch-thumb { transform: translateX(19px); }
.modern-switch-label { color: var(--ink-2); font-size: 10.5px; font-weight: 800; }
.credential-badge { display: inline-flex; align-items: center; gap: 5px; color: #126247; font-size: 9.5px; font-weight: 800; }
.feature-toggle-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.feature-toggle-card { min-height: 76px; display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: #fff; cursor: pointer; transition: var(--transition); }
.feature-toggle-card:hover { border-color: #cdd2ff; background: #fcfcff; transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.feature-icon { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; font-size: 17px; }
.feature-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.feature-copy strong { color: var(--ink); font-size: 11.5px; }
.feature-copy small { margin-top: 2px; color: var(--muted); font-size: 9.5px; }
.feature-toggle-card .form-check-input { margin: 0; flex: 0 0 auto; }
.privacy-option { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid #f0d8a5; border-radius: 14px; background: #fffaf0; cursor: pointer; }
.privacy-option-icon { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 12px; color: #9a6700; background: #fff1c9; font-size: 17px; }
.privacy-option > span:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.privacy-option strong { font-size: 11.5px; }
.privacy-option small { margin-top: 2px; color: #7e6942; font-size: 9.5px; }
.security-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid #dce5ef; border-radius: 13px; background: #f8fafc; }
.security-note > i { color: #475569; font-size: 17px; }
.security-note > div { display: flex; flex-direction: column; }
.security-note strong { font-size: 10.5px; }
.security-note span { color: var(--muted); font-size: 9.5px; }
.connection-health { display: flex; align-items: flex-start; gap: 11px; padding: 13px; border: 1px solid; border-radius: 14px; }
.connection-health-icon { width: 37px; height: 37px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; font-size: 17px; }
.connection-health > div { min-width: 0; display: flex; flex-direction: column; }
.connection-health strong { font-size: 11.5px; }
.connection-health span { margin-top: 2px; color: inherit; opacity: .78; font-size: 9.5px; overflow-wrap: anywhere; }
.connection-health.status-success { color: #126247; border-color: #c5e8da; background: #f2fbf7; }
.connection-health.status-success .connection-health-icon { background: #ddf5ea; }
.connection-health.status-danger { color: #9a3029; border-color: #f1cbc7; background: #fff6f5; }
.connection-health.status-danger .connection-health-icon { background: #ffe6e3; }
.connection-health.status-neutral { color: #59667c; border-color: #dfe5ee; background: #f8fafc; }
.connection-health.status-neutral .connection-health-icon { background: #edf1f6; }
.settings-audit { display: grid; gap: 7px; }
.settings-audit > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 7px; border-bottom: 1px dashed #e6eaf0; }
.settings-audit > div:last-child { border-bottom: 0; }
.settings-audit dt { color: var(--muted); font-size: 9.5px; font-weight: 700; }
.settings-audit dd { margin: 0; color: var(--ink-2); font-size: 9.5px; font-weight: 750; text-align: right; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid #f0c7c3; border-radius: 15px; background: #fff8f7; }
.danger-zone > div { display: flex; flex-direction: column; }
.danger-zone strong { display: flex; align-items: center; gap: 6px; color: #a42c25; font-size: 11.5px; }
.danger-zone span { margin-top: 3px; color: #8b625f; font-size: 9.5px; }

/* Login */
.login-shell { position: relative; min-height: 100vh; display: grid; place-items: center; overflow: hidden; padding: 28px; background: radial-gradient(circle at 15% 15%,rgba(99,102,241,.16),transparent 32%), radial-gradient(circle at 85% 80%,rgba(6,182,212,.14),transparent 30%), #f6f7fb; }
.login-shell::before { content:""; position:absolute; inset:0; opacity:.3; background-image: linear-gradient(rgba(79,70,229,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(79,70,229,.05) 1px,transparent 1px); background-size:32px 32px; mask-image: linear-gradient(to bottom,black,transparent); }
.login-card { position: relative; z-index: 1; width: min(440px,100%); padding: 31px; border: 1px solid rgba(224,228,238,.92); border-radius: 24px; background: rgba(255,255,255,.94); box-shadow: 0 28px 75px rgba(30,41,59,.16); backdrop-filter: blur(15px); }
.login-logo { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 19px; border-radius: 17px; color:#fff; background: linear-gradient(145deg,#6366f1,#0891b2); box-shadow: 0 12px 25px rgba(79,70,229,.28); font-size: 24px; }
.login-card h1 { margin:0; font-size:25px; font-weight:850; letter-spacing:-.035em; }
.login-card .login-subtitle { margin:7px 0 22px; color:var(--muted); font-size:12px; }
.login-security { display:flex; align-items:center; gap:7px; margin-top:18px; color:#738097; font-size:9.5px; }

/* Consultation and clinical components */
.patient-header { position: sticky; top: calc(var(--topbar-height) + 10px); z-index: 1015; margin-bottom: 14px; padding: 15px 17px; border: 1px solid var(--border); border-radius: 17px; background: rgba(255,255,255,.97); box-shadow: 0 9px 28px rgba(26,35,54,.08); backdrop-filter: blur(12px); }
.allergy-banner { display: flex; align-items: center; gap: 7px; padding: 9px 11px; border: 1px solid #f1c5c1; border-radius: 10px; color: #a42c25; background: #fff4f3; font-size: 11px; font-weight: 750; }
.consult-grid { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 16px; }
.sticky-tools { position: sticky; top: calc(var(--topbar-height) + 20px); align-self: start; }
.ai-panel { border-color: #d8d7ff; background: linear-gradient(145deg,#fbfbff,#f5f3ff); }
.ai-disclaimer { padding: 10px; border: 1px solid #eadfb0; border-radius: 11px; color: #6f5b2f; background: #fffbeb; font-size: 10px; }
.status-dot { width: 9px; height: 9px; display: inline-block; border-radius: 50%; }
.status-draft { background: #f59e0b; }
.status-final { background: #16a34a; }
.section-title { margin: 0; font-size: 14px; font-weight: 850; }
.dynamic-field { padding-left: 12px; border-left: 3px solid #d7deea; }
.medicine-row { margin-bottom: 8px; padding: 11px; border: 1px solid var(--border); border-radius: 11px; background:#fff; }
.text-prewrap { white-space: pre-wrap; }
.document-preview { width: 100%; height: 72vh; border: 1px solid var(--border); border-radius: 12px; }
.workflow-card { border-color: #bfe7d7; }
.workflow-card .card-header { background: #f1fbf7; }

/* Print/verification */
.print-sheet { max-width: 850px; margin: auto; padding: 34px; background: #fff; box-shadow: var(--shadow-md); }
.verification-ok { max-width: 760px; margin: 50px auto; }
.doctor-signature { max-width: 160px; max-height: 70px; }
.verification-icon { font-size: 64px; }
.verified-clinical-summary { padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.prescription-section-title { margin-bottom: 9px; padding-bottom: 6px; border-bottom: 1px solid var(--border); color: #263f56; font-weight: 800; }
.prescription-field-list { display: grid; gap: 4px; }
.prescription-field-row { display: grid; grid-template-columns: minmax(150px,31%) minmax(0,1fr); gap: 14px; padding: 5px 0; border-bottom: 1px dashed #e7edf3; }
.prescription-field-row:last-child { border-bottom: 0; }
.prescription-field-label { color: #425a70; font-weight: 700; }
.prescription-field-value { min-width: 0; }

/* Metadata-driven prescription engine */
.speciality-template-info { padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; background: #f8fafc; }
.speciality-template-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: #0f766e; background: #e6fffb; font-size: 18px; }
.speciality-section-card { border-top-width: 3px; }
.speciality-section-card .card-header { background: #fbfdff; }
.metadata-consult-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(315px,370px); gap: 16px; align-items: start; }
.metadata-main-column, .metadata-sidebar { min-width: 0; }
.metadata-section-card, .metadata-system-card { overflow: hidden; }
.metadata-section-card { border-top: 3px solid var(--teal); }
.metadata-section-card .card-header, .metadata-system-card .card-header { min-height: 48px; }
.metadata-field-column { padding-left: 14px; border-left: 3px solid #dde3ed; }
.metadata-field-column.ai-suggested-field, .metadata-control-wrapper.ai-suggested-field { padding: 8px; border-left-color: #7c3aed; border-radius: 8px; background: #f5f3ff; }
.metadata-subheading { padding: 4px 0 8px; border-bottom: 1px solid var(--border); color: #31475d; font-weight: 800; }
.metadata-control-wrapper[data-rule-visible="false"] { display: none; }
.metadata-radio-group { min-height: 40px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.section-description { padding-left: 10px; border-left: 3px solid #94a3b8; color: var(--muted); font-size: 11px; }
.metadata-repeater table { min-width: 760px; }
.metadata-repeater th { vertical-align: middle; }
.metadata-repeater td { min-width: 150px; }
.metadata-repeater .metadata-control-wrapper { min-width: 140px; }
.metadata-repeater .form-control, .metadata-repeater .form-select { min-height: 36px; }
.repeater-action-column { width: 44px; }
.metadata-system-host.d-none { display: none !important; }
.template-designer-canvas { max-width: 1500px; }
.designer-section-card { border-left: 4px solid #5b7cfa; }
.designer-drag-handle { color: #94a3b8; }
.system-component-preview { background: #f8fafc; }
.font-monospace { font-size: 12px; }
.prescription-repeater-table th, .prescription-repeater-table td { font-size: 12px; }
.prescription-repeater-table thead th { white-space: normal; }
.range-value { min-width: 48px; }
.metadata-patient-header { border-top: 3px solid var(--teal); }

/* Speciality identity colours */
.speciality-section-card.speciality-cardiology,.metadata-section-card.speciality-cardiology,.metadata-patient-header.speciality-cardiology{border-top-color:#dc3545}
.speciality-section-card.speciality-gynae-obs,.metadata-section-card.speciality-gynae-obs,.metadata-patient-header.speciality-gynae-obs{border-top-color:#d63384}
.speciality-section-card.speciality-paediatrics,.metadata-section-card.speciality-paediatrics,.metadata-patient-header.speciality-paediatrics{border-top-color:#0dcaf0}
.speciality-section-card.speciality-orthopaedics,.metadata-section-card.speciality-orthopaedics,.metadata-patient-header.speciality-orthopaedics{border-top-color:#6f42c1}
.speciality-section-card.speciality-ophthalmology,.metadata-section-card.speciality-ophthalmology,.metadata-patient-header.speciality-ophthalmology{border-top-color:#0d6efd}
.speciality-section-card.speciality-dermatology,.metadata-section-card.speciality-dermatology,.metadata-patient-header.speciality-dermatology{border-top-color:#fd7e14}
.speciality-section-card.speciality-ent,.metadata-section-card.speciality-ent,.metadata-patient-header.speciality-ent{border-top-color:#20c997}
.speciality-section-card.speciality-dental,.metadata-section-card.speciality-dental,.metadata-patient-header.speciality-dental{border-top-color:#6c757d}
.speciality-section-card.speciality-general-medicine,.metadata-section-card.speciality-general-medicine,.metadata-patient-header.speciality-general-medicine{border-top-color:#0f766e}
.patient-header.speciality-cardiology .speciality-template-icon{color:#b42318;background:#fff1f2}
.patient-header.speciality-gynae-obs .speciality-template-icon{color:#b02a6f;background:#fff0f6}

/* Responsive */
@media (max-width: 1180px) {
    .metadata-consult-grid, .consult-grid { grid-template-columns: 1fr; }
    .metadata-sidebar, .sticky-tools { position: static; }
    .integration-hero { grid-template-columns: auto 1fr; }
    .integration-metrics { grid-column: 1 / -1; }
}
@media (max-width: 992px) {
    .sidebar { width: var(--sidebar-width); transform: translateX(-102%); }
    .sidebar.mobile-open { transform: translateX(0); box-shadow: 20px 0 60px rgba(5,12,25,.35); }
    .main-area, .sidebar-collapsed .main-area { width: 100%; margin-left: 0; }
    .sidebar-collapsed .sidebar { width: var(--sidebar-width); }
    .sidebar-collapsed .brand-copy, .sidebar-collapsed .context-copy, .sidebar-collapsed .context-chevron, .sidebar-collapsed .navigation-label, .sidebar-collapsed .nav-text, .sidebar-collapsed .nav-chevron, .sidebar-collapsed .active-marker, .sidebar-collapsed .sidebar-user-copy, .sidebar-collapsed .sidebar-user-menu { display: initial; }
    .sidebar-collapsed .brand { justify-content: flex-start; padding-inline: 18px; }
    .sidebar-collapsed .sidebar-context { justify-content: flex-start; margin-inline: 14px; padding-inline: 12px; }
    .sidebar-collapsed .sidebar-scroll { padding-inline: 12px; }
    .sidebar-collapsed .sidebar-link { justify-content: flex-start; padding-inline: 12px; }
    .sidebar-collapsed .sidebar-submenu { padding-left: 12px; }
    .sidebar-collapsed .sidebar-parent[aria-expanded="true"] + .sidebar-submenu { display: block; }
    .sidebar-collapsed .sidebar-footer { display: block; padding-inline: 14px; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 1040; display: block; visibility: hidden; opacity: 0; background: rgba(8,15,28,.54); backdrop-filter: blur(2px); transition: var(--transition); }
    .sidebar-backdrop.show { visibility: visible; opacity: 1; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-card-wide { grid-column: auto; }
}
@media (max-width: 768px) {
    :root { --topbar-height: 72px; }
    .topbar { padding-inline: 12px; }
    .topbar-actions { gap: 6px; }
    .page-subtitle, .page-kicker { display: none; }
    .content-area { padding: 15px 12px 26px; }
    .page-heading-row { flex-direction: column; }
    .page-heading-actions { width: 100%; }
    .page-heading-actions .btn { flex: 1; }
    .page-toolbar { align-items: stretch; flex-direction: column; }
    .page-toolbar-actions { flex-wrap: wrap; }
    .integration-hero { grid-template-columns: 1fr; }
    .integration-hero-icon { width: 48px; height: 48px; }
    .integration-metrics { overflow-x: auto; }
    .integration-metric { min-width: 130px; }
    .feature-toggle-grid { grid-template-columns: 1fr; }
    .modern-card-header { align-items: flex-start; flex-wrap: wrap; }
    .modern-card-header .ms-auto { width: 100%; margin-left: 0 !important; }
    .form-action-bar, .danger-zone { align-items: stretch; flex-direction: column; }
    .form-action-buttons { width: 100%; }
    .form-action-buttons .btn, .danger-zone .btn { flex: 1; }
    .dashboard-welcome { align-items: flex-start; flex-direction: column; }
    .dashboard-welcome-actions { width: 100%; }
    .dashboard-welcome-actions .btn { flex: 1; }
    .patient-header { top: calc(var(--topbar-height) + 4px); }
    .prescription-field-row { grid-template-columns: 1fr; gap: 2px; }
    .metadata-field-column { padding-left: calc(var(--bs-gutter-x) * .5); border-left: 0; }
    .metadata-repeater table { min-width: 680px; }
    .app-footer { flex-direction: column; justify-content: center; }
}
@media (max-width: 480px) {
    .login-shell { padding: 14px; }
    .login-card { padding: 23px 20px; border-radius: 20px; }
    .page-heading-actions .btn span { display: none; }
    .page-heading-actions .btn { flex: 0 0 42px; padding-inline: 0; }
}

/* Print */
@media print {
    .sidebar, .topbar, .app-footer, .no-print, .sidebar-backdrop { display: none !important; }
    .main-area { width: 100%; margin: 0; }
    .content-area { max-width: none; padding: 0; }
    .print-sheet { max-width: none; padding: 0; box-shadow: none; }
    .card, .modern-card { box-shadow: none; }
    .prescription-metadata-section { break-inside: avoid; }
    .prescription-field-row { grid-template-columns: 180px 1fr; }
    .prescription-repeater-table { break-inside: auto; }
    .prescription-repeater-table tr { break-inside: avoid; }
    .verified-clinical-summary { padding: 0; border: 0; }
    .doctor-signature { max-width: 140px; }
}
