/* ============================================================
   Failsafe Admin — OneDash-inspired theme
   ============================================================ */

:root {
    --primary:        #3461ff;
    --primary-rgb:    52, 97, 255;
    --primary-light:  rgba(52, 97, 255, .1);
    --sidebar-width:  260px;
    --topbar-height:  60px;
    --body-bg:        #f7f8fa;
    --sidebar-bg:     #ffffff;
    --topbar-bg:      #ffffff;
    --card-radius:    10px;
    --text-body:      #4c5258;
    --text-heading:   #293445;
    --text-muted:     #8a909d;
    --border-color:   #e2e3e4;
    --shadow-sm:      0 .125rem .25rem rgba(0,0,0,.075);
    --shadow-md:      0 .3rem .8rem rgba(0,0,0,.12);
    --transition:     .25s ease;
}

/* === BASE === */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    background: var(--body-bg);
    color: var(--text-body);
    font-size: 14px;
    line-height: 1.6;
}

/* === SIDEBAR === */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    box-shadow: .125rem 0 .5rem rgba(0,0,0,.08);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1040;
    transition: transform var(--transition);
    scrollbar-width: thin;
    scrollbar-color: #e2e3e4 transparent;
}

.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    letter-spacing: .3px;
    flex-shrink: 0;
}

#sidebar-nav {
    padding: .75rem 0;
    list-style: none;
    margin: 0;
}

#sidebar-nav .nav-item {
    margin-bottom: 2px;
}

#sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: .625rem 1.25rem;
    margin: 0 .75rem;
    color: #5f5f5f;
    border-radius: .5rem;
    font-size: .875rem;
    font-weight: 400;
    transition: all var(--transition);
    border-left: 3px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

#sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 1.75rem;
    flex-shrink: 0;
}

#sidebar-nav .nav-link:hover {
    background: #ffffff;
    color: var(--primary);
    box-shadow: var(--shadow-md);
}

#sidebar-nav .nav-link.active {
    background: #ffffff;
    color: var(--primary);
    font-weight: 500;
    box-shadow: var(--shadow-md);
    margin-left: 0;
    padding-left: calc(1.25rem + .75rem);
    border-radius: 0 .5rem .5rem 0;
    border-left: 3px solid var(--primary);
}

/* === SIDEBAR SUBMENU === */
#sidebar-nav .sidebar-group-btn {
    display: flex;
    align-items: center;
    width: calc(100% - 1.5rem);
    padding: .625rem 1.25rem;
    margin: 0 .75rem;
    color: #5f5f5f;
    border-radius: .5rem;
    font-size: .875rem;
    font-weight: 400;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-align: left;
}
#sidebar-nav .sidebar-group-btn i.group-icon {
    font-size: 1.1rem;
    width: 1.75rem;
    flex-shrink: 0;
}
#sidebar-nav .sidebar-group-btn .chevron {
    margin-left: auto;
    font-size: .7rem;
    transition: transform .2s ease;
    opacity: .4;
}
#sidebar-nav .sidebar-group-btn:hover {
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow-md);
}
/* Nyitott állapot — ugyanolyan mint az aktív nav-link */
#sidebar-nav .sidebar-group-btn.open {
    background: #fff;
    color: var(--primary);
    font-weight: 500;
    box-shadow: var(--shadow-md);
    margin-left: 0;
    padding-left: calc(1.25rem + .75rem);
    width: calc(100% - .75rem);
    border-radius: 0 .5rem .5rem 0;
    border-left: 3px solid var(--primary);
}
#sidebar-nav .sidebar-group-btn.open .chevron {
    transform: rotate(90deg);
    opacity: 1;
}

/* Almenü konténer */
.sidebar-submenu {
    overflow: hidden;
    max-height: 0;
    transition: max-height .28s ease;
}
.sidebar-submenu.open {
    max-height: 300px;
}

