/* ═══════════════════════════════════════════════════════════════
   Úlohový Portál v3.0 – Premium Light Widget Theme
   Systémová farba: #1a80b6
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg:             #f0f4f8;
    --bg-secondary:   #ffffff;
    --card-bg:        #ffffff;
    --card-bg-hover:  #f8fafc;
    --sidebar-bg:     #ffffff;
    --border:         #e2e8f0;
    --border-light:   #f1f5f9;
    --text:           #1e293b;
    --text-secondary: #64748b;
    --text-muted:     #94a3b8;
    --accent:         #1a80b6;
    --accent-hover:   #156a97;
    --accent-light:   #e8f4fd;
    --gradient:       linear-gradient(135deg, #1a80b6, #4facdb);
    --gradient-ok:    linear-gradient(135deg, #10b981, #34d399);
    --gradient-bad:   linear-gradient(135deg, #ef4444, #f87171);
    --gradient-warn:  linear-gradient(135deg, #f59e0b, #fbbf24);
    --gradient-subtle:linear-gradient(135deg, rgba(26,128,182,0.06), rgba(79,172,219,0.03));
    --shadow:         0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg:      0 4px 12px rgba(0,0,0,0.05), 0 16px 40px rgba(0,0,0,0.08);
    --shadow-card:    0 1px 3px rgba(0,0,0,0.03), 0 2px 8px rgba(0,0,0,0.04);
    --shadow-hover:   0 4px 16px rgba(26,128,182,0.12), 0 8px 24px rgba(0,0,0,0.08);
    --radius:         14px;
    --radius-sm:      10px;
    --radius-xs:      6px;
}

* { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior:smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══ Scrollbar ═══ */
::-webkit-scrollbar { width:7px; height:7px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:10px; }
::-webkit-scrollbar-thumb:hover { background:#94a3b8; }

/* ═══ Animations ═══ */
@keyframes fadeIn    { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
@keyframes fadeInUp  { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }
@keyframes scaleIn   { from{opacity:0;transform:scale(.96)} to{opacity:1;transform:scale(1)} }
@keyframes slideR    { from{opacity:0;transform:translateX(16px)} to{opacity:1;transform:translateX(0)} }
@keyframes slideDown { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }
@keyframes spin      { to{transform:rotate(360deg)} }
@keyframes shimmer   { 0%{background-position:-200% 0} 100%{background-position:200% 0} }
@keyframes pulse     { 0%,100%{opacity:1} 50%{opacity:.5} }

.fade-in    { animation:fadeIn .35s ease; }
.fade-in-up { animation:fadeInUp .4s ease; }
.scale-in   { animation:scaleIn .25s ease; }

/* ═══ Loading spinner ═══ */
.spinner {
    display:inline-block; width:20px; height:20px;
    border:2.5px solid var(--border);
    border-top-color:var(--accent);
    border-radius:50%;
    animation:spin .7s linear infinite;
}

/* ═══════════════════════════════════════════════
   PRELOADER
   ═══════════════════════════════════════════════ */
.preloader {
    display:flex; align-items:center; justify-content:center;
    min-height:100vh;
    background: radial-gradient(ellipse at 50% 40%, #1a2744 0%, #0f172a 60%, #070b14 100%);
    font-family:'Inter', sans-serif;
}
.preloader-inner {
    display:flex; flex-direction:column; align-items:center;
    animation: preloaderFadeIn .8s ease;
}
.preloader-logo-wrap {
    position:relative; width:160px; height:160px;
    margin-bottom:28px;
}
.preloader-logo {
    position:absolute; top:50%; left:50%;
    transform:translate(-50%,-50%);
    width:100px; height:100px; object-fit:contain;
    z-index:2;
    filter: drop-shadow(0 4px 20px rgba(26,128,182,0.4));
    animation: preloaderFloat 3s ease-in-out infinite;
}
.preloader-ring {
    position:absolute; inset:0;
    border:3px solid rgba(26,128,182,0.1);
    border-top-color:#1a80b6;
    border-right-color:rgba(79,172,219,0.4);
    border-radius:50%;
    animation: preloaderSpin 1.4s cubic-bezier(.5,.15,.5,.85) infinite;
}
.preloader-ring::before {
    content:''; position:absolute; inset:-8px;
    border:2px solid transparent;
    border-top-color: rgba(26,128,182,0.2);
    border-left-color: rgba(79,172,219,0.15);
    border-radius:50%;
    animation: preloaderSpin 3s linear infinite;
}
.preloader-ring::after {
    content:''; position:absolute; inset:8px;
    border:2px solid rgba(26,128,182,0.06);
    border-bottom-color:rgba(79,172,219,0.35);
    border-left-color:#1a80b6;
    border-radius:50%;
    animation: preloaderSpin 2s cubic-bezier(.5,.15,.5,.85) infinite reverse;
}
.preloader-text {
    font-size:16px; font-weight:800; letter-spacing:5px;
    background: linear-gradient(135deg, #fff 0%, #8ec8e8 50%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip:text; -webkit-text-fill-color:transparent;
    background-clip:text;
    animation: preloaderShimmer 3s linear infinite;
    margin-bottom:22px;
}
.preloader-dots {
    display:flex; gap:8px;
}
.preloader-dots span {
    width:7px; height:7px; border-radius:50%;
    background:#1a80b6;
    box-shadow: 0 0 8px rgba(26,128,182,0.5);
    animation: preloaderDot 1.4s ease-in-out infinite;
}
.preloader-dots span:nth-child(2) { animation-delay:.2s; }
.preloader-dots span:nth-child(3) { animation-delay:.4s; }

@keyframes preloaderFadeIn {
    from { opacity:0; transform:scale(.95) translateY(10px); }
    to { opacity:1; transform:scale(1) translateY(0); }
}
@keyframes preloaderSpin {
    to { transform:rotate(360deg); }
}
@keyframes preloaderFloat {
    0%, 100% { transform:translate(-50%,-50%) translateY(0); }
    50% { transform:translate(-50%,-50%) translateY(-6px); }
}
@keyframes preloaderShimmer {
    to { background-position:200% center; }
}
@keyframes preloaderDot {
    0%, 80%, 100% { transform:scale(.4); opacity:.3; }
    40% { transform:scale(1); opacity:1; }
}

/* ═══════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════ */
.login-screen {
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    min-height:100vh; padding:40px 20px;
    background: url('../../background.png') center/cover no-repeat fixed, linear-gradient(160deg, #e8f4fd 0%, #f0f4f8 40%, #fef3e2 100%);
    position: relative;
}
.login-screen::before {
    content:''; position:absolute; inset:0;
    background: rgba(15,23,42,0.35);
    backdrop-filter: blur(2px);
}
.login-card {
    width:100%; max-width:420px;
    background:rgba(255,255,255,0.92); backdrop-filter:blur(24px) saturate(180%);
    -webkit-backdrop-filter:blur(24px) saturate(180%);
    border:1px solid rgba(255,255,255,0.5); border-radius:24px;
    padding:44px 36px;
    box-shadow:0 25px 80px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.1) inset;
    animation:fadeInUp .6s cubic-bezier(.2,.8,.3,1);
    position:relative; z-index:1;
}
.login-card .brand-icon {
    width:auto; height:auto; border-radius:0;
    background:none; display:flex; align-items:center; justify-content:center;
    margin:0 auto 6px; box-shadow:none;
    overflow:visible;
}
.brand-logo-img {
    width:260px; height:auto; object-fit:contain;
    filter: drop-shadow(0 6px 24px rgba(26,128,182,0.25));
    margin-bottom:22px;
}
.login-card .brand-sub {
    font-size:13px; color:var(--text-muted); text-align:center; margin-bottom:20px;
    display:none;
}

/* Login disclaimer */
.login-disclaimer {
    max-width:440px; width:100%;
    margin-top:24px; padding:20px 24px;
    text-align:center;
    position:relative; z-index:1;
    background:rgba(0,0,0,0.35);
    backdrop-filter:blur(12px);
    border:1px solid rgba(255,255,255,0.08);
    border-radius:16px;
    box-shadow:0 4px 24px rgba(0,0,0,0.2);
}
.login-disclaimer p {
    font-size:10px; line-height:1.6;
    color:rgba(255,255,255,0.55);
    margin-bottom:8px;
}
.login-disclaimer strong {
    color:rgba(255,255,255,0.8);
}
.login-copyright {
    font-size:11px !important;
    font-weight:600;
    color:rgba(255,255,255,0.4) !important;
    letter-spacing:.5px;
}

/* ═══ Form elements ═══ */
.input-group       { margin-bottom:18px; }
.input-group label {
    display:block; font-size:12px; font-weight:600; color:var(--text-secondary);
    margin-bottom:6px; letter-spacing:.2px;
}

.input {
    width:100%; padding:11px 14px; font-size:13px;
    background:#fff; border:1.5px solid var(--border);
    border-radius:var(--radius-sm); color:var(--text); font-family:inherit;
    transition:all .2s; outline:none;
}
.input:focus {
    border-color:var(--accent);
    box-shadow:0 0 0 3px rgba(26,128,182,0.12);
    background:#fff;
}
.input::placeholder { color:var(--text-muted); }
textarea.input { resize:vertical; min-height:80px; }
select.input { cursor:pointer; background:#fff; }

.error-msg {
    background:#fef2f2; border:1px solid #fecaca;
    border-radius:var(--radius-sm); padding:10px 14px; margin-bottom:16px;
    font-size:12px; color:#dc2626; font-weight:500;
}

/* ═══ Buttons ═══ */
.btn {
    display:inline-flex; align-items:center; justify-content:center; gap:6px;
    padding:9px 18px; font-size:13px; font-weight:600;
    border:1.5px solid var(--border); border-radius:var(--radius-sm);
    background:#fff; color:var(--text-secondary);
    cursor:pointer; font-family:inherit; transition:all .2s;
    text-decoration:none; white-space:nowrap;
}
.btn:hover:not(:disabled) { background:#e2e8f0; color:var(--text); border-color:#94a3b8; }
.btn:active:not(:disabled) { transform:scale(.98); }
.btn:disabled { opacity:.5; cursor:not-allowed; }

.btn-primary {
    background:var(--gradient); border:none; color:#fff;
    box-shadow:0 2px 8px rgba(26,128,182,0.25);
}
.btn-primary:hover:not(:disabled) {
    background:linear-gradient(135deg, #156a99, #3a8fc0);
    box-shadow:0 4px 16px rgba(26,128,182,0.35);
    transform:translateY(-1px); color:#fff;
}

.btn-success {
    background:var(--gradient-ok); border:none; color:#fff;
    box-shadow:0 2px 8px rgba(16,185,129,0.25);
}
.btn-success:hover:not(:disabled) { background:linear-gradient(135deg, #0d9668, #28b882); box-shadow:0 4px 16px rgba(16,185,129,0.35); color:#fff; }

.btn-danger {
    background:var(--gradient-bad); border:none; color:#fff;
    box-shadow:0 2px 8px rgba(239,68,68,0.2);
}
.btn-danger:hover:not(:disabled) { background:linear-gradient(135deg, #d32f2f, #e25555); box-shadow:0 4px 16px rgba(239,68,68,0.3); color:#fff; }

.btn-ghost {
    background:transparent; border:none; color:var(--text-secondary); padding:8px 12px;
}
.btn-ghost:hover:not(:disabled) { background:rgba(26,128,182,0.15); color:#12648a; }

.btn-sm { padding:6px 12px; font-size:12px; border-radius:var(--radius-xs); }
.btn-xs { padding:4px 8px; font-size:11px; border-radius:var(--radius-xs); }
.btn-block { width:100%; }

.btn-icon {
    width:34px; height:34px; padding:0; border-radius:var(--radius-sm);
    display:inline-flex; align-items:center; justify-content:center;
    background:#fff; border:1.5px solid var(--border); font-size:15px;
    cursor:pointer; transition:all .15s; color:var(--text-secondary);
}
.btn-icon:hover { background:#e2e8f0; border-color:#94a3b8; }


/* ═══════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════ */
.app-layout { display:flex; min-height:100vh; }

/* ═══ Sidebar ═══ */
.sidebar {
    width:260px;
    background: linear-gradient(180deg, #0c1929 0%, #132d4a 40%, #0f2035 100%);
    border-right:none;
    display:flex; flex-direction:column;
    position:fixed; top:0; left:0; bottom:0; z-index:100;
    transition:transform .3s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}
.sidebar-brand {
    padding:20px 22px 16px;
    border-bottom:1px solid rgba(255,255,255,0.06);
    display:flex; flex-direction:column; align-items:center;
    gap:8px;
    background: rgba(255,255,255,0.03);
}
.sidebar-logo-img {
    width:180px; border-radius:8px; object-fit:contain;
    filter: drop-shadow(0 4px 12px rgba(26,128,182,0.3)) brightness(1.1);
}
.sidebar-brand-text {
    font-size:10px; font-weight:700; letter-spacing:3px;
    text-transform:uppercase; color:rgba(255,255,255,0.35);
}
.sidebar-nav  { flex:1; overflow-y:auto; padding:16px 12px; }
.nav-section  {
    font-size:9px; font-weight:700; text-transform:uppercase;
    color:rgba(255,255,255,0.25); letter-spacing:1.5px; padding:16px 14px 8px;
}

.nav-item {
    display:flex; align-items:center; gap:10px;
    padding:11px 14px; border-radius:var(--radius-sm);
    font-size:13px; font-weight:500; color:rgba(255,255,255,0.55);
    cursor:pointer; transition:all .2s; margin-bottom:3px; position:relative;
}
.nav-item:hover {
    background:rgba(26,128,182,0.15); color:rgba(255,255,255,0.9);
}
.nav-item.active {
    background: linear-gradient(135deg, rgba(26,128,182,0.25), rgba(79,172,219,0.1));
    color:#fff; font-weight:600;
    box-shadow: 0 2px 8px rgba(26,128,182,0.15);
}
.nav-item.active::before {
    content:''; position:absolute; left:0; top:50%; transform:translateY(-50%);
    width:3px; height:22px;
    background: linear-gradient(180deg, #4facdb, #1a80b6);
    border-radius:0 3px 3px 0;
    box-shadow: 0 0 8px rgba(26,128,182,0.4);
}
.nav-icon  { font-size:16px; width:20px; text-align:center; flex-shrink:0; }
.nav-badge {
    margin-left:auto; background:var(--gradient); color:#fff;
    font-size:10px; font-weight:700; padding:2px 8px; border-radius:10px;
    min-width:22px; text-align:center;
    box-shadow: 0 2px 6px rgba(26,128,182,0.35);
}

.sidebar-footer {
    padding:16px 20px;
    border-top:1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.15);
}

.user-block {
    display:flex; align-items:center; gap:10px; margin-bottom:10px;
}
.user-block .user-avatar {
    width:38px; height:38px; border-radius:12px;
    background:var(--gradient); display:flex; align-items:center; justify-content:center;
    font-size:14px; font-weight:700; color:#fff;
    box-shadow:0 2px 8px rgba(26,128,182,0.35);
    border: 2px solid rgba(255,255,255,0.1);
}
.user-block .user-name { font-size:13px; font-weight:600; color:rgba(255,255,255,0.9); }
.user-block .user-role {
    font-size:10px; color:rgba(255,255,255,0.4); font-weight:500;
    text-transform:uppercase; letter-spacing:.5px;
}

.server-status {
    display:flex; align-items:center; gap:8px;
    font-size:11px; color:rgba(255,255,255,0.4); font-weight:500;
}
.dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
.dot.green  { background:#10b981; box-shadow:0 0 8px rgba(16,185,129,0.5); }
.dot.red    { background:#ef4444; box-shadow:0 0 8px rgba(239,68,68,0.5); }

/* ═══ Main content ═══ */
.main-content {
    flex:1; margin-left:260px; min-height:100vh;
    display:flex; flex-direction:column;
}

/* Topbar */
.topbar {
    display:flex; align-items:center; justify-content:space-between;
    padding:16px 32px;
    background:rgba(255,255,255,0.78);
    border-bottom:1px solid rgba(226,232,240,0.5);
    position:sticky; top:0; z-index:50;
    backdrop-filter:blur(20px) saturate(180%);
    -webkit-backdrop-filter:blur(20px) saturate(180%);
}
.topbar-left  { display:flex; align-items:center; gap:14px; }
.topbar-left h2 { font-size:18px; font-weight:700; letter-spacing:-0.3px; }
.topbar-right { display:flex; align-items:center; gap:10px; }
.topbar-time  {
    font-size:12px; color:var(--text-muted); font-weight:500;
    padding:6px 12px; background:var(--bg); border-radius:var(--radius-xs);
}
.topbar-bell {
    position:relative; background:none; border:none; cursor:pointer;
    font-size:20px; padding:6px 8px; border-radius:var(--radius-xs);
    transition:background .2s;
    line-height:1;
}
.topbar-bell:hover { background:var(--bg); }
.topbar-bell-badge {
    position:absolute; top:0; right:0;
    background:linear-gradient(135deg,#ef4444,#dc2626); color:#fff;
    font-size:10px; font-weight:700; line-height:1;
    padding:2px 5px; border-radius:10px; min-width:16px; text-align:center;
    border:2px solid var(--card-bg);
    animation: bellPulse 2s ease-in-out infinite;
}
@keyframes bellPulse {
    0%, 100% { transform:scale(1); }
    50% { transform:scale(1.15); }
}
.hamburger {
    display:none; background:none; border:none; color:var(--text);
    font-size:22px; cursor:pointer; padding:4px;
}

/* Page */
.page-content { padding:28px 32px; flex:1; }


/* ═══════════════════════════════════════════════
   WIDGET STAT CARDS
   ═══════════════════════════════════════════════ */

.stats-row {
    display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; margin-bottom:20px;
}
.stat-card {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(8px);
    border:1px solid rgba(255,255,255,0.6); border-radius:var(--radius);
    padding:12px 16px; position:relative; overflow:hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 20px rgba(0,0,0,0.04);
    transition:all .25s cubic-bezier(.4,0,.2,1);
    display:flex; align-items:center; gap:12px;
}
.stat-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08), 0 0 0 1px rgba(26,128,182,0.08);
    transform:translateY(-3px);
}
.stat-card::before {
    content:''; position:absolute; top:0; left:0; right:0; height:3px;
}
.stat-card.blue::before  { background:var(--gradient); }
.stat-card.green::before { background:var(--gradient-ok); }
.stat-card.amber::before { background:var(--gradient-warn); }
.stat-card.red::before   { background:var(--gradient-bad); }

.stat-icon {
    width:36px; height:36px; border-radius:10px;
    display:flex; align-items:center; justify-content:center;
    font-size:18px; flex-shrink:0;
}
.stat-card.blue  .stat-icon { background:rgba(26,128,182,0.08); }
.stat-card.green .stat-icon { background:rgba(16,185,129,0.08); }
.stat-card.amber .stat-icon { background:rgba(245,158,11,0.08); }
.stat-card.red   .stat-icon { background:rgba(239,68,68,0.08); }

.stat-value {
    font-size:22px; font-weight:800;
    letter-spacing:-0.5px; color:var(--text);
    line-height:1; flex-shrink:0;
}
.stat-label { font-size:11px; color:var(--text-muted); font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }


/* ═══════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════ */
.badge {
    display:inline-flex; align-items:center; gap:4px;
    padding:3px 10px; border-radius:20px; font-size:11px; font-weight:600;
}
.badge-new      { background:rgba(26,128,182,0.08); color:#1a80b6; }
.badge-progress { background:rgba(245,158,11,0.08); color:#d97706; }
.badge-done     { background:rgba(16,185,129,0.08); color:#059669; }
.prio-low    { background:rgba(26,128,182,0.08); color:#1a80b6; }
.prio-medium { background:rgba(245,158,11,0.08); color:#d97706; }
.prio-high   { background:rgba(239,68,68,0.08); color:#dc2626; }


/* ═══════════════════════════════════════════════
   MODAL SYSTEM (Task Create/Edit + Detail + Confirm)
   ═══════════════════════════════════════════════ */

.modal-overlay {
    position:fixed; inset:0;
    background:rgba(15,23,42,0.3);
    backdrop-filter:blur(8px);
    display:flex; align-items:center; justify-content:center;
    z-index:9999; animation:fadeIn .15s;
}
.modal-card {
    background:rgba(255,255,255,0.96);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border:1px solid rgba(255,255,255,0.6);
    border-radius:20px; padding:0;
    width:540px; max-width:92vw;
    box-shadow:0 25px 80px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.03);
    animation:scaleIn .2s cubic-bezier(.4,0,.2,1); overflow:hidden;
}
.modal-card.modal-wide { width:680px; }
.modal-card.modal-detail {
    width:820px; max-height:88vh;
    display:flex; flex-direction:column;
}
.modal-header {
    padding:20px 26px; display:flex; align-items:center; gap:12px;
    background:var(--gradient-subtle); border-bottom:1px solid var(--border-light);
}
.modal-header h3 { font-size:16px; font-weight:700; flex:1; letter-spacing:-0.2px; }
.modal-body    { padding:24px 26px; }
.modal-footer  {
    padding:16px 26px; display:flex; gap:10px; justify-content:flex-end;
    border-top:1px solid var(--border-light); background:#fafbfc;
}

.modal-close {
    width:32px; height:32px; border-radius:8px;
    background:transparent; border:none; cursor:pointer;
    font-size:18px; color:var(--text-muted); transition:all .15s;
    display:flex; align-items:center; justify-content:center;
}
.modal-close:hover { background:rgba(0,0,0,0.05); color:var(--text); }


/* ═══════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════ */

.toast-wrap {
    position:fixed; top:20px; right:20px; z-index:10000;
    display:flex; flex-direction:column; gap:8px;
}
.toast {
    padding:12px 18px; border-radius:var(--radius-sm);
    font-size:13px; font-weight:500;
    background:#fff; border:1px solid var(--border);
    box-shadow:0 8px 24px rgba(0,0,0,0.1);
    animation:slideR .3s ease; display:flex; align-items:center; gap:8px;
    min-width:260px; max-width:400px;
}
.toast-success { border-left:3px solid #10b981; }
.toast-error   { border-left:3px solid #ef4444; }
.toast-info    { border-left:3px solid #1a80b6; }


/* ═══════════════════════════════════════════════
   TOOLBAR / FILTERS
   ═══════════════════════════════════════════════ */

.toolbar {
    display:flex; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap;
}
.toolbar .search { flex:1; min-width:200px; }

.chips   { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:20px; }
.chip {
    padding:6px 16px; border-radius:20px; font-size:12px; font-weight:600; cursor:pointer;
    border:1.5px solid var(--border); background:#fff; color:var(--text-secondary);
    transition:all .15s; box-shadow:0 1px 2px rgba(0,0,0,0.03);
}
.chip:hover { border-color:#cbd5e1; background:#f8fafc; }
.chip.active {
    background:var(--accent-light); color:var(--accent);
    border-color:rgba(26,128,182,0.3);
    box-shadow:0 1px 4px rgba(26,128,182,0.1);
}


/* ═══════════════════════════════════════════════
   EMPTY / LOADING
   ═══════════════════════════════════════════════ */

.empty { text-align:center; padding:60px 20px; }
.empty .empty-icon  { font-size:48px; margin-bottom:16px; opacity:.6; }
.empty .empty-title { font-size:16px; font-weight:600; color:var(--text-secondary); margin-bottom:6px; }
.empty .empty-text  { font-size:13px; color:var(--text-muted); }
.loading {
    display:flex; align-items:center; justify-content:center; gap:12px;
    padding:60px; color:var(--text-muted); font-size:14px;
}


/* ═══════════════════════════════════════════════
   TASK CARD GRID
   ═══════════════════════════════════════════════ */

.task-grid {
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(310px, 1fr));
    gap:16px;
}

.task-card {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    border:1.5px solid rgba(255,255,255,0.6);
    border-radius:var(--radius);
    padding:18px;
    cursor:pointer;
    transition:all .25s cubic-bezier(.4,0,.2,1);
    position:relative;
    overflow:hidden;
    display:flex;
    flex-direction:column;
    gap:10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
}
.task-card:hover {
    border-color:rgba(26,128,182,0.15);
    transform:translateY(-3px) scale(1.005);
    box-shadow: 0 12px 40px rgba(26,128,182,0.1), 0 4px 16px rgba(0,0,0,0.06);
}
.task-card.task-card-done { opacity:.65; }
.task-card.task-card-done:hover { opacity:.8; }

/* Priority left border */
.task-card.prio-border-high   { border-left:3px solid #ef4444; }
.task-card.prio-border-medium { border-left:3px solid #f59e0b; }
.task-card.prio-border-low    { border-left:3px solid #1a80b6; }

.tc-top {
    display:flex; justify-content:space-between; align-items:center;
}
.tc-title {
    font-size:14px; font-weight:700; color:var(--text); line-height:1.4;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.tc-desc {
    font-size:12px; color:var(--text-muted); line-height:1.5;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.tc-meta-row {
    display:flex; justify-content:space-between; align-items:center;
    flex-wrap:wrap; gap:6px;
}
.tc-tags { display:flex; gap:4px; flex-wrap:wrap; }

.tc-check-row { display:flex; align-items:center; gap:8px; }

.tc-footer {
    display:flex; align-items:center; gap:10px;
    padding-top:10px; border-top:1px solid var(--border-light); margin-top:auto;
}
.tc-counter {
    font-size:11px; color:var(--text-muted); font-weight:500;
    display:flex; align-items:center; gap:3px;
}
.tc-date { font-size:10px; color:var(--text-muted); margin-left:auto; }


/* ═══════════════════════════════════════════════
   TASK DETAIL MODAL
   ═══════════════════════════════════════════════ */

.detail-modal-header {
    padding:24px 28px 20px;
    border-bottom:1px solid var(--border-light);
    background:var(--gradient-subtle);
}
.detail-modal-title {
    font-size:20px; font-weight:700; color:var(--text);
    margin-bottom:10px; line-height:1.35; letter-spacing:-0.3px;
}
.detail-badges { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.detail-close {
    position:absolute; top:18px; right:18px;
    width:36px; height:36px; border-radius:10px;
    background:rgba(0,0,0,0.04); border:none; cursor:pointer;
    font-size:18px; color:var(--text-muted); transition:all .15s;
    display:flex; align-items:center; justify-content:center;
}
.detail-close:hover { background:rgba(0,0,0,0.08); color:var(--text); }

.detail-meta-grid {
    padding:18px 28px;
    display:grid; grid-template-columns:1fr 1fr; gap:14px;
    border-bottom:1px solid var(--border-light);
    background:#fafbfc;
}
.meta-item { display:flex; flex-direction:column; gap:3px; }
.meta-item-label {
    font-size:10px; font-weight:700; color:var(--text-muted);
    text-transform:uppercase; letter-spacing:.6px;
}
.meta-item-value {
    font-size:13px; font-weight:500; color:var(--text-secondary);
    display:flex; align-items:center; gap:6px;
}

/* Detail tabs */
.detail-tabs {
    display:flex; overflow-x:auto; border-bottom:1px solid var(--border-light);
    padding:0 20px; background:#fff;
}
.detail-tab {
    padding:12px 16px; font-size:12px; font-weight:600;
    color:var(--text-muted); cursor:pointer;
    border:none; background:none; font-family:inherit;
    border-bottom:2.5px solid transparent;
    transition:all .15s; white-space:nowrap;
    display:flex; align-items:center; gap:5px;
}
.detail-tab:hover { color:var(--text-secondary); }
.detail-tab.active { color:var(--accent); border-bottom-color:var(--accent); }

.tab-badge {
    background:var(--accent-light); color:var(--accent);
    font-size:9px; font-weight:700;
    padding:2px 7px; border-radius:10px;
}

.detail-tab-content {
    flex:1; padding:20px 28px; overflow-y:auto;
}

.detail-actions-bar {
    display:flex; gap:8px; padding:16px 28px;
    justify-content:space-between; align-items:center;
    border-top:1px solid var(--border-light); background:#fafbfc;
}
.detail-actions-left { display:flex; gap:6px; }
.detail-actions-right { display:flex; gap:6px; }


/* ═══════════════════════════════════════════════
   USER CHIPS / AVATARS
   ═══════════════════════════════════════════════ */

.user-chip {
    display:inline-flex; align-items:center; gap:6px;
    padding:3px 10px 3px 3px;
    background:var(--accent-light); border-radius:20px;
    font-size:12px; font-weight:500; color:var(--accent);
}
.user-chip-sm {
    display:inline-flex; align-items:center; gap:4px;
    font-size:11px; font-weight:600; color:var(--text-secondary);
}

.avatar-mini {
    width:22px; height:22px; border-radius:50%;
    display:inline-flex; align-items:center; justify-content:center;
    font-size:10px; font-weight:700; color:#fff; flex-shrink:0;
}
.avatar-mini-xs {
    width:18px; height:18px; border-radius:50%;
    display:inline-flex; align-items:center; justify-content:center;
    font-size:8px; font-weight:700; color:#fff; flex-shrink:0;
}


/* ═══════════════════════════════════════════════
   TAGS
   ═══════════════════════════════════════════════ */

.tag-chip {
    display:inline-flex; align-items:center;
    padding:2px 10px; border-radius:12px;
    font-size:11px; font-weight:600;
    background:rgba(26,128,182,0.06); color:var(--accent);
}
.tag-chip-sm {
    display:inline-flex; align-items:center;
    padding:2px 7px; border-radius:10px;
    font-size:10px; font-weight:600;
    background:rgba(26,128,182,0.06); color:var(--accent);
}


/* ═══════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════ */

.progress-bar-wrap {
    height:6px; background:#e2e8f0;
    border-radius:3px; overflow:hidden;
}
.progress-bar-wrap-sm {
    height:4px; background:#e2e8f0;
    border-radius:2px; overflow:hidden; flex:1;
}
.progress-bar-fill {
    height:100%; border-radius:inherit;
    background:var(--gradient);
    transition:width .3s ease;
    min-width:0;
}


/* ═══════════════════════════════════════════════
   COMMENTS
   ═══════════════════════════════════════════════ */

.comment-list { margin-bottom:16px; }
.comment-item {
    padding:14px 0;
    border-bottom:1px solid var(--border-light);
}
.comment-item:last-child { border-bottom:none; }
.comment-header {
    display:flex; align-items:center; gap:8px; margin-bottom:8px;
}
.comment-author { font-size:13px; font-weight:600; color:var(--text); }
.comment-date   { font-size:10px; color:var(--text-muted); }
.comment-delete {
    margin-left:auto; background:none; border:none; cursor:pointer;
    font-size:12px; opacity:.3; transition:opacity .15s; padding:2px 4px;
    color:var(--text-muted);
}
.comment-delete:hover { opacity:1; color:#ef4444; }
.comment-body {
    font-size:13px; color:var(--text-secondary); line-height:1.65;
    white-space:pre-wrap; word-break:break-word; padding-left:30px;
}
.comment-input-area { padding-top:14px; border-top:1px solid var(--border-light); }

.mention {
    color:var(--accent); font-weight:600;
    background:var(--accent-light); padding:1px 5px; border-radius:4px;
}


/* ═══════════════════════════════════════════════
   ATTACHMENTS
   ═══════════════════════════════════════════════ */

.attachment-list { display:flex; flex-direction:column; gap:8px; }
.attachment-item {
    display:flex; align-items:center; gap:12px;
    padding:12px 14px;
    background:#fafbfc;
    border:1px solid var(--border-light);
    border-radius:var(--radius-sm);
    transition:all .15s;
}
.attachment-item:hover { background:var(--accent-light); border-color:rgba(26,128,182,0.15); }
.att-icon { font-size:26px; flex-shrink:0; }
.att-info { flex:1; min-width:0; }
.att-name {
    font-size:12px; font-weight:600; color:var(--text);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.att-meta { font-size:10px; color:var(--text-muted); margin-top:2px; }
.att-actions { display:flex; gap:4px; flex-shrink:0; }


/* ═══════════════════════════════════════════════
   UPLOAD DROP ZONE
   ═══════════════════════════════════════════════ */

.upload-zone {
    border:2px dashed var(--border);
    border-radius:var(--radius-sm);
    padding:24px;
    text-align:center;
    cursor:pointer;
    transition:all .2s;
    margin-bottom:14px;
    background:#fafbfc;
}
.upload-zone:hover,
.upload-zone.drag-over {
    border-color:var(--accent);
    background:var(--accent-light);
}
.upload-zone .upload-icon { font-size:32px; margin-bottom:8px; opacity:.5; }
.upload-zone .upload-text { font-size:12px; color:var(--text-muted); font-weight:500; }
.upload-zone .upload-hint { font-size:10px; color:var(--text-muted); margin-top:4px; }


/* ═══════════════════════════════════════════════
   CHECKLIST
   ═══════════════════════════════════════════════ */

.checklist-items { display:flex; flex-direction:column; gap:2px; }
.checklist-item {
    display:flex; align-items:center;
    padding:8px 10px; border-radius:var(--radius-xs);
    transition:background .15s;
}
.checklist-item:hover { background:#f8fafc; }
.checklist-item.checked { opacity:.55; }
.check-label {
    display:flex; align-items:center; gap:10px; flex:1;
    cursor:pointer; font-size:13px;
}
.check-label input[type="checkbox"] {
    width:17px; height:17px; accent-color:var(--accent);
    cursor:pointer; flex-shrink:0;
}
.check-text { color:var(--text-secondary); font-weight:500; }
.checklist-item.checked .check-text {
    text-decoration:line-through; color:var(--text-muted);
}
.check-delete {
    background:none; border:none; cursor:pointer;
    color:var(--text-muted); font-size:14px; padding:4px 6px;
    opacity:0; transition:opacity .15s;
}
.checklist-item:hover .check-delete { opacity:.5; }
.check-delete:hover { opacity:1 !important; color:#ef4444; }


/* ═══════════════════════════════════════════════
   HISTORY TIMELINE
   ═══════════════════════════════════════════════ */

.history-list {
    display:flex; flex-direction:column;
    position:relative; padding-left:22px;
}
.history-list::before {
    content:''; position:absolute; left:5px; top:0; bottom:0;
    width:2px; background:var(--border);
}
.history-item {
    display:flex; gap:12px; padding:10px 0;
    position:relative;
}
.history-dot {
    width:10px; height:10px; border-radius:50%;
    background:var(--accent); flex-shrink:0;
    position:absolute; left:-21px; top:14px;
    border:2px solid #fff; box-shadow:0 0 0 2px var(--border);
}
.history-content { flex:1; min-width:0; }
.history-text {
    font-size:12px; color:var(--text-secondary); line-height:1.5;
}
.history-details {
    font-size:11px; color:var(--text-muted); margin-top:2px;
    font-style:italic;
}
.history-date {
    font-size:10px; color:var(--text-muted); margin-top:2px;
}


/* ═══════════════════════════════════════════════
   CONTENT SECTION STYLING
   ═══════════════════════════════════════════════ */

.content-section {
    margin-bottom:18px;
}
.content-section-label {
    font-size:10px; font-weight:700; color:var(--text-muted);
    text-transform:uppercase; letter-spacing:.6px; margin-bottom:6px;
}
.content-block {
    font-size:13px; color:var(--text); line-height:1.7;
    white-space:pre-wrap;
    padding:14px 16px; border-radius:var(--radius-sm);
    background:#fafbfc; border:1px solid var(--border-light);
}
.internal-note-block {
    background:#fffbeb; border:1px solid #fde68a;
    padding:12px 14px; border-radius:var(--radius-sm);
    font-size:13px; color:#92400e; line-height:1.6; white-space:pre-wrap;
}

/* Percent slider */
.pct-slider {
    width:80px; accent-color:var(--accent);
    cursor:pointer;
}


/* ═══════════════════════════════════════════════
   ONLINE / ACTIVITY INDICATORS
   ═══════════════════════════════════════════════ */

@keyframes onlinePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
    50% { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

.online-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.online-dot-on {
    background: #22c55e;
    animation: onlinePulse 2s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(34,197,94,0.5);
}
.online-dot-off {
    background: #d1d5db;
}
.online-dot-away {
    background: #f59e0b;
    box-shadow: 0 0 4px rgba(245,158,11,0.3);
}

.activity-text {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.3;
}
.activity-text-online {
    color: #16a34a;
    font-weight: 600;
}

.login-source-icon {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--border-light);
    color: var(--text-muted);
    font-weight: 500;
}


/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media(max-width:768px) {
    .sidebar { transform:translateX(-100%); }
    .sidebar.open { transform:translateX(0); box-shadow:8px 0 32px rgba(0,0,0,0.2); }
    .main-content { margin-left:0; }
    .hamburger { display:block; }
    .page-content { padding:16px; }
    .topbar { padding:12px 16px; }
    .stats-row { grid-template-columns:repeat(2,1fr); }
    .login-card { padding:32px 20px; }
    .task-grid { grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); }
    .modal-card.modal-detail { width:95vw; max-height:92vh; }
    .detail-meta-grid { grid-template-columns:1fr; }
    .detail-tab-content { padding:16px; }
    .user-table-wrap { margin:0 -16px; }
    .user-table th, .user-table td { padding:10px 12px; font-size:12px; }
}

@media(max-width:480px) {
    .stats-row { grid-template-columns:1fr; }
    .task-grid { grid-template-columns:1fr; }
    .detail-tabs { gap:0; }
    .detail-tab { padding:10px 10px; font-size:11px; }
    .detail-modal-header { padding:18px 18px 14px; }
    .detail-meta-grid { padding:14px 18px; }
    .detail-tab-content { padding:14px 18px; }
}


/* ═══════════════════════════════════════════════════════════
   Users Management Table
   ═══════════════════════════════════════════════════════════ */

.user-table-wrap {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 30px rgba(0,0,0,0.05);
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.user-table thead {
    background: var(--border-light);
}

.user-table th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.user-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.user-table tbody tr:hover {
    background: rgba(26,128,182,0.03);
}

.user-table tbody tr:last-child td {
    border-bottom: none;
}

.inactive-row {
    opacity: 0.5;
}

.inactive-row:hover {
    opacity: 0.75;
}

/* Role badges */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.role-super {
    background: linear-gradient(135deg, rgba(220,38,38,0.08), rgba(220,38,38,0.04));
    color: #dc2626;
    border: 1px solid rgba(220,38,38,0.15);
}

.role-admin {
    background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(245,158,11,0.04));
    color: #d97706;
    border: 1px solid rgba(245,158,11,0.15);
}

.role-user {
    background: linear-gradient(135deg, rgba(26,128,182,0.08), rgba(26,128,182,0.04));
    color: #1a80b6;
    border: 1px solid rgba(26,128,182,0.15);
}


/* ═══════════════════════════════════════════════════════════
   Audit Logs
   ═══════════════════════════════════════════════════════════ */

.log-table td {
    padding: 10px 16px;
}

.log-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
    white-space: nowrap;
}

.log-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.avatar-mini-xs {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════
   Roles & Permissions Page
   ═══════════════════════════════════════════════════════════ */

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.role-card {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: box-shadow .2s, border-color .2s;
}
.role-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}
.role-card-system {
    border-left: 4px solid var(--accent);
}

.role-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.role-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 1.5px solid;
    flex-shrink: 0;
}
.role-card-info {
    flex: 1;
    min-width: 0;
}
.role-card-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}
.role-card-slug {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.role-card-slug code {
    font-size: 11px;
    background: var(--border-light);
    color: var(--text-muted);
    padding: 1px 6px;
    border-radius: 4px;
}
.role-system-tag {
    font-size: 9px;
    font-weight: 800;
    color: var(--accent);
    background: var(--accent-light);
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.role-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.role-card-stats {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 12px;
}
.role-card-stat {
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.role-stat-value {
    font-weight: 800;
    font-size: 18px;
    color: var(--text);
}
.role-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.role-card-perms {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.role-perm-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    background: var(--border-light);
    color: var(--text-secondary);
    cursor: default;
}
.role-perm-chip-count {
    font-weight: 700;
    color: var(--accent);
    font-size: 10px;
}

/* Permission groups in role modal */
.perm-group {
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.perm-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--border-light);
    cursor: pointer;
    user-select: none;
    transition: background .15s;
}
.perm-group-header:hover {
    background: #e2e8f0;
}
.perm-group-check {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--accent);
}
.perm-group-icon {
    font-size: 15px;
}
.perm-group-label {
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    flex: 1;
}
.perm-group-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.perm-list {
    padding: 4px 0;
}
.perm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 42px;
    cursor: pointer;
    transition: background .1s;
    font-size: 13px;
    color: var(--text-secondary);
}
.perm-item:hover {
    background: rgba(26,128,182,0.04);
}
.perm-item.perm-active {
    color: var(--text);
    font-weight: 500;
}
.perm-item input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.perm-item-label {
    flex: 1;
}
.perm-item-key {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--border-light);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
}

@media (max-width: 640px) {
    .roles-grid { grid-template-columns: 1fr; }
}


/* ═══════════════════════════════════════════════════════
   LIGHTBOX — Prehliadač obrázkov a PDF
   ═══════════════════════════════════════════════════════ */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease;
}
.lightbox-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}
.lightbox-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    flex-shrink: 0;
    z-index: 2;
}
.lightbox-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.lightbox-filename {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}
.lightbox-counter {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    white-space: nowrap;
}
.lightbox-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.lightbox-btn {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.lightbox-btn:hover {
    background: rgba(255,255,255,0.25);
}
.lightbox-close-btn {
    font-size: 18px;
    font-weight: 700;
    padding: 4px 10px;
}
.lightbox-zoom-label {
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    font-weight: 600;
    min-width: 42px;
    text-align: center;
}

.lightbox-content {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
}
.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    width: 48px;
    height: 60px;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 12px;
    z-index: 3;
    transition: background 0.15s;
    user-select: none;
}
.lightbox-arrow:hover {
    background: rgba(255,255,255,0.2);
}
.lightbox-arrow-left { left: 16px; }
.lightbox-arrow-right { right: 16px; }

.lightbox-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.lightbox-img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
    -webkit-user-drag: none;
}
.lightbox-pdf {
    width: 90%;
    height: 100%;
    border: none;
    border-radius: 8px;
    background: #fff;
}

.lightbox-thumbs {
    display: flex;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(0,0,0,0.6);
    overflow-x: auto;
    flex-shrink: 0;
    justify-content: center;
}
.lightbox-thumb {
    width: 52px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.5;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
}
.lightbox-thumb:hover { opacity: 0.8; }
.lightbox-thumb-active {
    border-color: var(--accent);
    opacity: 1;
}
.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lightbox-thumb-icon {
    font-size: 18px;
}

/* Attachment thumbnail in list */
.att-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
}
.att-previewable {
    cursor: pointer;
}
.att-previewable:hover {
    background: rgba(26,128,182,0.06);
    border-color: var(--accent);
}
.att-preview-hint {
    color: var(--accent);
    font-weight: 500;
}


/* ═══════════════════════════════════════════════════════
   MESSAGES — Správy medzi používateľmi
   ═══════════════════════════════════════════════════════ */

.page-content-messages {
    padding: 0 !important;
    height: calc(100vh - 56px);
    overflow: hidden;
}

.messages-layout {
    display: flex;
    height: 100%;
    min-height: 0;
}

/* Sidebar */
.msg-sidebar {
    width: 320px;
    min-width: 280px;
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    background: #fff;
    flex-shrink: 0;
}
.msg-sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.msg-sidebar-header h3 {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
}
.msg-unread-badge {
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}
.nav-badge-msg {
    background: #8b5cf6 !important;
}

/* New message panel */
.msg-new-panel {
    padding: 8px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg);
}
.msg-new-panel .input {
    margin-bottom: 6px;
}
.msg-user-list {
    max-height: 200px;
    overflow-y: auto;
}
.msg-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.1s;
}
.msg-user-item:hover {
    background: rgba(26,128,182,0.08);
}
.msg-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.msg-user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Conversation list */
.msg-conv-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}
.msg-conv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.1s;
}
.msg-conv-item:hover {
    background: rgba(26,128,182,0.06);
}
.msg-conv-active {
    background: rgba(26,128,182,0.1) !important;
}
.msg-conv-unread {
    font-weight: 600;
}
.msg-conv-info {
    flex: 1;
    min-width: 0;
}
.msg-conv-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}
.msg-conv-unread-count {
    background: #8b5cf6;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 0px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}
.msg-conv-preview {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.msg-conv-time {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Main message area */
.msg-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}
.msg-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    gap: 8px;
}
.msg-empty h3 {
    color: var(--text-secondary);
    font-weight: 700;
    margin: 0;
}
.msg-empty p {
    font-size: 13px;
    margin: 0;
}

.msg-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    background: #fff;
    flex-shrink: 0;
}
.msg-back-btn {
    display: none;
}
.msg-header-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.msg-header-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Messages */
.msg-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.msg-date-sep {
    text-align: center;
    padding: 12px 0 6px;
}
.msg-date-sep span {
    background: var(--border-light);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 14px;
    border-radius: 20px;
}

.msg-bubble-wrap {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    max-width: 75%;
}
.msg-mine {
    align-self: flex-end;
}
.msg-theirs {
    align-self: flex-start;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
    max-width: 100%;
}
.msg-bubble-mine {
    background: linear-gradient(135deg, var(--accent), #4facdb);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.msg-bubble-theirs {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border-light);
    border-bottom-left-radius: 4px;
}
.msg-bubble-text {
    white-space: pre-wrap;
}
.msg-bubble-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}
.msg-read-status {
    font-size: 11px;
}

.msg-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}
.msg-bubble-wrap:hover .msg-delete-btn {
    opacity: 0.5;
}
.msg-delete-btn:hover {
    opacity: 1 !important;
}

/* Input area */
.msg-input-area {
    display: flex;
    flex-direction: column;
    padding: 10px 16px 12px;
    border-top: 1px solid var(--border-light);
    background: #fff;
    flex-shrink: 0;
    gap: 6px;
}
.msg-input-row {
    width: 100%;
}
.msg-input {
    width: 100%;
    resize: none;
    min-height: 38px;
    max-height: 120px;
    box-sizing: border-box;
}
.msg-input-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.msg-toolbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
}
.msg-toolbar-btn {
    background: none;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    transition: background .2s, border-color .2s;
    line-height: 1;
}
.msg-toolbar-btn:hover {
    background: var(--bg);
    border-color: var(--accent);
}
.msg-send-btn {
    flex-shrink: 0;
    height: 34px;
    font-size: 13px;
}

/* Emoji picker */
.msg-emoji-wrap {
    position: relative;
}
.msg-emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 6px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
    width: 240px;
    z-index: 100;
    animation: fadeIn .15s ease;
}
.msg-emoji-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-xs);
    transition: background .15s;
    line-height: 1;
}
.msg-emoji-btn:hover {
    background: var(--bg);
}

/* File preview bar */
.msg-file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg);
    border-radius: var(--radius-xs);
    font-size: 12px;
}
.msg-file-icon { font-size: 16px; flex-shrink: 0; }
.msg-file-name {
    flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--text);
    font-weight: 500;
}
.msg-file-remove {
    background: none; border: none; cursor: pointer; color: var(--text-muted);
    font-size: 14px; padding: 2px 4px; border-radius: 4px;
    transition: color .2s, background .2s;
}
.msg-file-remove:hover { color: var(--danger); background: rgba(239,68,68,.1); }

/* Message attachments */
.msg-attachment {
    margin-bottom: 4px;
}
.msg-att-img-link {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    max-width: 280px;
}
.msg-att-img {
    display: block;
    max-width: 100%;
    max-height: 240px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    transition: opacity .2s;
}
.msg-att-img:hover { opacity: .9; }
.msg-att-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--radius-xs);
    text-decoration: none;
    color: inherit;
    font-size: 12px;
    transition: background .2s;
}
.msg-bubble-theirs .msg-att-file {
    background: var(--bg);
    border-color: var(--border-light);
}
.msg-att-file:hover { background: rgba(255,255,255,.25); }
.msg-bubble-theirs .msg-att-file:hover { background: var(--border-light); }
.msg-att-icon { font-size: 18px; flex-shrink: 0; }
.msg-att-name {
    flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-weight: 500;
}
.msg-att-size {
    font-size: 10px;
    opacity: .7;
    flex-shrink: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .msg-sidebar {
        width: 100%;
        min-width: 100%;
    }
    .messages-layout {
        flex-direction: column;
    }
    .msg-main {
        position: fixed;
        inset: 0;
        z-index: 100;
        display: none;
    }
    .messages-layout:has(.msg-header) .msg-sidebar {
        display: none;
    }
    .messages-layout:has(.msg-header) .msg-main {
        display: flex;
    }
    .msg-back-btn {
        display: flex !important;
    }
    .msg-bubble-wrap {
        max-width: 88%;
    }
    .lightbox-arrow { width: 36px; height: 44px; font-size: 24px; }
    .lightbox-arrow-left { left: 6px; }
    .lightbox-arrow-right { right: 6px; }
    .lightbox-filename { max-width: 150px; }
}

/* ════════════════════════════════════════════════════════════════
   SETTINGS PAGE
   ════════════════════════════════════════════════════════════════ */
.settings-page {
    max-width: 700px;
    margin: 0 auto;
}
.settings-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding: 24px;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.settings-header-icon {
    font-size: 36px;
    line-height: 1;
}
.settings-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px;
}
.settings-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}
.settings-section {
    margin-bottom: 20px;
}
.settings-section-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-left: 4px;
}
.settings-toggles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.settings-toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
}
.settings-toggle-card.active {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 4%, var(--card));
}
.settings-toggle-info {
    display: flex;
    align-items: center;
    gap: 14px;
}
.settings-toggle-icon {
    font-size: 26px;
    line-height: 1;
    width: 36px;
    text-align: center;
}
.settings-toggle-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.settings-toggle-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 13px;
    background: #c4c9d2;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.25s;
}
.toggle-switch.on {
    background: var(--primary);
}
.toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.25s;
}
.toggle-switch.on .toggle-knob {
    transform: translateX(20px);
}

.settings-hint {
    margin-top: 20px;
    padding: 14px 18px;
    font-size: 13px;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--primary) 5%, var(--bg));
    border-radius: var(--radius);
    border: 1px dashed var(--border);
    line-height: 1.5;
}

/* Settings checkbox card */
.settings-checkbox-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}
.settings-checkbox-card:hover {
    border-color: var(--primary);
}
.settings-checkbox-info {
    display: flex;
    align-items: center;
    gap: 14px;
}
.settings-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid #c4c9d2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    transition: all 0.2s;
}
.settings-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}
