

:root{
  --orange:#ff9100;
  --dark:#111827;
  --bg:#f6f7fb;
  --glass:rgba(255,255,255,0.72);
  --border:rgba(255,255,255,0.9);
  --shadow:0 18px 40px rgba(15,23,42,0.18);
  --danger:#ff4b4b;
  --success:#16a34a;
}

*{box-sizing:border-box;margin:0;padding:0}

body{
  min-height:100vh;
  font-family:system-ui,-apple-system,Segoe UI,sans-serif;
  background:radial-gradient(circle at top,#fff 0,#f3f4f6 55%,#e5e7eb 100%);
  display:flex;
  justify-content:center;
  padding:22px;
}

.app-shell{
  width:100%;
  max-width:980px;
  border-radius:40px;
  background:rgba(255,255,255,0.55);
  box-shadow:0 22px 55px rgba(15,23,42,0.25);
  overflow:hidden;
  position:relative;
}

/* Background paperclips layer */
.paperclips{
  position:absolute;
  inset:0;
  pointer-events:none;
  overflow:hidden;
  z-index:0;              /* behind everything */
}

/* Individual paperclip */
.paperclip{
  position:absolute;
  width:88px;
  height:88px;
  opacity:0.85;
  filter: drop-shadow(0 18px 28px rgba(15,23,42,0.18));
  animation: floatY 10s ease-in-out infinite, driftX 18s ease-in-out infinite;
  will-change: transform;
}

/* Make some clips smaller on mobile */
@media (max-width: 640px){
  .paperclip{ width:70px; height:70px; opacity:0.8; }
}

.paperclip svg{
  width:100%;
  height:100%;
}

/* Color variants */
.paperclip.orange path{ stroke: #ff9100; }
.paperclip.black path{ stroke: #111827; }
.paperclip.grey  path{ stroke: #9ca3af; } /* nice neutral */

.paperclip path{
  fill:none;
  stroke-width:7;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* Smooth floating */
@keyframes floatY{
  0%   { transform: translateY(0) rotate(var(--rot)); }
  50%  { transform: translateY(-22px) rotate(calc(var(--rot) + 6deg)); }
  100% { transform: translateY(0) rotate(var(--rot)); }
}

/* Slow sideways drift (each clip gets its own delay) */
@keyframes driftX{
  0%   { margin-left: 0px; }
  50%  { margin-left: 18px; }
  100% { margin-left: 0px; }
}

/* ✅ HEADER */
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px 18px 10px;
  gap:10px;

  /* allow wrapping on smaller widths */
  flex-wrap:wrap;

  /* keep header above paperclips */
  position:relative;
  z-index:2;
}

.brand{display:flex;gap:10px;align-items:center}

.logo-badge{
  width:38px;height:38px;border-radius:18px;
  background:rgba(255,255,255,0.8);
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 10px 25px rgba(15,23,42,0.1);
  font-weight:900;
}

.brand-title{font-weight:900;letter-spacing:-0.04em;font-size:20px}
.brand-sub{font-size:11px;color:var(--orange);font-weight:700}

/* Top actions: wrap on desktop, scroll on mobile override below */
.top-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
  max-width:100%;
}

.container{
  padding:14px 18px 22px;
  position:relative;
  z-index:1;
}

.card{
  background:var(--glass);
  border:1px solid var(--border);
  border-radius:28px;
  box-shadow:var(--shadow);
  backdrop-filter: blur(18px);
  padding:18px;
}

.mini-card{
  background:rgba(255,255,255,0.78);
  border:1px solid rgba(226,232,240,0.9);
  border-radius:22px;
  padding:14px;
}

h2{font-size:20px;letter-spacing:-0.03em;margin-bottom:6px}
h3{font-size:14px;margin-bottom:8px}
.muted{color:#6b7280;font-size:12px}
.tiny{font-size:11px}
.divider{height:1px;background:rgba(226,232,240,0.9);margin:14px 0}

/* Status badge (for deal status in header) */
.status-badge{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  font-size:10px;
  font-weight:800;
  letter-spacing:0.04em;
  color:#111827;
  background:rgba(255,255,255,0.7);
  border:1px solid rgba(148,163,184,0.35);
  text-transform:uppercase;
}

/* Inline status chips used by msg(...) helper */
.status{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  letter-spacing:0.02em;
  border:1px solid transparent;
  margin-top:6px;
}
.status::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:currentColor;
}
.status-info{
  color:#0b1120;
  background:rgba(17,24,39,0.08);
  border-color:rgba(17,24,39,0.2);
}
.status-success{
  color:var(--success);
  background:rgba(22,163,74,0.12);
  border-color:rgba(22,163,74,0.3);
}
.status-error{
  color:var(--danger);
  background:rgba(255,75,75,0.12);
  border-color:rgba(255,75,75,0.3);
}

label{font-size:12px;color:#4b5563;font-weight:600}

input,textarea{
  width:100%;
  margin-top:6px;
  border-radius:16px;
  border:1px solid rgba(148,163,184,0.55);
  padding:10px 12px;
  background:rgba(255,255,255,0.85);
  outline:none;
}

textarea{min-height:72px;resize:vertical}

.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.row{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px;align-items:center}

.btn{
  border:none;cursor:pointer;
  border-radius:999px;
  padding:10px 14px;
  font-weight:700;font-size:12px;
  transition:transform .12s ease;
  white-space:nowrap; /* stops ugly button wrapping */
}

.btn:hover{transform:translateY(-1px)}

.btn-primary{background:var(--orange);color:#0b1120}
.btn-ghost{background:rgba(255,255,255,0.7);border:1px solid rgba(148,163,184,0.35)}
.btn-dark{background:#111827;color:#f9fafb}
.btn-danger{background:var(--danger);color:#fff;width:100%}

/* Notifications button + badge */
.notify-btn{position:relative;padding-right:26px}

.badge{
  position:absolute;
  top:-6px;
  right:-6px;
  min-width:18px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  background:#111827;
  color:#fff;
  font-size:10px;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 6px 16px rgba(15,23,42,0.18);
}

.list{display:flex;flex-direction:column;gap:10px}

.list-item{
  padding:12px;border-radius:18px;
  border:1px solid rgba(226,232,240,0.9);
  background:rgba(255,255,255,0.75);
  display:flex;justify-content:space-between;align-items:center;gap:10px;
}

.list-item.unread{
  border-color:rgba(255,145,0,0.6);
  box-shadow:0 10px 24px rgba(255,145,0,0.18);
}

.small{font-size:11px;color:#6b7280}

a.link{color:#111827;font-weight:800;text-decoration:none}

.deal-meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
  flex-wrap:wrap;
}

.progress{
  width:100%;
  height:18px;
  border-radius:999px;
  background:#111827;
  overflow:hidden;
  margin-top:12px;
}

.progress-fill{
  height:100%;
  width:0%;
  background:linear-gradient(90deg,var(--orange),#111827);
  transition:width .25s ease;
}

.progress-labels{
  display:flex;
  justify-content:space-between;
  font-size:11px;
  color:#6b7280;
  margin-top:6px;
}

/* QR panel (used in deal view) */
.qr-panel{
  margin-top:8px;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:4px;
}

.qr-panel img{
  width:140px;
  height:140px;
  border-radius:16px;
  border:1px solid rgba(226,232,240,0.9);
  background:#fff;
  padding:6px;
}

/* Toasts */
.toast-container{
  position:fixed;
  right:22px;
  bottom:22px;
  display:flex;
  flex-direction:column;
  gap:10px;
  z-index:999;
}

.toast{
  min-width:220px;
  max-width:320px;
  background:rgba(17,24,39,0.95);
  color:#f9fafb;
  border-radius:16px;
  padding:12px 14px;
  box-shadow:0 16px 30px rgba(15,23,42,0.35);
  border:1px solid rgba(255,255,255,0.08);
  position:relative;
  animation:toastIn .25s ease;
}

.toast-success{ background:rgba(22,163,74,0.95); }
.toast-error{ background:rgba(239,68,68,0.95); }

.toast-title{font-size:12px;font-weight:800;margin-bottom:4px}
.toast-body{font-size:11px;color:#e5e7eb}
.toast-deal{margin-top:6px;font-size:11px;color:var(--orange);font-weight:700;cursor:pointer}

.toast-close{
  position:absolute;
  top:6px;
  right:8px;
  background:transparent;
  border:none;
  color:#cbd5f5;
  font-size:12px;
  cursor:pointer;
}

@keyframes toastIn{
  from{transform:translateY(10px);opacity:0}
  to{transform:translateY(0);opacity:1}
}

/* Responsive */
@media(max-width:640px){
  .grid2{grid-template-columns:1fr}

  .toast-container{right:12px;left:12px;bottom:12px}
  .toast{max-width:none}

  .topbar{
    align-items:flex-start;
  }

  .top-actions{
    width:100%;
    flex-wrap:nowrap;              /* single row */
    overflow-x:auto;               /* scroll row */
    -webkit-overflow-scrolling:touch;
    padding-bottom:6px;
  }

  /* optional: hide scrollbar (still scrollable) */
  .top-actions::-webkit-scrollbar{ height:0; }
}

