/*
 * Dental CRM — pamja e panelit (pa build; ngarkohet nga AdminPanelProvider). Marrë nga CRM Reborn.
 * CSS pa @layer, ndaj mbizotëron mbi stilet e Filament-it.
 */

:root {
    --crm-bg: #e2e8f0;            /* slate-200: sfondi pas kartave */
    --crm-surface: #ffffff;
    --crm-border: #e4e4e7;
    --crm-muted: #a1a1aa;
    --crm-accent: #2563eb;        /* blue-600 */
    --crm-accent-soft: #eff6ff;   /* blue-50 */
    --crm-accent-soft-2: #dbeafe; /* blue-100 */
    --crm-accent-text: #1e40af;   /* blue-800 */
    --crm-card-shadow: 0 0 0 1px rgb(24 24 27 / 0.06), 0 1px 2px rgb(24 24 27 / 0.04), 0 10px 24px -14px rgb(24 24 27 / 0.18);
    --crm-card-shadow-hover: 0 0 0 1px rgb(37 99 235 / 0.2), 0 2px 4px rgb(24 24 27 / 0.05), 0 16px 32px -16px rgb(15 42 74 / 0.3);
}

html { font-size: 90%; }

/* ---------- Sfondi ---------- */
html:not(.dark) body.fi-body { background-color: var(--crm-bg); }

/* ---------- Shiriti i sipërm ---------- */
html:not(.dark) .fi-topbar {
    background: rgb(255 255 255 / 0.92);
    backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--crm-border);
    box-shadow: 0 1px 3px rgb(24 24 27 / 0.06);
}

