* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: #f7f9fc;
  color: #111827;
}
.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: #ffffff;
  border-right: 1px solid #dbe4f5;
  padding: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { font-weight: 700; margin-bottom: 14px; }
.nav-btn {
  width: 100%; text-align: left; margin-bottom: 8px; border: 1px solid #d6e2ff;
  background: #f7faff; color: #1f2937; border-radius: 10px; padding: 9px;
}
.nav-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.content-wrap { padding: 0 18px 18px; }
.topbar {
  position: sticky; top: 0; z-index: 20; background: rgba(247, 249, 252, 0.96);
  border-bottom: 1px solid #dbe4f5; backdrop-filter: blur(7px);
  display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 0;
}
.search { flex: 1; max-width: 520px; padding: 10px; border-radius: 10px; border: 1px solid #cdddfd; background: #fff; color: #111827; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-actions #guest-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  visibility: visible;
  opacity: 1;
  z-index: 25;
}
.top-actions #user-actions {
  display: flex;
  align-items: center;
  visibility: visible;
  opacity: 1;
  z-index: 25;
}
.auth-loading {
  font-size: 12px;
  color: #64748b;
}
.auth-loading.hide {
  display: none !important;
}
.btn { border: 1px solid #c4d5fb; background: #fff; color: #1f2937; border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.btn.primary { background: linear-gradient(135deg,#2d6cff,#7c4dff); border: 0; }
.panel { background: #ffffff; border: 1px solid #dbe4f5; border-radius: 12px; padding: 14px; margin-top: 14px; box-shadow: 0 6px 16px rgba(15,23,42,0.04); }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: #ffffff; border: 1px solid #dbe4f5; border-radius: 10px; padding: 12px; }
.card .label { color: #6b7280; font-size: 12px; }
.card .value { font-size: 24px; font-weight: 700; margin-top: 6px; }
.module-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.module-tools input,.module-tools select, .form-grid input, .form-grid select, .form-grid textarea {
  padding: 8px; border-radius: 9px; border: 1px solid #cdddfd; background: #fff; color: #111827;
}
table { width: 100%; border-collapse: collapse; }
th,td { text-align: left; border-bottom: 1px solid #e5ecfa; padding: 8px; font-size: 13px; vertical-align: top; }
.hide { display: none !important; }
.kanban { display: grid; gap: 10px; grid-template-columns: repeat(4,minmax(0,1fr)); }
.lane { background:#f8fbff; border:1px solid #d6e2ff; border-radius:10px; padding:8px; min-height:180px; }
.deal-card { background:#fff; border:1px solid #d2ddf8; border-radius:8px; padding:8px; margin-bottom:8px; cursor: grab; }
.pagination { display:flex; gap:8px; justify-content:flex-end; margin-top:8px; }
#toast-root { position:fixed; right:14px; top:14px; display:grid; gap:8px; z-index:1000; }
.toast { background:#fff; border:1px solid #d3e0fc; border-radius:10px; padding:10px; box-shadow: 0 8px 20px rgba(15,23,42,0.08); }
.toast.success { border-color:#2dd29a; }
.toast.error { border-color:#ff5d8c; }
.notif-dropdown,.profile-dropdown {
  position: absolute; right: 0; top: 38px; background:#fff; border:1px solid #d8e4fc; border-radius:10px; width: 280px; max-height: 320px; overflow:auto; padding:8px;
}
.relative { position: relative; }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 2000;
  padding: 16px;
}
.modal-card {
  width: min(820px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border: 1px solid #dce7fd;
  border-radius: 14px;
  padding: 16px;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.form-group {
  display: grid;
  gap: 6px;
}
.form-group.full {
  grid-column: 1 / -1;
}
.form-group label {
  font-size: 12px;
  color: #4b5563;
  font-weight: 600;
}
.modal-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
@media (max-width: 1080px) {
  .cards,.kanban { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: static; }
  .cards,.kanban { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: stretch; }
}
