/* Egyedi stílusok a Tailwind alapok mellé */

/* Mindig nyerjen a hidden osztály (a saját display:flex szabályokkal szemben is) */
.hidden { display: none !important; }

/* ===== Sötét mód ===== */
body.dark {
  color-scheme: dark;
}
body.dark,
body.dark #main {
  background: linear-gradient(180deg, #0f172a 0%, #111c33 100%);
}
body.dark .auth-view {
  background:
    radial-gradient(60% 60% at 20% 10%, #1e293b 0%, transparent 60%),
    radial-gradient(50% 50% at 90% 90%, #1e3a5f 0%, transparent 60%),
    linear-gradient(180deg, #0f172a 0%, #111c33 100%);
}
body.dark .tab-btn.active { background: #1e293b; color: #f1f5f9; }
body.dark #sidebar { background: #0f172a; border-color: #1e293b; }
body.dark .sidebar-header { border-color: #1e293b; }
body.dark .side-section-head:hover { background: #1e293b; }
body.dark .bg-white { background-color: #1e293b; }
body.dark .bg-slate-100 { background-color: #334155; }
body.dark .bg-blue-50 { background-color: #1e3a5f; }
body.dark .bg-red-50 { background-color: #450a0a; }
body.dark .bg-blue-600 { background-color: #2563eb; }
body.dark .bg-blue-700 { background-color: #1d4ed8; }
body.dark .text-slate-900 { color: #f1f5f9; }
body.dark .text-slate-800 { color: #e2e8f0; }
body.dark .text-slate-700 { color: #cbd5e1; }
body.dark .text-slate-600 { color: #94a3b8; }
body.dark .text-slate-500 { color: #94a3b8; }
body.dark .text-slate-400 { color: #94a3b8; }
body.dark .text-blue-700,
body.dark .text-blue-800,
body.dark .text-blue-600 { color: #93c5fd; }
body.dark .border-slate-100,
body.dark .border-slate-200 { border-color: #1e293b; }
body.dark .border-slate-300 { border-color: #334155; }
body.dark .shadow-slate-200,
body.dark .shadow-slate-200\/60 { --tw-shadow-color: rgba(0,0,0,.4); }
body.dark .filter-btn { color: #cbd5e1; }
body.dark .filter-btn:hover { background: #1e293b; }
body.dark .filter-btn.active { background: #1e3a5f; color: #93c5fd; }
body.dark .filter-btn .count { color: #64748b; }
body.dark .filter-btn.active .count { color: #60a5fa; }
body.dark .task { background: #1e293b; border-color: #334155; }
body.dark .task:hover { border-color: #3b82f6; }
body.dark .task.overdue { background: #3a1d1d; border-color: #ef4444; }
body.dark .task-title { color: #f1f5f9; }
body.dark .task-desc { color: #94a3b8; }
body.dark .task-subs { color: #94a3b8; }
body.dark .meta-due { color: #94a3b8; }
body.dark .badge { background: #1e3a5f; color: #93c5fd; }
body.dark .modal-card { background: #1e293b; border-color: #334155; }
body.dark .inp { background: #0f172a; border-color: #334155; color: #f1f5f9; }
body.dark .file-row { background: #0f172a; border-color: #334155; }
body.dark .file-thumb { background: #0f172a; border-color: #334155; }
body.dark .file-link { color: #60a5fa; }
body.dark .empty { color: #64748b; }
body.dark .avatar-row .avatar { box-shadow: 0 0 0 2px #1e293b; }
body.dark .icon-btn:hover { background: #1e293b; color: #f1f5f9; }
body.dark .subtask-remove { color: #94a3b8; }
body.dark .side-act:hover { background: #1e3a5f; color: #93c5fd; }
body.dark #btn-enable-push { background: #1e3a5f; color: #93c5fd; }
body.dark .btn-danger { background: #1e293b; color: #f87171; border-color: #7f1d1d; }
body.dark .btn-danger:hover { background: #3a1d1d; }
body.dark .theme-opt { border-color: #334155 !important; background: #1e293b !important; }
body.dark .theme-opt span { color: #e2e8f0 !important; }
body.dark #add-user-form { background: #0f172a !important; border-color: #334155 !important; }
body.dark .filter-btn .dot { background: #475569; }
body.dark .file-ico { filter: invert(.7); }
body.dark ::-webkit-scrollbar-thumb { background: #334155; }
@media (min-width: 769px) {
  body.sidebar-collapsed #sidebar { display: none; }
}

/* Auth nézet háttér */
.auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    radial-gradient(60% 60% at 20% 10%, #dbeafe 0%, transparent 60%),
    radial-gradient(50% 50% at 90% 90%, #bfdbfe 0%, transparent 60%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

/* Auth tabok */
.tab-btn.active { background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgba(15,23,42,.08); }

/* Profilkép kör */
.avatar {
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.6), 0 1px 2px rgba(15,23,42,.15);
}
.avatar-row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  vertical-align: middle;
}
.avatar-row .avatar { box-shadow: 0 0 0 2px #fff; }

/* App elrendezés */
.app-view {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

#main {
  overflow-y: auto;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

/* Gombok */
.btn {
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
}
.btn-primary { background: #2563eb; color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.25); }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { background: #fff; color: #dc2626; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }

/* Inputok */
.inp {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font-size: 15px;
}
.inp:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }

/* Sidebar navigáció */
.filter-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: #334155;
  cursor: pointer;
  border-radius: 10px;
  transition: background .12s, color .12s;
}
.filter-btn:hover { background: #f1f5f9; }
.filter-btn.active { background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.filter-btn .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: #94a3b8; }
.filter-btn .count { font-size: 12px; color: #94a3b8; margin-left: auto; }
.filter-btn.active .count { color: #3b82f6; }
.filter-btn .side-acts { display: none; gap: 2px; flex-shrink: 0; }
.filter-btn:hover .side-acts, .filter-btn.active .side-acts { display: flex; }
.side-act {
  background: transparent; border: none; cursor: pointer;
  color: #94a3b8; font-size: 12px; line-height: 1;
  border-radius: 6px; padding: 3px 4px;
}
.side-act:hover { background: #dbeafe; color: #1d4ed8; }
.side-act.danger:hover { background: #fee2e2; color: #dc2626; }

/* Feladatlista */
.task {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.task:hover { box-shadow: 0 4px 16px rgba(15,23,42,.06); border-color: #bfdbfe; }
.task.overdue { background: #fef2f2; border: 2px solid #ef4444; }
.task.done { opacity: .55; }
.task.done .task-title { text-decoration: line-through; }
.task-check {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid #94a3b8; background: #fff;
  color: #fff; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.task-check:hover { border-color: #22c55e; }
.task-check.checked { background: #22c55e; border-color: #22c55e; }
.task-actions { opacity: 1; display: flex; gap: 2px; transition: opacity .15s; }
.empty { text-align: center; color: #94a3b8; padding: 40px; }
.empty-home { padding: 0; color: inherit; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; color: #0f172a; }
.task-desc { color: #64748b; font-size: 13px; white-space: pre-wrap; margin-top: 2px; }
.task-subs { color: #94a3b8; font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.meta-project { border: 1px solid; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.meta-due { font-size: 12px; color: #64748b; }
.meta-due.overdue-text { color: #dc2626; font-weight: 600; }
.meta-due.due-today { color: #16a34a; font-weight: 600; }
.prio { font-size: 11px; }
.meta-files { font-size: 12px; color: #64748b; }
.badge { background: #eff6ff; color: #1d4ed8; padding: 2px 8px; border-radius: 999px; font-size: 10px; margin-left: 6px; }
.tag-chip { padding: 2px 9px; border-radius: 999px; font-size: 11px; }

/* Modálok */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(15,23,42,.18);
}
.modal-small { max-width: 380px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.icon-btn { background: transparent; border: none; cursor: pointer; color: #64748b; border-radius: 8px; }
.icon-btn:hover { background: #f1f5f9; color: #0f172a; }

/* Címke választó */
.tag-option { cursor: pointer; display: inline-flex; }
.tag-option .tag-chip { cursor: pointer; opacity: .6; transition: opacity .12s, outline .12s; }
.tag-option.selected .tag-chip { opacity: 1; outline: 2px solid #3b82f6; outline-offset: 1px; }
.tag-checkbox { position: absolute; opacity: 0; pointer-events: none; }

/* Alműveletek */
.subtask-row { display: flex; gap: 8px; align-items: center; }
.subtask-title { flex: 1; }
.subtask-remove { flex-shrink: 0; }
.subtask-check {
  width: 18px; height: 18px; flex-shrink: 0;
  accent-color: #2563eb; cursor: pointer;
}
.subtask-row.subtask-done .subtask-title { text-decoration: line-through; color: #94a3b8; }
.card-subcheckbox { color: #64748b; font-size: 12px; }

/* Mellékletek */
.file-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 10px;
  background: #f8fafc;
}
.file-thumb {
  width: 40px; height: 40px; flex-shrink: 0;
  object-fit: cover; border-radius: 8px;
  border: 1px solid #e2e8f0; background: #fff;
}
.file-thumb-pdf {
  width: 30px; height: 40px;
}
.file-ico { flex-shrink: 0; font-size: 18px; line-height: 1; }
.file-link {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; color: #2563eb; text-decoration: none;
}
.file-link:hover { text-decoration: underline; }
.file-size { font-size: 11px; color: #94a3b8; flex-shrink: 0; }
.file-remove { flex-shrink: 0; }
.file-remove:hover { color: #dc2626; background: #fee2e2; }

/* Szekció fejléc (összecsukható) */
.side-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; cursor: pointer; border-radius: 8px;
  user-select: none;
}
.side-section-head:hover { background: #f1f5f9; }
.collapse-caret { color: #94a3b8; font-size: 11px; transition: transform .15s; }
.side-section-head.collapsed .collapse-caret { transform: rotate(-90deg); }
.side-collapse { overflow: hidden; transition: max-height .2s ease; }
.side-collapse.collapsed { max-height: 0; }

/* Mobil */
@media (max-width: 768px) {
  .app-view { flex-direction: column; height: 100dvh; }
  #sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 84vw !important; max-width: 320px;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform .22s ease;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    border-bottom: none;
    flex-direction: column;
    overflow-y: auto;
  }
  #sidebar.sidebar-open { transform: translateX(0); }
  #sidebar-overlay {
    position: fixed; inset: 0; z-index: 55;
    background: rgba(15,23,42,.45);
  }
  #sidebar .sidebar-header { width: 100%; padding: 0 0 10px; margin-bottom: 2px; }
  .filters { flex-direction: column; gap: 4px; padding: 0; }
  .filter-btn { white-space: normal; width: 100%; padding: 8px 12px; }
  #sidebar > .px-3 { display: block; }
  #sidebar .mt-auto { display: block; }
  #main { padding: 0; }
  .task-actions { opacity: 1; }
  .filter-btn .side-acts { display: flex; }
}