/* Almenü tételek — ikon elrejtve, kör bullet helyette */
.sidebar-submenu .nav-link {
    padding: .5rem 1rem .5rem 2.75rem;
    margin: 2px .75rem;
    font-size: .83rem;
    color: #6b7280;
    border-radius: .4rem;
    border-left: 3px solid transparent;
    box-shadow: none;
}
.sidebar-submenu .nav-link i {
    display: none;
}
.sidebar-submenu .nav-link::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: .65rem;
    opacity: .7;
    transition: all var(--transition);
}
.sidebar-submenu .nav-link:hover {
    color: var(--primary);
    background: rgba(52, 97, 255, 0.06);
    box-shadow: none;
}
.sidebar-submenu .nav-link:hover::before {
    opacity: 1;
    background: var(--primary);
    border-color: var(--primary);
}
.sidebar-submenu .nav-link.active {
    color: var(--primary);
    font-weight: 500;
    background: rgba(52, 97, 255, 0.06);
    box-shadow: none;
    margin-left: .75rem;
    padding-left: 2.75rem;
}
.sidebar-submenu .nav-link.active::before {
    background: var(--primary);
    border-color: var(--primary);
    opacity: 1;
}

/* === TOPBAR === */
#topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--topbar-bg);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1030;
    transition: left var(--transition);
}

.has-sidebar #topbar {
    left: var(--sidebar-width);
}

.topbar-start {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.topbar-end {
    display: flex;
    align-items: center;
    gap: .625rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    padding: .375rem .5rem;
    border-radius: .5rem;
    color: #5f5f5f;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    transition: background var(--transition), color var(--transition);
}
.sidebar-toggle:hover {
    background: var(--body-bg);
    color: var(--primary);
}

.topbar-brand {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.has-sidebar .topbar-brand {
    display: none;
}

.api-status {
    font-size: .8rem;
    color: var(--text-muted);
}

/* === MAIN CONTENT === */
#main {
    margin-top: var(--topbar-height);
    padding: 1.5rem;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left var(--transition);
}

.has-sidebar #main {
    margin-left: var(--sidebar-width);
}

/* === CARDS === */
.card {
    border-radius: var(--card-radius) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
    background: #fff;
}

.card-header {
    background: #fff !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: .875rem 1.25rem;
    font-size: .875rem;
    font-weight: 600;
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
    color: var(--text-heading);
}

.card-body {
    padding: 1.25rem;
}

/* === TYPOGRAPHY === */
h4, h5, h6 {
    color: var(--text-heading);
    font-weight: 600;
    letter-spacing: .2px;
}

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

/* === PAGE HEADERS === */
.page-header {
    margin-bottom: 1.5rem;
}
.page-header h5 {
    font-size: 1.05rem;
    margin-bottom: 0;
}

/* === BUTTONS === */
.btn {
    border-radius: .5rem;
    font-size: .8125rem;
    font-weight: 500;
    letter-spacing: .2px;
    padding: .4rem .875rem;
}

.btn-sm {
    padding: .3rem .65rem;
    font-size: .8rem;
    border-radius: .4rem;
}

.btn-dark {
    background: #293445;
    border-color: #293445;
}
.btn-dark:hover, .btn-dark:focus {
    background: #1e2730;
    border-color: #1e2730;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover, .btn-primary:focus {
    background: #1e43e6;
    border-color: #1e43e6;
}
.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* === FORM CONTROLS === */
.form-control, .form-select {
    border-color: var(--border-color);
    font-size: .875rem;
    color: var(--text-body);
    border-radius: .5rem;
    background-color: #fff;
}
.form-control:focus, .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 .25rem rgba(var(--primary-rgb), .15);
}
.form-label {
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-heading);
    margin-bottom: .35rem;
}
.form-control-sm, .form-select-sm {
    font-size: .8125rem;
}

/* === TABLES === */
.table {
    font-size: .875rem;
    color: var(--text-body);
}
.table th {
    color: var(--text-heading);
    font-weight: 600;
    font-size: .775rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: var(--body-bg);
    border-bottom: 2px solid var(--border-color) !important;
    padding: .625rem .875rem;
}
.table td {
    border-color: var(--border-color);
    vertical-align: middle;
    padding: .625rem .875rem;
}
.table-hover tbody tr:hover > * {
    background: #f9fafb;
}

/* === BADGES === */
.badge {
    font-weight: 500;
    font-size: .73rem;
    border-radius: .375rem;
    padding: .3em .6em;
    letter-spacing: .2px;
}

