/* V37: the legacy styles remain intact. Only the account's modern theme opts in. */
.modern-only { display:none; }
.appearance-legacy .modern-only { display:none!important; }
.detail-lab-overview { display:contents; }
.appearance-toolbar { display:flex; justify-content:flex-end; align-items:center; gap:16px; margin-bottom:20px; padding-right:60px; min-height:42px; }
.appearance-legacy .appearance-toolbar { display:none; }
.appearance-menu { display:none; margin:8px 16px; }
.appearance-legacy .appearance-menu { display:block; }
.sidebar .appearance-menu button { display:flex; align-items:center; gap:8px; width:100%; border:1px solid #ffffff40; border-radius:8px; background:transparent; color:#fff; padding:8px 10px; min-height:36px; font:500 13px/1.5 system-ui,sans-serif; text-align:left; }
.sidebar .appearance-menu button:hover { background:#ffffff18; }
.sidebar .appearance-menu button:focus-visible { outline:2px solid #fff; outline-offset:3px; }
.sidebar .appearance-menu button:disabled { opacity:.55; cursor:wait; }
.appearance-menu-error { color:#fff; font-size:12px; line-height:1.5; margin:8px 0 0; }
.appearance-legacy .appearance-status:not(.text-danger) { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.appearance-switch { margin:0; flex-shrink:0; }
.appearance-switch>div { display:flex; padding:4px; border:1px solid #d7dde5; border-radius:12px; background:#eef1f5; gap:3px; }
.appearance-switch button { border:0; border-radius:8px; background:transparent; padding:8px 12px; font:600 13px/1.4 system-ui,sans-serif; color:#516075; min-height:36px; }
.appearance-switch button[aria-pressed="true"] { color:#8d243d; background:#fff; box-shadow:0 1px 4px #14213c14; }
.appearance-switch button:focus-visible { outline:3px solid #af6e83; outline-offset:2px; }
.appearance-switch button:disabled { opacity:.55; cursor:wait; }
.appearance-status { margin:-8px 0 18px; color:#526276; font-size:13px; }
.appearance-user-setting .btn { white-space:nowrap; }
@media screen {
    body.appearance-modern { --primary-color:#922c46; --app-ink:#223247; --app-muted:#64748b; --app-line:#e1e7ee; --app-accent:#922c46; background:#f3f5f8; color:var(--app-ink); font-family:Inter,'Segoe UI',system-ui,sans-serif; line-height:1.6; }
    .appearance-modern .modern-only { display:block; }
    .appearance-modern .appearance-toolbar { justify-content:space-between; padding-bottom:18px; margin-bottom:26px; border-bottom:1px solid var(--app-line); }
    .appearance-modern .workspace-label { font-size:12px; color:var(--app-muted); letter-spacing:.15px; }
    .appearance-modern .workspace-label span { display:block; font-size:13px; letter-spacing:2px; color:#26354b; font-weight:800; }
    .appearance-modern .sidebar { background:#18273d; }
    .appearance-modern .sidebar .nav-link { color:#c9d4e5; border-radius:10px; font-size:14px; font-weight:500; transition:background .15s,color .15s; }
    .appearance-modern .sidebar .nav-link:hover { background:#233750; color:#fff; }
    .appearance-modern .sidebar .nav-link.active { background:#33465e; color:#fff; box-shadow:inset 3px 0 #efadc0; }
    .appearance-modern .sidebar .text-white-50 { color:#b3c1d4!important; }
    .appearance-modern .app-brand { display:flex; align-items:center; gap:12px; text-align:left!important; }
    .appearance-modern .app-brand-mark { display:grid; place-items:center; flex-shrink:0; width:43px; height:43px; background:#a33b55; border-radius:13px; color:#fff; font-size:17px; font-weight:750; letter-spacing:-1px; }
    .appearance-modern .app-brand h4 { font-size:14px; font-weight:650; line-height:1.55; margin:0; }
    .appearance-modern .app-brand h4>i { display:none; }
    .appearance-modern .main-content { min-width:0; }
    .appearance-modern .main-content h2 { color:#223247; font-size:27px; font-weight:750; letter-spacing:-.7px; line-height:1.35; }
    .appearance-modern .main-content h3 { font-size:23px; font-weight:700; }
    .appearance-modern .main-content h4 { font-size:20px; font-weight:700; }
    .appearance-modern .main-content h5 { font-size:16px; font-weight:700; line-height:1.5; }
    .appearance-modern .main-content h2>.bi { color:#9c4058; margin-right:6px; font-size:.85em; }
    .appearance-modern .main-content>.d-flex.justify-content-between { flex-wrap:wrap; gap:14px; }
    .appearance-modern .main-content .text-muted { color:#657389!important; }
    .appearance-modern .main-content .card { border:1px solid var(--app-line); border-radius:16px; box-shadow:0 3px 14px #1b2c4405; overflow:visible; }
    .appearance-modern .main-content .card-header { padding:17px 22px; background:#fff; border-bottom:1px solid var(--app-line); border-radius:15px 15px 0 0; }
    .appearance-modern .main-content .card-header.bg-primary { background:#fff!important; color:var(--app-ink)!important; border-top:3px solid #a24059; }
    .appearance-modern .main-content .card-body { padding:22px; }
    .appearance-modern .main-content .card-footer { border-color:var(--app-line); border-radius:0 0 15px 15px; background:#f9fafc; }
    .appearance-modern .btn { --bs-btn-border-radius:9px; font-size:14px; font-weight:600; line-height:1.5; padding:9px 14px; transition:background-color .12s,border-color .12s; }
    .appearance-modern .btn-sm { font-size:12px; padding:6px 10px; }
    .appearance-modern .btn-primary { --bs-btn-bg:#922c46; --bs-btn-border-color:#922c46; --bs-btn-hover-bg:#742036; --bs-btn-hover-border-color:#742036; --bs-btn-active-bg:#742036; --bs-btn-active-border-color:#742036; background:#922c46; border-color:#922c46; }
    .appearance-modern .btn-primary:hover { background:#742036; border-color:#742036; }
    .appearance-modern .btn-outline-primary { --bs-btn-color:#8e2842; --bs-btn-border-color:#d5a5b2; --bs-btn-hover-bg:#922c46; --bs-btn-hover-border-color:#922c46; --bs-btn-active-bg:#742036; --bs-btn-active-border-color:#742036; }
    .appearance-modern .btn-secondary { --bs-btn-bg:#edf1f6; --bs-btn-border-color:#dce3ec; --bs-btn-color:#3a4a60; --bs-btn-hover-bg:#e1e7ef; --bs-btn-hover-color:#253448; --bs-btn-hover-border-color:#c5cfde; }
    .appearance-modern .btn-outline-secondary { --bs-btn-color:#526278; --bs-btn-border-color:#cdd6e2; --bs-btn-hover-bg:#526278; --bs-btn-hover-border-color:#526278; }
    .appearance-modern .badge { padding:6px 9px; border-radius:7px; font-size:11px; font-weight:650; line-height:1.4; }
    .appearance-modern .badge.bg-success { background:#e5f5ed!important; color:#19613d; }
    .appearance-modern .badge.bg-warning { background:#fff3d7!important; color:#785508!important; }
    .appearance-modern .badge.bg-info { background:#e3f1fc!important; color:#1f597e; }
    .appearance-modern .badge.bg-secondary { background:#ecf0f5!important; color:#506078; }
    .appearance-modern .badge.bg-danger { background:#fce8ec!important; color:#942d47; }
    .appearance-modern .form-label { color:#43536a; font-size:13px; font-weight:650; margin-bottom:7px; }
    .appearance-modern .form-control,.appearance-modern .form-select { border-color:#d4dde8; border-radius:9px; min-height:42px; font-size:14px; color:#24364b; background-color:#fff; }
    .appearance-modern .form-control:focus,.appearance-modern .form-select:focus { border-color:#b67689; box-shadow:0 0 0 3px #a6486215; }
    .appearance-modern .form-control:disabled { background:#f0f3f7; color:#58677b; }
    .appearance-modern .form-text { color:#66758a; font-size:12px; line-height:1.6; }
    .appearance-modern textarea.form-control { line-height:1.7; }
    .appearance-modern .input-group>.form-control { min-width:0; }
    .appearance-modern .main-content .table { --bs-table-color:#35465b; --bs-table-hover-bg:#f7f9fc; --bs-table-border-color:#e8edf3; font-size:13px; vertical-align:middle; }
    .appearance-modern .main-content .table>thead>tr>th { background:#f5f7fa; color:#5b6a80; padding:13px 12px; font-size:11px; font-weight:750; letter-spacing:.3px; white-space:nowrap; }
    .appearance-modern .table th>a { color:inherit; text-decoration:none; }
    .appearance-modern .main-content .table:not(.kayit-listesi-table)>tbody>tr>td { padding:13px 12px; }
    .appearance-modern .page-link { color:#8e2842; border-color:#dce3ed; background:#fff; border-radius:8px; margin:0 3px; font-size:13px; padding:8px 13px; }
    .appearance-modern .page-item.active .page-link { background:#922c46; border-color:#922c46; color:#fff; }
    .appearance-modern .page-item.disabled .page-link { background:#f3f5f8; color:#7a8799; }
    .appearance-modern .alert { border-radius:12px; font-size:14px; border-width:1px; }
    .appearance-modern .nav-tabs { gap:6px; border-bottom:1px solid var(--app-line); padding-bottom:8px; }
    .appearance-modern .nav-tabs .nav-link { border:0; border-radius:9px; color:#5a6a80; font-size:14px; font-weight:600; padding:10px 16px; }
    .appearance-modern .nav-tabs .nav-link:hover { background:#e9edf3; }
    .appearance-modern .nav-tabs .nav-link.active { background:#922c46; color:#fff; }
    .appearance-modern .modal-content { border:1px solid var(--app-line); border-radius:18px; box-shadow:0 20px 70px #18273d20; }
    .appearance-modern .modal-header { padding:20px 24px; border-color:var(--app-line); border-radius:17px 17px 0 0; }
    .appearance-modern .modal-body { padding:24px; }
    .appearance-modern .modal-footer { padding:16px 24px; background:#f7f9fb; border-color:var(--app-line); border-radius:0 0 17px 17px; }
    .appearance-modern .modal-title { font-size:18px; font-weight:700; }
    .appearance-modern .notification-bell { background:#fff; color:#627086; border:1px solid #dde4ed; box-shadow:0 2px 8px #18273d08; border-radius:12px; }
    .appearance-modern .message-launcher { display:none; }
    .appearance-modern .record-user-actions .btn-group { display:grid; grid-template-columns:repeat(2,max-content); gap:6px; }
    .appearance-modern .record-user-actions .btn-group>.btn,.appearance-modern .record-user-actions .btn-group>form>.btn { width:100%; margin:0; border-radius:8px!important; white-space:nowrap; }
    .appearance-modern .record-detail-page { font-family:inherit; }
    .appearance-modern .detail-heading { align-items:flex-start!important; gap:20px!important; }
    .appearance-modern .detail-title { flex:1 0 100%; }
    .appearance-modern .detail-eyebrow { font-size:11px; color:#986077; font-weight:750; letter-spacing:1.7px; margin-bottom:7px; }
    .appearance-modern .detail-heading h2 { font-size:30px; }
    .appearance-modern .record-detail-actions { padding:14px; background:#fff; border:1px solid var(--app-line); border-radius:13px; width:100%; }
    .appearance-modern .record-detail-actions .mobile-quick-search { flex:1; min-width:180px!important; }
    .appearance-modern .detail-meta { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:22px 30px; }
    .appearance-modern .detail-meta>.row { display:contents; }
    .appearance-modern .detail-meta>.row>div { width:auto; padding:0; font-size:15px; }
    .appearance-modern .detail-meta strong { display:block; color:#728096; font-size:11px; font-weight:600; margin-bottom:6px; }
    .appearance-modern .detail-meta .btn { padding:3px 8px; }
    .appearance-modern #info>.card { border:0; background:transparent; box-shadow:none; }
    .appearance-modern .main-content .detail-info-grid { display:grid; grid-template-columns:minmax(240px,.8fr) minmax(0,1.3fr); gap:18px; align-items:start; padding:0; }
    .appearance-modern .detail-info-grid>.detail-section { margin:0!important; border:1px solid var(--app-line); border-radius:15px; padding:22px; background:#fff; min-width:0; }
    .appearance-modern .detail-section>.col-md-12 { padding:0; margin:0; }
    .appearance-modern .detail-section h5 { padding-bottom:12px; margin-bottom:14px; border-bottom:1px solid #edf0f5; display:flex; gap:9px; align-items:center; }
    .appearance-modern .detail-section h5::before { content:''; width:4px; height:17px; border-radius:3px; background:#aa4962; flex-shrink:0; }
    .appearance-modern .detail-lab-overview { display:grid; grid-column:2; gap:18px; min-width:0; }
    .appearance-modern .detail-region>span:not(.detail-region-separator) { display:block; margin-top:10px; }
    .appearance-modern .detail-region strong { display:block; color:#708097; font-size:11px; }
    .appearance-modern .detail-region-separator { display:none; }
    .appearance-modern .detail-sender h5 { margin-bottom:0; border:0; padding:0; }
    .appearance-modern .detail-sender p { padding-top:10px; margin-bottom:12px; font-size:14px; overflow-wrap:anywhere; }
    .appearance-modern .detail-sender p>strong { display:block; font-size:11px; font-weight:650; color:#708097; margin-bottom:3px; }
    .appearance-modern .detail-lab-overview>.detail-section { margin:0!important; border:1px solid var(--app-line); border-radius:15px; padding:22px; background:#fff; min-width:0; }
    .appearance-modern .detail-clinical,.appearance-modern .detail-autopsy,.appearance-modern .detail-methods,.appearance-modern .detail-results { grid-column:1/-1; }
    .appearance-modern .record-detail-page .rich-text-content { background:#f8fafc; border:1px solid #edf1f5; border-radius:10px; padding:16px; font-size:15px; line-height:1.8; overflow-x:auto; overflow-wrap:anywhere; }
    .appearance-modern .detail-section>div>p { overflow-wrap:anywhere; }
    .appearance-modern .form-section-heading { color:#34465f; padding:22px 0 14px; border-bottom:1px solid var(--app-line); margin-bottom:22px; }
    .appearance-modern .record-entry-form>.form-section-heading:first-child { padding-top:0; }
    .appearance-modern .form-section-heading span { color:#a34b64; background:#f7eaf0; font-size:11px; border-radius:8px; padding:6px 8px; margin-right:9px; }
    .appearance-modern .record-entry-form { max-width:1080px; margin:auto; }
    .appearance-modern .record-entry-form>.mb-3,.appearance-modern .record-entry-form>.row { margin-bottom:22px!important; }
    .appearance-modern .record-form-actions { position:sticky; bottom:12px; z-index:20; padding:14px 18px; background:#fff; border:1px solid var(--app-line); border-radius:12px; box-shadow:0 4px 24px #18273d0d; }
    .appearance-modern .ql-toolbar.ql-snow { border:1px solid #d4dde8; border-radius:10px 10px 0 0; background:#f8fafc; }
    .appearance-modern .ql-container.ql-snow { border-color:#d4dde8; border-radius:0 0 10px 10px; font-size:14px; background:#fff; }
    .appearance-modern .ql-editor { line-height:1.8; padding:16px; }
    .appearance-modern .report-toolbar { background:#fff; border:1px solid var(--app-line); border-radius:13px; padding:16px; box-shadow:0 2px 8px #18273d08; }
    .appearance-modern details { border-radius:9px; }
    .appearance-modern summary { cursor:pointer; color:#8d2b45; font-weight:600; }
    .appearance-modern .messenger { --chat-green:#8e2842; --chat-ink:#26364b; --chat-muted:#62758a; --chat-line:#e2e7ee; border-color:var(--app-line); }
    .appearance-modern .chat-welcome { background:#f5f7fa; }
    .appearance-modern .message-stage { background-color:#f3f5f8; background-image:none; }
    .appearance-modern .outgoing .message-bubble { background:#f8e8ee; }
    .appearance-modern .conversation.selected { background:#f7edf1; }
    .appearance-modern .records-card-view { min-width:0; }
    .appearance-modern.records-card-view .main-content .mobile-record-list-card { border:0; }
    .appearance-modern.records-card-view .mobile-record-list-card>.card-body { padding:0; }
    .appearance-modern.records-card-view .kayit-listesi-table>tbody>tr { border-color:#dfe5ee; border-radius:14px; box-shadow:0 3px 12px #18273d04; }
    .appearance-modern.records-card-view .record-lab-no-text { color:#8e2842; }
    .appearance-modern.records-card-view .mobile-record-status .badge { border-radius:6px; }
    .appearance-modern.records-card-view .islemler-cell .btn-group>.btn:first-child { background:#f8edf1; border-color:#ecd4dd; color:#8e2842; }
    .appearance-modern.records-card-view .mobile-record-summary { color:#69788d; }
    .appearance-modern.login-page { background:#edf1f6; }
    .appearance-modern.login-page .login-card { border:1px solid #dfe5ef; border-radius:22px; box-shadow:0 20px 70px #23375112; }
    .appearance-modern.login-page .card-body { padding:36px!important; }
    .appearance-modern.login-page h3 { font-size:23px; color:#223247; font-weight:750; }
    .appearance-modern.login-page .btn { background:#922c46; border-color:#922c46; }
    .appearance-modern :is(a,button,input,select,textarea,summary):focus-visible { outline:3px solid #ae607b; outline-offset:3px; }
}
@media screen and (min-width:768px) {
    .appearance-modern .container-fluid>.row { align-items:flex-start; }
    .appearance-modern .sidebar { position:sticky; top:0; align-self:flex-start; width:216px; flex:0 0 216px; height:100vh; height:100dvh; min-height:0; overflow-y:auto; padding:30px 12px 24px; }
    .appearance-modern .sidebar .nav-link { margin:3px 0; padding:11px 14px; }
    .appearance-modern .sidebar .nav-link i { margin-right:8px; }
    .appearance-modern .sidebar .nav form .nav-link { width:100%!important; margin:3px 0!important; padding:11px 14px!important; }
    .appearance-modern .app-brand { padding:0 10px; margin-bottom:32px!important; }
    body.appearance-modern[data-user-authenticated] .main-content { width:calc(100% - 216px); flex:1 1 0; padding:24px 30px 60px; }
    .appearance-modern .notification-corner { top:24px; right:30px; }
    .appearance-modern .notification-bell { width:44px; height:44px; }
    .appearance-modern .messenger { height:calc(100dvh - 152px); min-height:440px; }
}
@media screen and (min-width:768px) and (max-width:1100px) {
    .appearance-modern .sidebar { width:185px; flex-basis:185px; padding:24px 9px; }
    body.appearance-modern[data-user-authenticated] .main-content { width:calc(100% - 185px); padding:20px 18px 50px; }
    .appearance-modern .sidebar .nav-link { padding:11px 9px; font-size:13px; }
    .appearance-modern .app-brand { gap:8px; padding:0 4px; }
    .appearance-modern .app-brand-mark { width:34px; height:38px; font-size:15px; }
    .appearance-modern .app-brand h4 { font-size:12px; }
    .appearance-modern .detail-info-grid { grid-template-columns:1fr!important; }
    .appearance-modern .detail-section,.appearance-modern .detail-lab-overview { grid-column:1!important; grid-row:auto; }
    .appearance-modern .detail-meta { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .appearance-modern .workspace-label { display:none; }
    .appearance-modern .appearance-toolbar { justify-content:flex-end; }
}
@media screen and (max-width:767.98px) {
    .appearance-menu { margin:6px 12px; }
    .sidebar .appearance-menu button { min-height:44px; font-size:14px; }
    .appearance-toolbar { padding:0; margin-bottom:18px; justify-content:flex-start; }
    .appearance-switch { width:100%; }
    .appearance-switch>div { width:100%; }
    .appearance-switch button { flex:1; min-height:40px; padding:8px; }
    table.mobile-cards-ready td.appearance-user-cell { grid-column:1/-1; }
    .appearance-user-setting .btn { width:100%; white-space:normal; }
    .appearance-modern .appearance-toolbar { padding-bottom:16px; margin-bottom:20px; }
    .appearance-modern .workspace-label { display:none; }
    .appearance-modern .sidebar { background:#18273d; }
    .appearance-modern .mobile-topbar { background:#fff; }
    .appearance-modern .mobile-brand-mark { background:#922c46; }
    .appearance-modern .mobile-bottom-nav [aria-current="page"],.appearance-modern .mobile-bottom-nav [aria-expanded="true"] { background:#f7eaf0; color:#8e2842; }
    .appearance-modern .main-content { padding:18px 14px calc(24px + var(--mobile-bottom) + env(safe-area-inset-bottom)); }
    .appearance-modern .main-content h2,.appearance-modern .detail-heading h2 { font-size:23px; }
    .appearance-modern .main-content .card-body { padding:16px; }
    .appearance-modern .main-content .card-header { padding:16px; }
    .appearance-modern .main-content .btn { min-height:44px; padding:9px 12px; }
    .appearance-modern .form-control,.appearance-modern .form-select { min-height:46px; font-size:16px; }
    .appearance-modern .main-content .detail-info-grid { padding:0; grid-template-columns:minmax(0,1fr); gap:14px; }
    .appearance-modern .detail-info-grid>.detail-section,.appearance-modern .detail-lab-overview>.detail-section { padding:16px; grid-column:1; grid-row:auto; }
    .appearance-modern .detail-lab-overview { grid-column:1; gap:14px; }
    .appearance-modern .record-detail-actions { padding:12px; }
    .appearance-modern .detail-meta { gap:16px; grid-template-columns:repeat(2,minmax(0,1fr)); }
    .appearance-modern .detail-meta>.row>div { font-size:14px; overflow-wrap:anywhere; }
    .appearance-modern .detail-meta .btn { margin:5px 0 0!important; }
    .appearance-modern .record-detail-page .rich-text-content { padding:13px; font-size:15px; }
    .appearance-modern .main-content .table.mobile-cards-ready>tbody>tr>td { padding:0; }
    .appearance-modern .main-content .table.mobile-cards-ready>tbody>tr { border-radius:14px; }
    .appearance-modern .record-form-actions { bottom:calc(78px + env(safe-area-inset-bottom)); padding:10px; }
    .appearance-modern .report-toolbar { position:static; }
    .appearance-modern .modal-body,.appearance-modern .modal-header,.appearance-modern .modal-footer { padding:16px; }
    .appearance-modern.messenger-page .appearance-toolbar { margin:0; padding:10px 14px; border:0; }
    .appearance-modern.messenger-page .messenger { height:calc(100dvh - 206px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height:280px; }
    .appearance-legacy.messenger-page .appearance-toolbar { margin:0; padding:10px 14px; }
    .appearance-legacy.messenger-page .messenger { height:calc(100dvh - var(--mobile-top) - var(--mobile-bottom) - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
    .appearance-modern.login-page .card-body { padding:28px 22px!important; }
}
@media print {
    .appearance-toolbar,.appearance-menu,.appearance-status,.modern-only { display:none!important; }
}
@media (prefers-reduced-motion:reduce) {
    .appearance-modern * { transition:none!important; scroll-behavior:auto!important; }
}
