/* ================================================================
   app.css — NexoSites platform (auth / dashboard / quote / chat / admin)
   Uses the same design tokens as style.css
   ================================================================ */

/* ── AUTH ─────────────────────────────────────────────────────── */
.auth-wrap {
  max-width: 460px;
  margin: 0 auto;
  padding: 2.5rem;
}
.auth-card { background: var(--panel); border: 1px solid var(--border); border-radius: 3px; padding: 2.5rem; }
.auth-foot { text-align: center; margin-top: 1.5rem; color: var(--text-2); font-size: .92rem; }
.auth-foot a { color: var(--purple-l); font-weight: 600; }
.auth-error {
  display: none; align-items: center; gap: .6rem;
  background: rgba(255,176,32,.1); border: 1px solid rgba(255,176,32,.3);
  color: #f4a8c8; padding: .8rem 1rem; border-radius: 2px; margin-bottom: 1.2rem; font-size: .9rem;
}
.auth-success {
  display: none; align-items: center; gap: .6rem;
  background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3);
  color: #6ee7b7; padding: .8rem 1rem; border-radius: 2px; margin-bottom: 1.2rem; font-size: .9rem;
}

/* ── FORM ELEMENTS (shared) ──────────────────────────────────── */
.fg { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.2rem; }
.fg label { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.fg input, .fg select, .fg textarea {
  background: var(--dark-2); border: 1px solid var(--border); border-radius: 2px;
  padding: .8em 1em; color: var(--text); font-size: .95rem; transition: border-color .2s;
}
.fg input:focus, .fg select:focus, .fg textarea:focus { border-color: var(--purple-l); outline: none; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; pointer-events: none; }

/* ── DASHBOARD ────────────────────────────────────────────────── */
.dash-hero { padding: 3rem 0 1.5rem; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.2rem; margin-bottom: 2.5rem; }
.dash-stat { background: var(--panel); border: 1px solid var(--border); border-radius: 3px; padding: 1.5rem; }
.dash-stat .num { font-family: var(--ff-h); font-weight: 700; font-size: 2.2rem; color: var(--purple-l); }
.dash-stat .lbl { color: var(--text-2); font-size: .85rem; }

.order-list { display: flex; flex-direction: column; gap: 1rem; }
.order-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 3px;
  padding: 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
}
.order-card h4 { font-family: var(--ff-b); font-size: 1.05rem; margin-bottom: .3rem; }
.order-meta { color: var(--text-2); font-size: .85rem; }
.order-price { font-family: var(--ff-m); color: var(--cyan); font-size: 1.1rem; }

.status-badge {
  display: inline-flex; align-items: center; gap: .4em; font-size: .72rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; padding: .35em 1em; border-radius: 99px;
}
.status-pending_review { background: rgba(245,158,11,.12); color: var(--amber); border: 1px solid rgba(245,158,11,.3); }
.status-quoted         { background: rgba(59,130,246,.12); color: var(--blue); border: 1px solid rgba(59,130,246,.3); }
.status-accepted       { background: rgba(79,195,232,.12); color: var(--purple-l); border: 1px solid rgba(79,195,232,.3); }
.status-in_progress    { background: rgba(34,211,238,.12); color: var(--cyan); border: 1px solid rgba(34,211,238,.3); }
.status-revision       { background: rgba(255,176,32,.12); color: var(--pink); border: 1px solid rgba(255,176,32,.3); }
.status-completed      { background: rgba(16,185,129,.12); color: var(--green); border: 1px solid rgba(16,185,129,.3); }
.status-cancelled      { background: rgba(90,77,122,.15); color: var(--text-3); border: 1px solid var(--border); }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-2); }
.empty-state i { font-size: 2.2rem; color: var(--text-3); margin-bottom: 1rem; display: block; }

/* ── QUOTE CALCULATOR ────────────────────────────────────────── */
.quote-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2.5rem; align-items: start; }
.quote-step { background: var(--panel); border: 1px solid var(--border); border-radius: 3px; padding: 2rem; margin-bottom: 1.5rem; }
.quote-step h3 { font-family: var(--ff-b); font-size: 1.15rem; margin-bottom: 1.2rem; display: flex; align-items: center; gap: .6em; }
.quote-step h3 .qnum {
  width: 28px; height: 28px; border-radius: 50%; background: var(--grad); display: inline-grid;
  place-items: center; font-family: var(--ff-m); font-size: .8rem; color: #04121f; flex-shrink: 0;
}
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; }
.opt-card {
  background: var(--dark-2); border: 1px solid var(--border); border-radius: 3px; padding: 1rem 1.2rem;
  cursor: pointer; transition: all .2s; position: relative;
}
.opt-card:hover { border-color: var(--border-2); }
.opt-card.selected { border-color: var(--purple-l); background: rgba(79,195,232,.1); box-shadow: 0 0 0 1px var(--purple-l) inset; }
.opt-card input { position: absolute; opacity: 0; }
.opt-card .opt-title { font-weight: 600; font-size: .92rem; margin-bottom: .2rem; }
.opt-card .opt-desc { font-size: .78rem; color: var(--text-2); }
.opt-card .opt-price { font-family: var(--ff-m); font-size: .78rem; color: var(--cyan); margin-top: .4rem; display: block; }