/* === MODALS === */
.modal-content {
    border-radius: var(--card-radius) !important;
    border: none;
    box-shadow: 0 .5rem 2rem rgba(0,0,0,.15);
}
.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
}
.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: .75rem 1.25rem;
}
.modal-title {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--text-heading);
}

/* === ALERTS === */
.alert {
    border-radius: .5rem;
    font-size: .875rem;
    border: none;
}

/* === TOPBAR USER AREA === */
.topbar-user-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.topbar-username {
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-heading);
}

/* === MOBILE OVERLAY === */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1039;
    backdrop-filter: blur(2px);
}
#sidebar-overlay.active {
    display: block;
}

/* Toggle csak mobilon látszik */
@media (min-width: 992px) {
    #sidebar-toggle-btn { display: none !important; }
}

/* === MOBILE === */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    #sidebar.sidebar-open {
        transform: translateX(0);
        box-shadow: .5rem 0 1.5rem rgba(0,0,0,.15);
    }
    .has-sidebar #topbar { left: 0; }
    .has-sidebar #main   { margin-left: 0; }
    #topbar { padding: 0 1rem; }
    #main   { padding: 1rem; }
}

/* === SPINNER / LOADING === */
.spinner-border-sm { width: 1rem; height: 1rem; }

/* === SELECT STATUS DROPDOWN === */
.status-select {
    font-size: .8125rem;
    border-radius: .4rem;
}

/* === CAT CARDS === */
.cat-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .2s, transform .15s;
    position: relative;
}
.cat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.cat-card-photo {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f3f4f6;
}
.cat-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cat-card-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity .3s;
}
.cat-card-status {
    position: absolute;
    bottom: .45rem;
    left: .45rem;
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .01em;
    padding: .18rem .5rem;
    border-radius: 20px;
    color: #fff;
    box-shadow: 0 1px 5px rgba(0,0,0,.3);
    pointer-events: none;
    white-space: nowrap;
}
.cat-card-quarantine {
    position: absolute;
    top: .4rem;
    left: .4rem;
    background: #f59e0b;
    color: #fff;
    border-radius: 50%;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    pointer-events: none;
}
.cat-card-edit {
    position: absolute;
    top: .4rem; right: .4rem;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 50%;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-body);
    opacity: 0;
    transition: opacity .15s, background .15s;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.cat-card:hover .cat-card-edit { opacity: 1; }
.cat-card-edit:hover { background: #fff; }
.cat-card-body {
    padding: .6rem .75rem .65rem;
    border-top: 1px solid var(--border-color);
}
.cat-card-name {
    font-weight: 600;
    font-size: .9rem;
    color: var(--text-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cat-card-meta {
    font-size: .72rem;
    color: var(--text-muted);
    margin-top: .15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === TIMELINE === */
.tl-month-label {
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    padding: .875rem 0 .5rem 44px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: .75rem;
}
.tl-line {
    width: 2px;
    background: var(--border-color);
    flex-grow: 1;
    min-height: 12px;
    margin-top: 3px;
    border-radius: 1px;
}
.tl-card {
    border-left-color: var(--tl-c, #6b7280) !important;
    border-left-width: 3px !important;
}

/* === CAT PROFILE LAYOUT === */
#timeline-list {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 2px;
}

/* === DOCUMENTS === */

/* Drop zone */
.doc-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--card-radius);
    background: var(--body-bg);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), transform .15s;
    min-height: 168px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}
.doc-drop-zone:hover,
.doc-drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}
.doc-drop-zone.drag-over {
    transform: scale(1.015);
    border-style: solid;
}
.doc-drop-inner { padding: 2rem 1.5rem; pointer-events: none; }
.doc-drop-icon-wrap {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(52,97,255,.1);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto .875rem;
    transition: background var(--transition);
}
.doc-drop-zone:hover  .doc-drop-icon-wrap,
.doc-drop-zone.drag-over .doc-drop-icon-wrap { background: rgba(52,97,255,.2); }
.doc-drop-icon {
    font-size: 1.75rem;
    color: var(--primary);
    display: block;
}
.doc-drop-title {
    font-weight: 500;
    margin-bottom: .375rem;
    color: var(--text-heading);
    font-size: .9rem;
}
.doc-drop-sub {
    font-size: .8rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.8;
}

