/* Общ вид на денталните табла на VD TMS — същият като на Моллови
   (dental-dashboard-local.html). Не променяй само тук — дръж ги еднакви. */
:root {
    --primary: #1363C6;
    --secondary: #15ACE1;
    --light: #F4F7FE;
    --dark: #14183E;
}
body { background: #f0f4fb; font-family: 'Open Sans', sans-serif; }

.admin-banner {
    background: linear-gradient(90deg, #6d28d9, #4338ca); color: #fff;
    text-align: center; padding: 8px 14px; font-size: 13px; font-weight: 600;
}
.admin-banner a { color: #fff; text-decoration: underline; margin-left: 6px; }

.dash-wrapper { display: flex; min-height: calc(100vh - 56px); }
.dash-sidebar {
    width: 220px; flex-shrink: 0;
    background: var(--dark);
    padding: 24px 0;
    position: sticky; top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}
.dash-sidebar .sidebar-brand {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    margin-bottom: 12px;
}
.dash-sidebar .sidebar-brand .title { font-size: 15px; font-weight: 700; color: #fff; }
.dash-sidebar .sidebar-brand span { display: block; font-size: 11px; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .1em; margin-top: 4px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,.6); text-decoration: none;
    font-size: 13.5px; transition: all .2s;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.sidebar-nav a.active { color: #fff; background: rgba(19,99,198,.25); border-left-color: var(--primary); }
.sidebar-nav a i { font-size: 15px; width: 18px; text-align: center; }
.sidebar-nav .nav-badge { color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 10px; margin-left: auto; }
.sidebar-section { padding: 16px 20px 6px; font-size: 10px; color: rgba(255,255,255,.3); text-transform: uppercase; letter-spacing: .12em; }
.conn-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); position: absolute; bottom: 0; width: 100%; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.dot-ok   { background: #28a745; }
.dot-warn { background: #ffc107; }
.dot-err  { background: #dc3545; }

.dash-main { flex: 1; padding: 28px 32px; min-width: 0; }
.dash-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.dash-topbar h2 { font-family: 'Ubuntu', sans-serif; font-size: 20px; font-weight: 700; color: var(--dark); margin: 0; }

.metric-card { background: #fff; border-radius: 12px; padding: 16px 14px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.metric-card .label { font-size: 11.5px; color: #6c757d; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.metric-card .value { font-size: 26px; font-weight: 700; font-family: 'Ubuntu', sans-serif; line-height: 1; }
.metric-card .sub { font-size: 11px; color: #adb5bd; margin-top: 3px; }

.filter-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-pill {
    padding: 4px 12px; border-radius: 20px; font-size: 12.5px;
    cursor: pointer; border: 1px solid #dee2e6;
    background: #fff; color: #495057; transition: all .15s;
}
.filter-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.filter-pill:hover:not(.active) { background: #f1f3f5; }

.dash-card { background: #fff; border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.06); overflow: hidden; }
.dash-card-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dash-card-header h5 { font-family: 'Ubuntu', sans-serif; font-size: 15px; font-weight: 700; color: var(--dark); margin: 0; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table thead th { padding: 10px 14px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #6c757d; background: #f8f9fa; border-bottom: 1px solid #e9ecef; white-space: nowrap; }
.dash-table tbody td { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-table tbody tr:hover { background: #fafbff; }
.table-footer { padding: 10px 20px; font-size: 12px; color: #adb5bd; border-top: 1px solid #f0f0f0; }

.badge-status { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-to_call    { background: #e8f0fe; color: #1363C6; }
.badge-confirmed  { background: #e6f4ea; color: #1e7e34; }
.badge-rescheduled{ background: #fff3cd; color: #856404; }
.badge-cancelled  { background: #fde8e8; color: #b02a37; }
.badge-no_answer  { background: #f0f0f0; color: #6c757d; }

.toast-container-custom { position: fixed; bottom: 24px; right: 24px; z-index: 9999; }
.custom-toast {
    background: #1a2540; color: #fff; border-radius: 10px;
    padding: 12px 18px; font-size: 13px; margin-top: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
    display: flex; align-items: center; gap: 10px;
    animation: slideIn .3s ease;
}
.custom-toast.success { border-left: 4px solid #28a745; }
.custom-toast.error   { border-left: 4px solid #dc3545; }
.custom-toast.info    { border-left: 4px solid #17a2b8; }
@keyframes slideIn { from { transform: translateX(80px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.empty-state { padding: 60px 20px; text-align: center; color: #adb5bd; }
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
.container-fluid.sticky-top { background: var(--dark) !important; }

.action-btn { background: none; border: none; padding: 4px 7px; border-radius: 6px; cursor: pointer; font-size: 14px; transition: background .15s; line-height: 1; }
.action-btn:hover { background: #e9ecef; }
.action-btn.call  { color: #1363C6; }
.action-btn.viber { color: #7360f2; }
.action-btn.sms   { color: #28a745; }
.action-btn.edit  { color: #495057; }
.action-btn.del   { color: #dc3545; }
.actions-cell, .row-actions { display: flex; gap: 2px; align-items: center; }

/* --- допълнения за ББ Дент (настройки, слотове, редакция в реда) --- */
.form-row-flex { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row-flex label, .dash-main label { display: block; font-size: 12px; font-weight: 600; color: #6c757d; margin-bottom: 4px; }
.dash-main input:not([type=checkbox]):not(.form-control),
.dash-main select:not(.form-control):not(.form-select),
.dash-main textarea {
    padding: .3rem .6rem; font-size: 13px; line-height: 1.5;
    border: 1px solid #ced4da; border-radius: .25rem; background: #fff; color: #212529;
    min-width: 150px; outline: none;
}
.dash-main input:focus, .dash-main select:focus, .dash-main textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 .15rem rgba(19,99,198,.15); }
.dash-main textarea { width: 100%; font-family: inherit; resize: vertical; }
.dash-main input[type=number] { min-width: 110px; }
select.time-select { min-width: 100px !important; }

.settings-block > summary { list-style: none; cursor: pointer; }
.settings-block > summary::-webkit-details-marker { display: none; }
.settings-block > summary h5::before {
    content: "\f054"; font-family: "Font Awesome 5 Free"; font-weight: 900;
    font-size: 11px; color: #adb5bd; margin-right: 10px; display: inline-block; transition: transform .15s;
}
.settings-block[open] > summary h5::before { transform: rotate(90deg); }
.settings-block:not([open]) > summary { border-bottom: none; }

tr.editing td { background: #f8faff; }
.dash-main tr.editing input:not([type=checkbox]), .dash-main tr.editing select { min-width: 0; width: 100%; }
.edit-actions { display: flex; gap: 6px; white-space: nowrap; }

.slots-wrap { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.slot-btn {
    border: 1px solid #dee2e6; background: #fff; border-radius: 20px;
    padding: 5px 14px; cursor: pointer; font-size: 12.5px; color: #495057; transition: all .15s;
}
.slot-btn:hover { background: #f1f3f5; }
.slot-btn.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.muted { color: #adb5bd; }

/* --- календар със свободни часове (като Google Calendar) --- */
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-label { font-family: 'Ubuntu', sans-serif; font-size: 16px; font-weight: 500; color: var(--dark); margin-left: 6px; }
.cal-scroll { overflow-x: auto; border: 1px solid #eef1f8; border-radius: 10px; max-height: 620px; overflow-y: auto; }
.cal-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(96px, 1fr)); min-width: 760px; position: relative; }
.cal-corner, .cal-dayhead {
    position: sticky; top: 0; z-index: 3; background: #fff;
    border-bottom: 1px solid #e9ecef; height: 58px;
}
.cal-corner { font-size: 9.5px; color: #adb5bd; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; }
.cal-dayhead { display: flex; flex-direction: column; align-items: center; justify-content: center; border-left: 1px solid #f1f3f5; }
.cal-dayhead span { font-size: 11px; color: #6c757d; letter-spacing: .06em; }
.cal-dayhead b { font-family: 'Ubuntu', sans-serif; font-size: 22px; font-weight: 500; color: #3c4043; line-height: 1.2; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-dayhead.today span { color: var(--primary); }
.cal-dayhead.today b { background: var(--primary); color: #fff; }
.cal-times { position: relative; }
.cal-times div { position: absolute; right: 8px; transform: translateY(-50%); font-size: 10.5px; color: #868e96; }
.cal-times div:first-child { transform: none; }
.cal-col {
    position: relative; border-left: 1px solid #f1f3f5;
    background-image: linear-gradient(to bottom, #eef0f3 1px, transparent 1px);
    background-size: 100% 52px;
}
.cal-col.today { background-color: #fafcff; }
.cal-col.can-insert { cursor: cell; }
.cal-col.can-insert:hover { background-color: #f7f9fd; }
.cal-ev.busy, .cal-ev.current { border: 1px solid #fff; cursor: cell; }
.cal-ev {
    position: absolute; left: 3px; right: 5px; border-radius: 6px; padding: 3px 7px;
    font-size: 11.5px; line-height: 1.3; overflow: hidden; box-sizing: border-box;
}
.cal-ev b { font-weight: 600; }
.cal-ev span { opacity: .8; }
.cal-ev.free {
    background: #e6f4ea; color: #1e7e34; border: 1px dashed #8fd19e; cursor: pointer; transition: all .12s;
}
.cal-ev.free:hover { background: #ccebd5; border-style: solid; }
.cal-ev.free.picked { background: var(--primary); color: #fff; border: 1px solid var(--primary); box-shadow: 0 2px 8px rgba(19,99,198,.35); }
.cal-ev.busy { background: #039be5; color: #fff; }
.cal-ev.current { background: #8e24aa; color: #fff; }
.cal-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: #6c757d; margin-top: 10px; }
.cal-legend .lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.cal-legend .lg:first-child { margin-left: 0; }
.cal-legend .lg.free { background: #e6f4ea; border: 1px dashed #8fd19e; }
.cal-legend .lg.busy { background: #039be5; }
.cal-legend .lg.current { background: #8e24aa; }

@media (max-width: 768px) {
    /* на телефон менюто става хоризонтална лента, за да има навигация */
    .dash-wrapper { flex-direction: column; }
    .dash-sidebar { width: 100%; height: auto; position: static; padding: 0; }
    .dash-sidebar .sidebar-brand, .sidebar-section, .conn-footer { display: none; }
    .sidebar-nav { display: flex; overflow-x: auto; }
    .sidebar-nav a { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; padding: 12px 14px; }
    .sidebar-nav a.active { border-bottom-color: var(--primary); }
    .dash-main { padding: 16px; }
}

/* --- AIRA за Talent Hunter --- */
.stage-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; background: #f0f0f0; color: #6c757d; }
.stage-badge.s-approve { background: #fff3cd; color: #856404; }
.stage-badge.s-call    { background: #e8f0fe; color: #1363C6; }
.stage-badge.s-video   { background: #f3e8fd; color: #7b2cbf; }
.stage-badge.s-booked  { background: #e6f4ea; color: #1e7e34; }
.stage-badge.s-other   { background: #e0f7fa; color: #00838f; }
.stage-badge.s-bad     { background: #fde8e8; color: #b02a37; }
.score { font-weight: 700; font-family: 'Ubuntu', sans-serif; }
.score.hi { color: #1e7e34; } .score.mid { color: #b8860b; } .score.lo { color: #b02a37; }
.q-list { display: flex; flex-direction: column; gap: 8px; }
.q-row { display: flex; gap: 8px; align-items: center; }
.q-row .q-num { width: 22px; text-align: right; color: #adb5bd; font-size: 12px; }
.q-row input { flex: 1; min-width: 0 !important; }
.field-help { font-size: 11.5px; color: #adb5bd; margin-top: 3px; }
.pos-form .col-12, .pos-form .col-md-6, .pos-form .col-md-4, .pos-form .col-md-3 { margin-bottom: 14px; }
.pos-form input:not([type=checkbox]), .pos-form select { width: 100%; }
.aira-modal-bg { position: fixed; inset: 0; background: rgba(20,24,62,.45); z-index: 2000; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.aira-modal { background: #fff; border-radius: 14px; width: 100%; max-width: 720px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.aira-modal .m-head { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.aira-modal .m-head h5 { margin: 0; font-family: 'Ubuntu', sans-serif; font-size: 16px; font-weight: 700; color: var(--dark); }
.aira-modal .m-body { padding: 18px 20px; font-size: 13.5px; }
.aira-modal .m-foot { padding: 12px 20px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 8px; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 12.5px; }
.timeline li { padding: 6px 0; border-bottom: 1px dashed #eee; display: flex; gap: 10px; }
.timeline li span.t { color: #adb5bd; white-space: nowrap; min-width: 112px; }
.transcript { white-space: pre-wrap; background: #f8f9fa; border-radius: 8px; padding: 12px; font-size: 12.5px; max-height: 360px; overflow-y: auto; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--dark), var(--primary)); padding: 20px; }
.login-card { background: #fff; border-radius: 16px; width: 100%; max-width: 400px; padding: 32px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-card h1 { font-family: 'Ubuntu', sans-serif; font-size: 24px; font-weight: 700; color: var(--dark); margin: 0; }
.login-card .sub { color: #6c757d; font-size: 13px; margin: 4px 0 24px; }
.login-card label { font-size: 12px; font-weight: 600; color: #6c757d; margin-bottom: 4px; display: block; }
.login-card input { width: 100%; padding: 10px 12px; border: 1px solid #dee2e6; border-radius: 10px; font-size: 14px; margin-bottom: 14px; outline: none; }
.login-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 .15rem rgba(19,99,198,.15); }
.login-card button { width: 100%; border: none; background: var(--primary); color: #fff; font-weight: 700; padding: 12px; border-radius: 10px; font-size: 15px; }
.login-card button:disabled { opacity: .6; }
.login-card .err { display: none; background: #fde8e8; color: #b02a37; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 14px; }
.login-card .foot { text-align: center; font-size: 11.5px; color: #adb5bd; margin-top: 18px; }

/* Табло: картите и числата са линкове */
a.metric-link { text-decoration: none; color: inherit; display: block; }
a.metric-link .metric-card { transition: transform .12s, box-shadow .12s; cursor: pointer; }
a.metric-link:hover .metric-card { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(19,99,198,.15); }
a.num-link { color: var(--primary); font-weight: 600; text-decoration: none; display: inline-block; min-width: 28px; padding: 2px 6px; border-radius: 6px; }
a.num-link:hover { background: #e8f0fe; }
tr.row-link:hover td { background: #f4f7fe; }

/* Позиция: лентата „Запази“ винаги се вижда долу */
.form-actions-bar {
    position: sticky; bottom: 0; z-index: 50;
    display: flex; justify-content: flex-end; align-items: center; gap: 10px;
    margin: 16px -32px -28px; padding: 12px 32px;
    background: rgba(255,255,255,.97); border-top: 1px solid #e3e8f2;
    box-shadow: 0 -4px 14px rgba(20,24,62,.08); backdrop-filter: blur(4px);
}
.form-actions-bar .unsaved { margin-right: auto; font-size: 12.5px; color: #b8860b; }
.form-actions-bar .unsaved i { font-size: 8px; vertical-align: middle; }
@media (max-width: 768px) { .form-actions-bar { margin: 16px -16px -16px; padding: 10px 16px; } }
a.pos-link { font-weight: 700; color: var(--primary); text-decoration: none; }
a.pos-link:hover { text-decoration: underline; }

/* Календар: Google календар + визуален избор на свободни часове */
.gcal-frame { width: 100%; height: 760px; border: 0; display: block; }
.meet-list { max-height: 260px; overflow-y: auto; }
.meet-item { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #f1f3f5; cursor: pointer; font-size: 13px; }
.meet-item:hover { background: #f4f7fe; }
.meet-when { font-weight: 700; color: var(--primary); white-space: nowrap; min-width: 108px; }
.avail-grid { display: grid; gap: 2px; user-select: none; }
.avail-grid .ag-head { text-align: center; font-size: 11px; font-weight: 600; color: #6c757d; padding-bottom: 2px; }
.avail-grid .ag-time { font-size: 10px; color: #868e96; text-align: right; padding-right: 4px; line-height: 14px; }
.avail-grid .ag-cell { height: 14px; background: #f1f3f5; border-radius: 3px; cursor: pointer; transition: background .08s; }
.avail-grid .ag-cell.hour { box-shadow: inset 0 1px 0 #dee2e6; }
.avail-grid .ag-cell:hover { background: #d0e7d6; }
.avail-grid .ag-cell.on { background: #34a853; }
.avail-grid .ag-cell.on:hover { background: #2b8f45; }

/* Календар: превключвател Google / Microsoft и седмицата от Outlook */
.cal-switch { display: inline-flex; background: #fff; border-radius: 10px; padding: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.cal-switch button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; font-size: 13px; color: #495057; }
.cal-switch button.active { background: var(--primary); color: #fff; }
.ms-agenda { max-height: 700px; overflow-y: auto; }
.ms-day { border-bottom: 1px solid #f1f3f5; padding: 10px 2px; }
.ms-day.today .ms-day-name { color: var(--primary); }
.ms-day-name { font-weight: 700; font-size: 13px; color: var(--dark); text-transform: capitalize; margin-bottom: 4px; }
.ms-ev { display: flex; gap: 12px; font-size: 13px; padding: 5px 10px; margin: 3px 0; border-left: 3px solid #0078D4; background: #f3f8fd; border-radius: 0 6px 6px 0; }
.ms-ev.free { border-left-color: #adb5bd; background: #f8f9fa; color: #6c757d; }
.ms-time { font-weight: 600; min-width: 92px; color: #0b5cad; }
.ms-empty { font-size: 12px; color: #adb5bd; padding: 2px 10px; }
