/* NEZO.app — Shared Components */

/* ── Layout ── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg1);
  border-right: 1px solid var(--b1);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--trans);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--b1);
}
.sidebar-logo span:first-child { font-weight: 800; font-size: 20px; color: var(--cyan); }
.sidebar-logo span:last-child { font-weight: 800; font-size: 20px; color: var(--t3); }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }

.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r3);
  color: var(--t4); cursor: pointer;
  transition: all var(--trans);
  font-size: 13px; font-weight: 500;
  position: relative;
}
.sidebar-item:hover { background: var(--bg2); color: var(--t2); }
.sidebar-item.active { background: var(--cyan-bg2); color: var(--cyan); }
.sidebar-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-item .status-dot { width: 8px; height: 8px; }

.sidebar-badge {
  position: absolute; right: 10px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
  font-family: var(--mono);
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--b1);
  font-size: 11px; color: var(--t5);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 24px 28px;
  min-height: 100vh;
}

/* ── Cards ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--b2);
  border-radius: var(--r4);
  padding: var(--sp4);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp3);
}
.card-title {
  font-size: 14px; font-weight: 700; color: var(--t1);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--r3);
  font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; border: none;
  transition: all var(--trans);
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-icon svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--cyan2));
  color: var(--bg); box-shadow: 0 4px 12px rgba(0, 212, 230, 0.25);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(0, 212, 230, 0.35); }

.btn-secondary {
  background: var(--bg3); color: var(--t2);
  border: 1px solid var(--b2);
}
.btn-secondary:hover { border-color: var(--b3); background: var(--b1); }

.btn-ghost {
  background: transparent; color: var(--t3);
  padding: 6px 10px;
}
.btn-ghost svg { width: 16px; height: 16px; }
.btn-ghost:hover { color: var(--t1); background: var(--bg3); }

.btn-danger {
  background: var(--red-bg); color: var(--red);
  border: 1px solid rgba(255, 107, 107, 0.2);
}
.btn-danger:hover { background: rgba(255, 107, 107, 0.15); }

.btn-sm { padding: 5px 10px; font-size: 11px; border-radius: var(--r1); }
.btn-icon { padding: 6px; border-radius: var(--r2); }

/* ── Inputs ── */
.input, .textarea, .select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--b2);
  border-radius: var(--r3);
  padding: 10px 14px;
  color: var(--t1);
  font-family: var(--font);
  font-size: 13px;
  transition: border-color var(--trans);
  outline: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 230, 0.1);
}
.input::placeholder, .textarea::placeholder {
  color: var(--t5);
}
.textarea { resize: vertical; min-height: 80px; }
.select { cursor: pointer; }

.input-group {
  display: flex; flex-direction: column; gap: 6px;
}
.input-label {
  font-size: 11px; font-weight: 600; color: var(--t4);
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── Tabs ── */
.tabs {
  display: flex; gap: 2px;
  background: var(--bg1);
  border-radius: var(--r3);
  padding: 3px;
}
.tab {
  padding: 9px 16px;
  border-radius: var(--r2);
  font-size: 13px; font-weight: 500;
  color: var(--t4);
  cursor: pointer;
  transition: all var(--trans);
  border: none; background: none;
  font-family: var(--font);
}
.tab:hover { color: var(--t2); background: var(--bg2); }
.tab.active { background: var(--cyan-bg2); color: var(--cyan); font-weight: 600; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--trans);
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--bg1);
  border: 1px solid var(--b2);
  border-radius: var(--r5);
  padding: var(--sp6);
  max-width: 480px; width: 90%;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--trans);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }

.modal-title {
  font-size: 18px; font-weight: 700; color: var(--t1);
  margin-bottom: var(--sp4);
}
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: var(--sp5);
}

/* ── Toast ── */
.toast-container {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 2000; pointer-events: none;
}
.toast {
  background: var(--bg2);
  border: 1px solid var(--b2);
  color: var(--cyan);
  padding: 12px 24px;
  border-radius: var(--r3);
  font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(10px);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Checkbox ── */
.checkbox-wrap {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.checkbox {
  width: 20px; height: 20px;
  border: 2px solid var(--b2);
  border-radius: var(--r1);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--trans);
  flex-shrink: 0;
}
.checkbox.checked {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 212, 230, 0.3);
}
.checkbox.checked svg { stroke: var(--bg); }
.checkbox-label { font-size: 13px; color: var(--t2); }
.checkbox-label.done { text-decoration: line-through; color: var(--t5); }

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--r1);
  font-family: var(--mono);
}
.badge-cyan { background: var(--cyan-bg); color: var(--cyan); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-muted { background: var(--bg3); color: var(--t4); }

/* ── Status dots ── */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
.status-active { background: var(--green); box-shadow: 0 0 8px rgba(81, 207, 102, 0.4); }
.status-waiting { background: var(--orange); box-shadow: 0 0 8px rgba(255, 159, 67, 0.4); }
.status-blocked { background: var(--red); box-shadow: 0 0 8px rgba(255, 107, 107, 0.4); }
.status-done { background: var(--t5); }

/* ── Confirm dialog ── */
.confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.confirm-box {
  background: var(--bg1);
  border: 1px solid var(--b2);
  border-radius: var(--r4);
  padding: 24px;
  max-width: 380px; width: 90%;
  text-align: center;
}
.confirm-box p { margin-bottom: 20px; color: var(--t2); font-size: 14px; }

/* ── Empty state ── */
.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--t5);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; line-height: 1.6; }

/* ── Loading ── */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--b2);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; flex-direction: column; gap: 16px;
}
.loading-screen span { color: var(--t4); font-size: 13px; }

/* ── Login ── */
.login-container {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
}
.login-box {
  background: var(--bg1);
  border: 1px solid var(--b2);
  border-radius: var(--r5);
  padding: 40px;
  max-width: 400px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-logo {
  text-align: center; margin-bottom: 32px;
}
.login-logo div {
  display: inline-block;
  background: var(--bg);
  border: 1px solid rgba(0, 212, 230, 0.3);
  border-radius: var(--r4);
  padding: 12px 24px;
}
.login-logo span:first-child { font-weight: 800; font-size: 28px; color: var(--cyan); }
.login-logo span:last-child { font-weight: 800; font-size: 28px; color: var(--t3); }
.login-title { text-align: center; font-size: 16px; color: var(--t3); margin-bottom: 24px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-error { color: var(--red); font-size: 12px; text-align: center; display: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px; }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg1);
    border-bottom: 1px solid var(--b1);
    position: sticky; top: 0; z-index: 50;
  }
  .mobile-burger {
    background: none; border: none;
    color: var(--t2); cursor: pointer;
    padding: 4px;
  }
  .mobile-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    display: none;
  }
  .mobile-overlay.active { display: block; }
}
@media (min-width: 769px) {
  .mobile-header, .mobile-overlay { display: none; }
}