/* Queue */
.doc-queue-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-height: 40vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: .25rem;
}
/* Cat event attachment picker rows */
.cev-pick-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem .4rem;
    border-radius: .35rem;
    cursor: pointer;
    font-size: .82rem;
    transition: background .12s;
}
.cev-pick-row:hover       { background: var(--primary-light); }
.cev-pick-row--selected   { background: rgba(16,185,129,.08); }
.cev-pick-thumb {
    width: 36px;
    height: 36px;
    border-radius: .3rem;
    overflow: hidden;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-qi {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .75rem;
    background: #fff;
    border-radius: .5rem;
    border: 1px solid var(--border-color);
    animation: docQiIn .2s ease;
}
@keyframes docQiIn { from { opacity:0; transform:translateY(-6px) } to { opacity:1; transform:none } }
.doc-qi-thumb {
    width: 44px; height: 44px;
    border-radius: .375rem;
    overflow: hidden;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--body-bg);
    border: 1px solid var(--border-color);
}
.doc-qi-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-qi-info    { flex: 1; min-width: 0; }
.doc-qi-name    { font-size: .83rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-qi-meta    { font-size: .72rem; color: var(--text-muted); display: flex; align-items: center; gap: .4rem; margin-top: .1rem; }
.doc-qi-progress { width: 80px; flex-shrink: 0; }
.doc-qi-status  { font-size: .75rem; flex-shrink: 0; }

/* Gallery grid */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 1rem;
}

/* Card */
.doc-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--transition), transform var(--transition);
}
.doc-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Thumbnail area */
.doc-thumb {
    aspect-ratio: 4 / 3;
    background: var(--body-bg);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.doc-thumb-img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}
.doc-card:hover .doc-thumb-img { transform: scale(1.05); }
.doc-thumb-fallback {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
}
.doc-thumb-fallback i { font-size: 3rem; opacity: .55; }
.doc-thumb-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.48);
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity .2s;
    color: #fff;
}
.doc-thumb:hover .doc-thumb-overlay { opacity: 1; }

/* Card body */
.doc-card-body { padding: .625rem .75rem .375rem; flex: 1; }
.doc-card-name {
    font-size: .82rem; font-weight: 500;
    color: var(--text-heading);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: .3rem;
}
.doc-card-meta { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.doc-card-actions {
    padding: .375rem .625rem .625rem;
    display: flex; gap: .375rem;
    border-top: 1px solid var(--border-color);
}
.doc-card-actions .btn { font-size: .75rem; padding: .2rem .5rem; }

/* Lightbox */
.doc-lightbox {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    visibility: hidden; opacity: 0;
    transition: opacity .22s, visibility .22s;
}
.doc-lightbox.active { visibility: visible; opacity: 1; }
.doc-lb-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.88);
    cursor: pointer;
}
.doc-lb-content {
    position: relative; z-index: 1;
    max-width: 92vw; max-height: 92vh;
    display: flex; flex-direction: column; align-items: center;
}
.doc-lb-img {
    max-width: 90vw; max-height: 82vh;
    object-fit: contain;
    border-radius: .5rem;
    box-shadow: 0 1.5rem 4rem rgba(0,0,0,.6);
}
.doc-lb-close {
    position: absolute; top: -2.75rem; right: 0;
    background: rgba(255,255,255,.15); border: none; color: #fff;
    width: 2.1rem; height: 2.1rem; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .15s; font-size: .85rem;
}
.doc-lb-close:hover { background: rgba(255,255,255,.3); }
.doc-lb-pdf {
    width: min(920px, 92vw);
    height: 90vh;
}
.doc-lb-iframe {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: none;
    border-radius: .5rem;
    box-shadow: 0 1.5rem 4rem rgba(0,0,0,.6);
}
.doc-lb-actions { flex-shrink: 0; }

/* === DOCUMENT TAGS === */