.pages-stepper { display: flex; align-items: center; gap: 1rem; }
.pages-stepper button {
  width: 40px; height: 40px; border-radius: 2px; background: var(--dark-2); border: 1px solid var(--border);
  color: var(--text); font-size: 1.2rem; display: grid; place-items: center;
}
.pages-stepper button:hover { border-color: var(--purple-l); color: var(--purple-l); }
.pages-stepper .count { font-family: var(--ff-h); font-weight: 700; font-size: 1.8rem; min-width: 50px; text-align: center; }

.quote-summary { position: sticky; top: calc(var(--nav-h) + 20px); background: var(--panel); border: 1px solid var(--border-2); border-radius: 3px; padding: 2rem; }
.quote-summary h3 { font-family: var(--ff-b); margin-bottom: 1.2rem; }
.qs-line { display: flex; justify-content: space-between; font-size: .88rem; padding: .5rem 0; border-bottom: 1px dashed var(--border); color: var(--text-2); }
.qs-line span:last-child { color: var(--text); font-weight: 600; }
.qs-total { display: flex; justify-content: space-between; align-items: baseline; margin: 1.2rem 0; padding-top: 1rem; border-top: 1px solid var(--border-2); }
.qs-total .amt { font-family: var(--ff-h); font-weight: 700; font-size: 2.4rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.qs-note { font-size: .78rem; color: var(--text-3); line-height: 1.5; }

/* ── CHAT / MESSAGES ──────────────────────────────────────────── */
.chat-shell { display: grid; grid-template-columns: 300px 1fr; gap: 1.5rem; height: 70vh; min-height: 480px; }
.chat-list { background: var(--panel); border: 1px solid var(--border); border-radius: 3px; overflow-y: auto; }
.chat-list-item {
  display: flex; align-items: center; gap: .8rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.chat-list-item:hover, .chat-list-item.active { background: rgba(79,195,232,.08); }
.chat-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--grad); display: grid; place-items: center;
  font-weight: 700; color: #04121f; flex-shrink: 0; font-size: .9rem;
}
.chat-list-name { font-weight: 600; font-size: .9rem; }
.chat-list-preview { font-size: .78rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.chat-list-item .unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pink); margin-left: auto; flex-shrink: 0; }

.chat-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 3px; display: flex; flex-direction: column; overflow: hidden; }
.chat-panel-head { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border); font-weight: 600; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: .8rem; }
.chat-bubble { max-width: 70%; padding: .7em 1.1em; border-radius: 3px; font-size: .9rem; line-height: 1.5; }
.chat-bubble.mine { align-self: flex-end; background: var(--grad); color: #04121f; border-bottom-right-radius: 4px; }
.chat-bubble.theirs { align-self: flex-start; background: var(--dark-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-bubble .time { display: block; font-size: .68rem; opacity: .65; margin-top: .3em; }
.chat-input-row { display: flex; gap: .8rem; padding: 1.2rem; border-top: 1px solid var(--border); }
.chat-input-row textarea { flex: 1; resize: none; }
.chat-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-2); flex-direction: column; gap: .8rem; }

/* ── ADMIN ────────────────────────────────────────────────────── */
.admin-table-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th { text-align: left; padding: 1rem 1.2rem; color: var(--text-2); font-weight: 600; border-bottom: 1px solid var(--border); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.admin-table td { padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.clickable { cursor: pointer; transition: background .15s; }
.admin-table tr.clickable:hover { background: rgba(79,195,232,.06); }
.admin-table input[type="text"], .admin-table input[type="number"] {
  background: var(--dark-2); border: 1px solid var(--border); border-radius: 2px;
  color: var(--text); font-family: var(--ff-b); font-size: .85rem; padding: .5em .7em;
  width: 100%; transition: border-color .2s;
}
.admin-table input[type="text"]:focus, .admin-table input[type="number"]:focus {
  border-color: var(--purple-l); outline: none;
}
.pc-remove-btn {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 2px; border: 1px solid var(--border); color: var(--text-2);
  transition: all .2s;
}
.pc-remove-btn:hover { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,.08); }
.pc-add-btn { margin-top: -0.5rem; margin-bottom: 1.5rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: .3rem; }
.tag { font-size: .68rem; padding: .2em .7em; border-radius: 99px; background: rgba(79,195,232,.1); border: 1px solid var(--border-2); color: var(--purple-l); }

.admin-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.detail-card { background: var(--panel); border: 1px solid var(--border); border-radius: 3px; padding: 1.5rem; }
.detail-card h4 { font-size: .95rem; margin-bottom: 1rem; color: var(--purple-l); }
.detail-row { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px dashed var(--border); font-size: .88rem; }
.detail-row:last-child { border-bottom: none; }
.detail-row span:first-child { color: var(--text-2); }

.tabs { display: flex; gap: .5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.tab-btn { padding: .8em 1.4em; font-size: .88rem; font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; }
.tab-btn.active { color: var(--purple-l); border-bottom-color: var(--purple-l); }

@media (max-width: 860px) {
  .quote-layout, .admin-detail-grid { grid-template-columns: 1fr; }
  .quote-summary { position: static; }
  .dash-grid { grid-template-columns: 1fr; }
  .chat-shell { grid-template-columns: 1fr; height: auto; }
  .chat-list { max-height: 220px; }
  .chat-messages { min-height: 320px; }
}