/* ---------- Menuja anësore: blu marine me tekst të bardhë (në të dyja temat) ---------- */
.fi-sidebar {
    background: linear-gradient(180deg, #17365e 0%, #0f2a4a 55%, #0b1f38 100%);
    border-right: 1px solid rgb(255 255 255 / 0.06);
    box-shadow: 6px 0 28px -14px rgb(11 31 56 / 0.55);
}
html.dark .fi-sidebar { background: linear-gradient(180deg, #102844 0%, #0b1f38 60%, #081629 100%); }

.fi-sidebar-nav { padding-top: 1.25rem; }

.fi-sidebar-group-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #93c5fd;               /* blue-300 */
}
.fi-sidebar-group-collapse-btn,
.fi-sidebar-group-btn .fi-icon { color: #93c5fd; }

.fi-sidebar-item-label { font-size: 13px; color: #dbeafe; }   /* blue-100 */
.fi-sidebar-item-icon { color: #93c5fd; }
.fi-sidebar-item-grouped-border-part { background-color: rgb(255 255 255 / 0.18); }

.fi-sidebar-item-btn {
    border-radius: 10px;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.fi-sidebar-item:not(.fi-active) > .fi-sidebar-item-btn:hover { background-color: rgb(255 255 255 / 0.08); }
.fi-sidebar-item:not(.fi-active) > .fi-sidebar-item-btn:hover .fi-sidebar-item-label,
.fi-sidebar-item:not(.fi-active) > .fi-sidebar-item-btn:hover .fi-sidebar-item-icon { color: #ffffff; }

/* Elementi aktiv: sfond i bardhë i tejdukshëm + vijë e bardhë majtas */
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
    background: rgb(255 255 255 / 0.14);
    box-shadow: inset 3px 0 0 #ffffff, 0 4px 14px -6px rgb(0 0 0 / 0.35);
}
.fi-sidebar-item.fi-active .fi-sidebar-item-label { color: #ffffff; font-weight: 600; }
.fi-sidebar-item.fi-active .fi-sidebar-item-icon { color: #ffffff; }

/* Menuja e klinikës (tenant) në krye të menusë anësore */
.fi-sidebar .fi-tenant-menu-trigger { border-radius: 10px; transition: background-color 0.15s ease; }
.fi-sidebar .fi-tenant-menu-trigger:hover { background-color: rgb(255 255 255 / 0.08); }
.fi-sidebar .fi-tenant-menu-trigger-tenant-name { color: #ffffff; font-weight: 600; }
.fi-sidebar .fi-tenant-menu-trigger .fi-icon { color: #93c5fd; }
.fi-sidebar .fi-tenant-avatar { border-radius: 8px; box-shadow: 0 0 0 2px rgb(255 255 255 / 0.3); }

/* Lidhjet dhe listat brenda teksteve të gjeneruara (paralajmërimet, kartela) */
.dc-link { text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.dc-list { list-style: disc; padding-inline-start: 1.25rem; margin-top: 0.25rem; }

/* Shiriti i lëvizjes brenda menusë */
.fi-sidebar-nav { scrollbar-color: rgb(255 255 255 / 0.25) transparent; }

/* ---------- Titulli i faqes ---------- */
.fi-header-heading { font-weight: 700; letter-spacing: -0.02em; }
.fi-header-subheading { color: #71717a; }

/* ---------- Kartat: seksione, tabela, widget-e ---------- */
html:not(.dark) .fi-section:not(.fi-section-not-contained),
html:not(.dark) .fi-ta-ctn,
html:not(.dark) .fi-wi-stats-overview-stat {
    border-radius: 14px;
    box-shadow: var(--crm-card-shadow);
}
html.dark .fi-section:not(.fi-section-not-contained),
html.dark .fi-ta-ctn,
html.dark .fi-wi-stats-overview-stat {
    border-radius: 14px;
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.07), 0 10px 24px -14px rgb(0 0 0 / 0.6);
}

.fi-wi-stats-overview-stat { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.fi-wi-stats-overview-stat:hover { transform: translateY(-2px); }
html:not(.dark) .fi-wi-stats-overview-stat:hover { box-shadow: var(--crm-card-shadow-hover); }
.fi-wi-stats-overview-stat-value { letter-spacing: -0.02em; }

/* Koka e tabelave pak e theksuar */
html:not(.dark) .fi-ta-header-cell { background-color: #fafafa; }
.fi-ta-header-cell { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* Butonat kryesorë me pak hije */
html:not(.dark) .fi-btn.fi-color-primary:not(.fi-outlined) { box-shadow: 0 1px 2px rgb(15 42 74 / 0.25), 0 4px 10px -4px rgb(37 99 235 / 0.45); }

/* Tab-et e listave si "pills" */
html:not(.dark) .fi-tabs { background: var(--crm-surface); box-shadow: var(--crm-card-shadow); border-radius: 12px; }

/* ---------- Login / rivendosja e fjalëkalimit ---------- */
html:not(.dark) .fi-simple-layout { background: linear-gradient(135deg, #bfdbfe 0%, #dbeafe 45%, #cbd5e1 100%); }
html:not(.dark) .fi-simple-main { border-radius: 16px; box-shadow: 0 20px 45px -15px rgb(15 42 74 / 0.35); }

/* ---------- Odontogrami (resources/views/filament/patients/odontogram.blade.php) ---------- */
.dc-odo-card { background: #fff; border-radius: 14px; box-shadow: var(--crm-card-shadow); padding: 1rem 1.25rem 1.25rem; }
html.dark .dc-odo-card { background: rgb(24 24 27); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.07); }
.dc-odo-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; font-size: 0.75rem; color: #52525b; }
html.dark .dc-odo-legend, html.dark .dc-odo-hint { color: #a1a1aa; }
.dc-odo-chip { display: inline-flex; align-items: center; gap: 0.35rem; }
.dc-odo-chip i { width: 0.8rem; height: 0.8rem; border-radius: 3px; display: inline-block; border: 1px solid rgb(0 0 0 / 0.12); }
.dc-odo-chip i.is-x { background: linear-gradient(45deg, transparent 44%, #64748b 44% 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, #64748b 44% 56%, transparent 56%); }
.dc-odo-chip i.is-planned { border: 2px dashed #f59e0b; background: transparent; }
.dc-odo-hint { font-size: 0.75rem; color: #71717a; margin-top: 0.5rem; }
.dc-odo-chart { overflow-x: auto; padding: 0.75rem 0 0.25rem; }
.dc-odo-side { display: flex; justify-content: space-between; min-width: 600px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: #a1a1aa; padding: 0 0.25rem 0.25rem; }
.dc-odo-row { display: flex; justify-content: center; align-items: stretch; gap: 1px; min-width: 600px; }
.dc-odo-row.is-primary-row { margin: 0.35rem 0; }
.dc-odo-midline { width: 2px; background: #cbd5e1; margin: 0 6px; border-radius: 2px; }
.dc-odo-occlusal-line { height: 2px; background: #cbd5e1; margin: 0.6rem auto; min-width: 600px; border-radius: 2px; }
.dc-odo-tooth { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; width: clamp(36px, 3.3vw, 50px); padding: 4px 1px; border-radius: 10px; border: 2px solid transparent; background: transparent; cursor: pointer; transition: background-color 0.12s ease, border-color 0.12s ease; }
.dc-odo-tooth:hover, .dc-odo-tooth:focus-visible { background: #eff6ff; border-color: #bfdbfe; outline: none; }
html.dark .dc-odo-tooth:hover { background: rgb(37 99 235 / 0.15); border-color: rgb(37 99 235 / 0.4); }
.dc-odo-tooth.has-planned { border: 2px dashed #f59e0b; }
.dc-odo-tooth.is-primary { width: clamp(32px, 2.9vw, 44px); }
.dc-odo-tooth.is-primary .dc-odo-shape { width: 66%; }
.dc-odo-shape { width: 80%; height: auto; aspect-ratio: 40 / 92; overflow: visible; }
.dc-odo-surfaces { width: 60%; height: auto; aspect-ratio: 1; }
.dc-odo-surfaces path { stroke: #94a3b8; stroke-width: 1; }
.dc-odo-num { font-size: 0.72rem; font-weight: 600; color: #3f3f46; line-height: 1; }
html.dark .dc-odo-num { color: #d4d4d8; }
.dc-odo-root { fill: #ffffff; stroke: #475569; stroke-width: 1.2; }
.dc-odo-crown { stroke: #334155; stroke-width: 1.4; }
.dc-odo-crown.is-impacted { stroke-dasharray: 3 2; }
.dc-odo-canal { stroke: #7c3aed; stroke-width: 2.6; stroke-linecap: round; }
.dc-odo-lesion { fill: #dc2626; opacity: 0.85; }
.dc-odo-fracture { fill: none; stroke: #ea580c; stroke-width: 2.2; stroke-linejoin: round; }
.dc-odo-implant { fill: #94a3b8; stroke: #475569; stroke-width: 1.2; }
.dc-odo-thread { stroke: #475569; stroke-width: 1.2; }
.dc-odo-x { stroke: #64748b; stroke-width: 2.4; stroke-linecap: round; }
.dc-odo-tooth.is-missing .dc-odo-root, .dc-odo-tooth.is-missing .dc-odo-crown { opacity: 0.25; }
.dc-odo-planned-dot { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 999px; background: #f59e0b; }

/* ---------- Historiku i pacientit (resources/views/filament/patients/history.blade.php) ---------- */
.dc-tl { position: relative; display: flex; flex-direction: column; gap: 0.85rem; }
.dc-tl-item { display: grid; grid-template-columns: 5.5rem 2rem 1fr; gap: 0.6rem; align-items: start; position: relative; }
.dc-tl-item::before { content: ''; position: absolute; left: calc(5.5rem + 0.6rem + 1rem - 1px); top: 2rem; bottom: -0.85rem; width: 2px; background: #cbd5e1; }
.dc-tl-item:last-child::before { display: none; }
.dc-tl-date { text-align: right; padding-top: 0.35rem; line-height: 1.2; }
.dc-tl-day { display: block; font-size: 0.8rem; font-weight: 600; color: #3f3f46; }
.dc-tl-time { display: block; font-size: 0.72rem; color: #a1a1aa; }
html.dark .dc-tl-day { color: #e4e4e7; }
.dc-tl-dot { width: 2rem; height: 2rem; border-radius: 999px; display: flex; align-items: center; justify-content: center; background: #dbeafe; color: #1d4ed8; position: relative; z-index: 1; box-shadow: 0 0 0 3px #e2e8f0; }
.dc-tl-icon { width: 1.05rem; height: 1.05rem; }
.is-addendum .dc-tl-dot { background: #fef3c7; color: #b45309; }
.is-tooth .dc-tl-dot { background: #ede9fe; color: #6d28d9; }
.is-anamnesis .dc-tl-dot { background: #fee2e2; color: #b91c1c; }
.is-registered .dc-tl-dot { background: #dcfce7; color: #15803d; }
.dc-tl-card { background: #fff; border-radius: 12px; box-shadow: var(--crm-card-shadow); padding: 0.7rem 0.9rem; }
html.dark .dc-tl-card { background: rgb(24 24 27); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.07); }
.dc-tl-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.dc-tl-title { font-weight: 600; font-size: 0.9rem; color: #18181b; }
a.dc-tl-title:hover { color: #2563eb; text-decoration: underline; }
html.dark .dc-tl-title { color: #f4f4f5; }
.dc-tl-line { font-size: 0.82rem; color: #52525b; margin-top: 0.2rem; white-space: pre-line; }
html.dark .dc-tl-line { color: #a1a1aa; }
.dc-tl-author { font-size: 0.72rem; color: #a1a1aa; margin-top: 0.35rem; }

/* Shtesat e vizitave të mbyllura */
.dc-addendum { border-left: 3px solid #f59e0b; background: #fffbeb; padding: 0.5rem 0.75rem; border-radius: 6px; margin-bottom: 0.5rem; font-size: 0.85rem; }
html.dark .dc-addendum { background: rgb(245 158 11 / 0.08); }
.dc-addendum-meta { font-size: 0.72rem; color: #92400e; margin-bottom: 0.2rem; font-weight: 600; }

/* ---------- Imazhet e pacientit (resources/views/filament/patients/images.blade.php) ---------- */
.dc-gal { display: flex; flex-direction: column; gap: 1.25rem; }
.dc-gal-day-title { font-size: 0.85rem; font-weight: 700; color: #3f3f46; margin-bottom: 0.6rem; }
.dc-gal-day-title span { font-weight: 500; color: #a1a1aa; }
html.dark .dc-gal-day-title { color: #e4e4e7; }
.dc-gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.9rem; }
.dc-gal-card { display: flex; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: var(--crm-card-shadow); overflow: hidden; transition: box-shadow 0.15s ease; }
html.dark .dc-gal-card { background: rgb(24 24 27); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.07); }
.dc-gal-card:hover { box-shadow: var(--crm-card-shadow-hover); }
.dc-gal-card.is-selected { box-shadow: 0 0 0 2px #2563eb, 0 10px 24px -14px rgb(24 24 27 / 0.3); }
.dc-gal-thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; background: #0f172a; cursor: zoom-in; overflow: hidden; width: 100%; }
.dc-gal-thumb img { width: 100%; height: 100%; object-fit: contain; }
.dc-gal-thumb.is-pdf { flex-direction: column; gap: 0.3rem; background: #f1f5f9; color: #475569; font-weight: 700; font-size: 0.8rem; cursor: pointer; }
html.dark .dc-gal-thumb.is-pdf { background: rgb(39 39 42); color: #d4d4d8; }
.dc-gal-pdf-icon { width: 2.6rem; height: 2.6rem; }
.dc-gal-meta { padding: 0.6rem 0.75rem 0.2rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
.dc-gal-teeth { font-size: 0.78rem; font-weight: 600; color: #3f3f46; }
html.dark .dc-gal-teeth { color: #d4d4d8; }
.dc-gal-notes { font-size: 0.78rem; color: #52525b; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html.dark .dc-gal-notes { color: #a1a1aa; }
.dc-gal-by { font-size: 0.7rem; color: #a1a1aa; }
.dc-gal-actions { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 0.2rem 0.4rem 0.4rem 0.75rem; }
.dc-gal-compare { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; color: #52525b; cursor: pointer; }
html.dark .dc-gal-compare { color: #a1a1aa; }
.dc-gal-buttons { display: inline-flex; margin-left: auto; }
.dc-gal-comparebar { position: sticky; bottom: 1rem; align-self: center; display: flex; align-items: center; gap: 0.75rem; background: #17365e; color: #fff; font-size: 0.85rem; padding: 0.5rem 0.6rem 0.5rem 1rem; border-radius: 999px; box-shadow: 0 12px 30px -10px rgb(11 31 56 / 0.6); z-index: 20; }

/* Shikuesi i imazheve (mbi gjithë faqen) */
.dc-viewer { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: rgb(9 9 11 / 0.97); color: #e4e4e7; }
.dc-viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 0.6rem 1rem; border-bottom: 1px solid rgb(255 255 255 / 0.08); }
.dc-viewer-title { font-weight: 600; font-size: 0.9rem; }
.dc-viewer-tools { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; font-size: 0.78rem; }
.dc-viewer-tools label { display: inline-flex; align-items: center; gap: 0.35rem; }
.dc-viewer-tools input[type=range] { width: 90px; accent-color: #60a5fa; }
.dc-viewer-tools button { min-width: 2rem; height: 2rem; padding: 0 0.6rem; border-radius: 8px; background: rgb(255 255 255 / 0.08); color: #fff; font-weight: 600; }
.dc-viewer-tools button:hover { background: rgb(255 255 255 / 0.16); }
.dc-viewer-tools .dc-viewer-close { background: rgb(239 68 68 / 0.2); }
.dc-viewer-body { position: relative; flex: 1; min-height: 0; display: flex; gap: 0.75rem; padding: 0.75rem; }
.dc-viewer-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; margin: 0; }
/* margin:auto (jo align-items:center) që imazhi i zmadhuar të mos pritet majtas/lart */
.dc-viewer-stage { flex: 1; min-height: 0; overflow: auto; display: flex; border-radius: 10px; background: #000; }
.dc-viewer-stage.is-zoomed { cursor: grab; }
.dc-viewer-stage.is-zoomed:active { cursor: grabbing; }
.dc-viewer-stage img { margin: auto; max-width: 100%; max-height: calc(100vh - 9rem); object-fit: contain; user-select: none; }
.dc-viewer-body.is-compare .dc-viewer-stage img { max-height: calc(100vh - 10rem); }
.dc-viewer-pane figcaption { font-size: 0.78rem; color: #a1a1aa; display: flex; flex-direction: column; gap: 0.15rem; }
.dc-viewer-notes { color: #d4d4d8; }
.dc-viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 2.6rem; height: 2.6rem; border-radius: 999px; background: rgb(255 255 255 / 0.12); color: #fff; font-size: 1.6rem; line-height: 1; }
.dc-viewer-nav:hover { background: rgb(255 255 255 / 0.22); }
.dc-viewer-nav.is-prev { left: 1.25rem; }
.dc-viewer-nav.is-next { right: 1.25rem; }
@media (max-width: 768px) {
    .dc-viewer-body.is-compare { flex-direction: column; }
    .dc-viewer-body.is-compare .dc-viewer-stage img { max-height: calc(50vh - 7rem); }
}

/* Imazhet te vizita */
.dc-vis-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 0.4rem; margin-bottom: 0.4rem; }
.dc-vis-thumbs a { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #0f172a; }
.dc-vis-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.dc-vis-thumbs .is-pdf { display: flex; align-items: center; justify-content: center; background: #f1f5f9; color: #475569; font-weight: 700; font-size: 0.75rem; }
.is-images .dc-tl-dot { background: #cffafe; color: #0e7490; }