/* Tag badges on cards */
.doc-tag-badge {
    display: inline-block;
    padding: .1rem .45rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 2rem;
    font-size: .64rem;
    font-weight: 500;
    cursor: pointer;
    margin: .1rem .1rem 0 0;
    transition: background .15s, color .15s;
    line-height: 1.5;
}
.doc-tag-badge:hover  { background: rgba(52,97,255,.2); }
.doc-tag-badge.active { background: var(--primary); color: #fff; }

/* Description preview on card */
.doc-card-desc {
    font-size: .68rem;
    margin-top: .25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: .75;
}

/* Tag filter bar */
.doc-tag-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .65rem;
    border: 1px solid var(--border-color);
    border-radius: 2rem;
    background: #fff;
    color: var(--text-body);
    font-size: .78rem;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
.doc-tag-filter-btn:hover  { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.doc-tag-filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.doc-tag-filter-count {
    display: inline-block;
    background: rgba(0,0,0,.1);
    border-radius: 2rem;
    font-size: .65rem;
    padding: 0 .35rem;
    line-height: 1.5;
}
.doc-tag-filter-btn.active .doc-tag-filter-count { background: rgba(255,255,255,.25); }

/* Tag chip input (edit modal) */
.doc-tag-input-wrap {
    border: 1px solid var(--border-color);
    border-radius: .5rem;
    padding: .35rem .5rem;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    align-items: center;
    cursor: text;
    transition: border-color .15s, box-shadow .15s;
    min-height: 40px;
    background: #fff;
}
.doc-tag-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(52,97,255,.15);
}
.doc-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    padding: .15rem .5rem .15rem .6rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 2rem;
    font-size: .78rem;
    font-weight: 500;
    white-space: nowrap;
}
.doc-tag-chip button {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    cursor: pointer;
    opacity: .65;
    font-size: .7rem;
    line-height: 1;
    display: flex;
    align-items: center;
    margin-left: .1rem;
}
.doc-tag-chip button:hover { opacity: 1; }
.doc-tag-input {
    border: none;
    outline: none;
    font-size: .85rem;
    padding: .1rem .15rem;
    flex: 1;
    min-width: 100px;
    background: transparent;
    color: var(--text-body);
}
.doc-tag-input::placeholder { color: var(--text-muted); }

/* Autocomplete suggestions */
.doc-tag-suggestions {
    position: absolute;
    z-index: 100;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: .5rem;
    box-shadow: var(--shadow-md);
    padding: .25rem;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    margin-top: .25rem;
    max-width: 100%;
}
.doc-tag-suggestion {
    padding: .3rem .6rem;
    border: none;
    background: none;
    text-align: left;
    font-size: .82rem;
    color: var(--text-body);
    border-radius: .35rem;
    cursor: pointer;
    transition: background .1s;
}
.doc-tag-suggestion:hover { background: var(--primary-light); color: var(--primary); }

/* === CAT PROFILE PHOTO === */
.cat-pfp-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.55);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    border-radius: 50%;
}
.cat-pfp-ring { transition: opacity .2s; }
.cat-upload-progress-wrap {
    background: var(--bs-light, #f8f9fa);
    border-radius: 8px;
    padding: .5rem .75rem;
    border: 1px solid var(--border-color);
}
.cat-pfp-cam-btn {
    position: absolute; bottom: 0; right: 0;
    width: 26px; height: 26px;
    background: #212529; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; border: 2px solid #fff;
    transition: background .15s;
}
.cat-pfp-cam-btn:hover { background: var(--primary); }
.cat-pfp-del-btn {
    position: absolute; bottom: 0; left: 0;
    width: 26px; height: 26px;
    background: #dc2626; border: 2px solid #fff; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 0;
    transition: background .15s;
}
.cat-pfp-del-btn:hover { background: #b91c1c; }

/* === CAT PHOTO GALLERY === */
.cat-photo-card { transition: transform .15s; }
.cat-photo-card:hover { transform: scale(1.02); }
.cat-photo-del-btn {
    position: absolute; top: 6px; right: 6px;
    width: 26px; height: 26px;
    background: rgba(220,38,38,.85); color: #fff;
    border: none; border-radius: 50%; padding: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: .65rem; cursor: pointer;
    opacity: 0; transition: opacity .15s;
}
.cat-photo-card:hover .cat-photo-del-btn { opacity: 1; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* === TOAST === */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: 360px;
    pointer-events: none;
}
.ui-toast {
    pointer-events: auto;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: .5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
    overflow: hidden;
    opacity: 0;
    transform: translateX(1.5rem);
    transition: opacity .25s, transform .25s;
}
.ui-toast.ui-toast-show { opacity: 1; transform: translateX(0); }
.ui-toast.ui-toast-hide { opacity: 0; transform: translateX(1.5rem); }
.ui-toast-body {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .7rem .85rem;
    font-size: .875rem;
}
.ui-toast-msg { flex: 1; line-height: 1.4; }
.ui-toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: .8rem;
    flex-shrink: 0;
}
.ui-toast-close:hover { color: #374151; }
.ui-toast-bar { height: 3px; transition: width .1s linear; }

/* === AI SPEAK BUTTON === */
.ai-speak-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: .8rem;
    padding: 2px 4px;
    border-radius: .3rem;
    cursor: pointer;
    opacity: .5;
    transition: opacity .15s, color .15s;
    flex-shrink: 0;
    line-height: 1;
}
.ai-speak-btn:hover  { opacity: 1; color: var(--primary); }
.ai-speak-btn.ai-speaking { opacity: 1; color: #ef4444; animation: ai-mic-pulse 1.2s ease-in-out infinite; }

/* === AI MIC BUTTON === */
.ai-mic-active {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #fff !important;
    animation: ai-mic-pulse 1.2s ease-in-out infinite;
}
@keyframes ai-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
    50%       { box-shadow: 0 0 0 7px rgba(239,68,68,0); }
}

/* === FELADAT TOGGLE (kész/nyitott) === */
.task-done-switch.form-check-input:checked {
    background-color: #22c55e;
    border-color: #22c55e;
}
.task-done-switch.form-check-input:focus {
    box-shadow: 0 0 0 .2rem rgba(34,197,94,.25);
}

/* === FELADAT HOZZÁRENDELÉS === */
.task-assignee-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: -.5px;
}
.task-assignee-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: var(--primary-light);
    border-radius: 20px;
    padding: 1px 8px 1px 2px;
    font-size: .75rem;
    color: var(--primary);
}

/* === NOTIFICATION BELL === */
.notif-bell-btn {
    position: relative;
}
.notif-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 16px; height: 16px;
    padding: 0 3px;
    background: #ef4444;
    color: #fff;
    border-radius: 8px;
    font-size: .6rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
}

/* === NOTIFICATION PANEL === */
.notif-panel {
    position: fixed;
    top: 68px;
    right: 12px;
    width: 360px;
    max-height: 480px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-md);
    z-index: 1045;
    display: none;
    overflow: hidden;
    flex-direction: column;
    animation: notifSlideIn .15s ease;
}
.notif-panel.open { display: flex; }
@keyframes notifSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}
.notif-header {
    display: flex;
    align-items: center;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.notif-list {
    overflow-y: auto;
    max-height: 420px;
}
.notif-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: .85rem;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background .12s;
    position: relative;
}
.notif-item:hover { background: var(--body-bg); }
.notif-unread { background: rgba(52,97,255,.04); }
.notif-unread::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
}
.notif-icon {
    width: 36px; height: 36px; flex-shrink: 0;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem;
}
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: .83rem; font-weight: 500; color: var(--text-heading); }
.notif-desc  { font-size: .75rem; color: var(--text-muted); margin-top: 1px; }
.notif-time  { font-size: .7rem; color: var(--text-muted); margin-top: 3px; }
.notif-del {
    background: none; border: none; padding: 0;
    color: var(--text-muted);
    line-height: 1; cursor: pointer;
    opacity: 0; transition: opacity .12s;
    font-size: .85rem; flex-shrink: 0;
}
.notif-item:hover .notif-del { opacity: 1; }
.notif-del:hover { color: #ef4444; }

@media (max-width: 480px) {
    .notif-panel { right: 0; left: 0; width: 100%; border-radius: 0; top: 60px; }
}
