/* ============================================================
   VIBREEM ADMIN PANEL — stylesheet
============================================================ */
:root {
  --green: #157a44; --deep: #0c5530; --darkbg: #0b2e1c;
  --orange: #f7941e; --yellow: #ffc93c;
  --cream: #fdf9f1; --line: #e8e4d8;
  --ink: #1e2b23; --muted: #5f6f64;
  --grad-solar: linear-gradient(135deg, #f7941e, #ffc93c);
  --grad-green: linear-gradient(135deg, #157a44, #2aa35e);
  --radius: 14px;
  --shadow: 0 10px 34px rgba(30,43,35,.09);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Figtree', sans-serif; background: var(--cream); color: var(--ink); }
h1,h2,h3,h4 { font-family: 'Bricolage Grotesque', sans-serif; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

/* ---- Shell ---- */
.adm-shell { display: flex; min-height: 100vh; }
.adm-sidebar {
  width: 250px; flex-shrink: 0;
  background: linear-gradient(180deg, #0c3822 0%, #071f13 100%);
  color: #cfe3d6;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.adm-brand { padding: 22px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.adm-brand img { height: 44px; }
.adm-nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.adm-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  font-weight: 600; font-size: .93rem; color: #a9c3b3;
  transition: background .25s, color .25s;
}
.adm-nav a svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.adm-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.adm-nav a.active { background: var(--grad-solar); color: var(--deep); }
.adm-side-foot { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 9px; font-size: .85rem; }
.adm-db-badge { font-size: .7rem; font-weight: 700; letter-spacing: .06em; color: var(--yellow); }
.adm-view-site { color: #a9c3b3; font-weight: 600; }
.adm-view-site:hover { color: var(--yellow); }
.adm-logout {
  text-align: center; padding: 9px; border-radius: 9px;
  background: rgba(255,255,255,.08); color: #fff; font-weight: 700;
}
.adm-logout:hover { background: #c0392b; }

.adm-main { flex: 1; min-width: 0; }
.adm-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.adm-topbar h1 { font-size: 1.35rem; font-weight: 800; }
.adm-user { font-size: .88rem; font-weight: 600; color: var(--muted); }
.adm-content { padding: 30px 32px 60px; max-width: 1200px; }

/* ---- Cards / grid ---- */
.adm-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.adm-card h2 { font-size: 1.12rem; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.adm-grid { display: grid; gap: 20px; }
.adm-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.adm-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.adm-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---- Stats (dashboard) ---- */
.adm-stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px;
}
.adm-stat .ic {
  width: 50px; height: 50px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--grad-solar); color: #fff;
}
.adm-stat .ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.adm-stat b { display: block; font-size: 1.5rem; font-family: 'Bricolage Grotesque', sans-serif; }
.adm-stat span { color: var(--muted); font-size: .85rem; font-weight: 600; }

/* ---- Forms ---- */
label { display: block; font-weight: 700; font-size: .85rem; margin: 14px 0 6px; }
label small { font-weight: 500; color: var(--muted); }
input[type=text], input[type=url], input[type=email], input[type=password], select, textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--cream); font-family: inherit; font-size: .95rem;
  outline: none; transition: border-color .25s, box-shadow .25s;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(21,122,68,.13); background: #fff; }
textarea { resize: vertical; }
input[type=file] { font-size: .88rem; padding: 8px 0; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border: none; border-radius: 100px;
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: .92rem;
  transition: transform .25s, box-shadow .25s, opacity .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-green { background: var(--grad-green); color: #fff; box-shadow: 0 7px 18px rgba(21,122,68,.3); }
.btn-orange { background: var(--grad-solar); color: var(--deep); box-shadow: 0 7px 18px rgba(247,148,30,.3); }
.btn-ghost { background: #fff; color: var(--green); border: 2px solid var(--green); }
.btn-red { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c0; }
.btn-sm { padding: 7px 15px; font-size: .8rem; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---- Flash + notices ---- */
.adm-flash {
  padding: 13px 18px; border-radius: 11px; margin-bottom: 20px;
  font-weight: 600; font-size: .92rem;
}
.adm-flash.ok { background: #e6f5eb; color: #14603a; border: 1px solid #bfe4cd; }
.adm-flash.err { background: #fdecea; color: #b03a2e; border: 1px solid #f5c6c0; }
.adm-note { font-size: .85rem; color: var(--muted); margin-top: 8px; }

/* ---- Tables / list rows ---- */
.adm-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(30,43,35,.05);
}
.adm-row img.thumb { width: 84px; height: 56px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: #eee; }
.adm-row .grow { flex: 1; min-width: 0; }
.adm-row .grow b { display: block; font-size: .98rem; }
.adm-row .grow small { color: var(--muted); }
.adm-row .acts { display: flex; gap: 8px; flex-shrink: 0; }

/* ---- Gallery admin grid ---- */
.adm-gal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.adm-gal-item { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.adm-gal-item img, .adm-gal-item video { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.adm-gal-item .doc { display: grid; place-items: center; aspect-ratio: 4/3; background: #e9f5ec; color: var(--green); font-weight: 800; font-size: .8rem; }
.adm-gal-item form { position: absolute; top: 6px; right: 6px; }
.adm-gal-item .del {
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: rgba(192,57,43,.92); color: #fff; font-weight: 700;
}
.adm-gal-item figcaption { padding: 7px 10px; font-size: .75rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- AI generate zone ---- */
.ai-zone {
  border: 2px dashed rgba(21,122,68,.4); border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(21,122,68,.05), rgba(247,148,30,.07));
  padding: 22px; margin-bottom: 22px;
}
.ai-zone h3 { display: flex; align-items: center; gap: 9px; font-size: 1rem; margin-bottom: 8px; }
.ai-zone p { font-size: .87rem; color: var(--muted); margin-bottom: 14px; }
.ai-spin {
  display: none; width: 18px; height: 18px;
  border: 3px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: aspin .8s linear infinite;
}
@keyframes aspin { to { transform: rotate(360deg); } }
.btn.loading .ai-spin { display: inline-block; }

/* ---- Login page ---- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(circle at 15% 15%, rgba(255,201,60,.15), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(21,122,68,.15), transparent 45%),
    linear-gradient(180deg, #0c3822, #071f13);
  padding: 20px;
}
.login-card {
  width: min(410px, 100%);
  background: #fff; border-radius: 20px; padding: 40px 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  text-align: center;
}
.login-card img { height: 52px; margin-bottom: 6px; }
.login-card h1 { font-size: 1.3rem; margin-bottom: 4px; }
.login-card > p { color: var(--muted); font-size: .88rem; margin-bottom: 18px; }
.login-card label { text-align: left; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 20px; }
.login-back { display: inline-block; margin-top: 16px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.login-back:hover { color: var(--green); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .adm-shell { flex-direction: column; }
  .adm-sidebar { width: 100%; height: auto; position: static; }
  .adm-nav { flex-direction: row; flex-wrap: wrap; }
  .adm-side-foot { flex-direction: row; align-items: center; justify-content: space-between; }
  .adm-content { padding: 20px 16px 50px; }
  .adm-grid.cols-2, .adm-grid.cols-3, .adm-grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .adm-gal-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .adm-grid.cols-2, .adm-grid.cols-3, .adm-grid.cols-4 { grid-template-columns: 1fr; }
  .adm-row { flex-wrap: wrap; }
}

/* ============================================================
   QUOTATION GENERATOR
============================================================ */
.q-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.q-form-col { min-width: 0; }
.q-search-wrap { display: flex; gap: 12px; margin-bottom: 20px; align-items: center; }
.q-search-wrap input { max-width: 300px; }

/* ── quotation document ── */
.quot-wrap { overflow-x: auto; background: #e8e4d8; padding: 20px; border-radius: 10px; }
.quot-doc {
  background: #fff; max-width: 780px; margin: 0 auto;
  font-family: Arial, 'Figtree', sans-serif; font-size: 10pt; line-height: 1.45; color: #111;
  outline: none; cursor: text;
}
.quot-doc:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }

/* header strip */
.quot-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; background: #0c3822; gap: 10px;
}
.quot-logo-main  { height: 46px; object-fit: contain; }
.quot-tagline    { font-size: 12pt; font-weight: 800; letter-spacing: .06em; color: #ffc93c; text-align: center; flex: 1; }
.quot-logo-brand { height: 40px; object-fit: contain; background: #fff; padding: 3px 8px; border-radius: 4px; }

/* address / title */
.quot-addr-block  { display: flex; justify-content: space-between; padding: 10px 20px; border-bottom: 1px solid #ccc; font-size: 10pt; }
.quot-date        { font-weight: 700; }
.quot-title-block { text-align: center; padding: 10px 20px 12px; background: #f3f8f3; border-bottom: 2.5px solid #0c3822; }
.quot-main-title  { font-size: 17pt; font-weight: 900; letter-spacing: .14em; color: #0c3822; font-family: 'Bricolage Grotesque', Arial, sans-serif; margin-bottom: 4px; }

/* tables */
.quot-table { width: calc(100% - 40px); border-collapse: collapse; font-size: 9pt; }
.quot-table th, .quot-table td { border: 1px solid #777; padding: 5px 8px; vertical-align: top; }
.quot-table th { background: #0c3822; color: #fff; font-weight: 700; font-size: 9pt; }
.quot-total-row td { background: #e8f5e0; }
.quot-table-bom  { font-size: 8pt; }

/* section blocks */
.quot-subsidy-box  { margin: 10px 20px; padding: 9px 13px; background: #fffbea; border: 1px solid #e5c200; border-radius: 5px; font-size: 9.5pt; }
.quot-section-title{ padding: 5px 20px; background: #0c3822; color: #fff; font-weight: 700; font-size: 9.5pt; margin-top: 12px; }
.quot-sub-section  { padding: 3px 20px; font-style: italic; font-weight: 700; font-size: 9pt; }
.quot-terms        { padding: 6px 20px 6px 48px; font-size: 9pt; margin: 0; }
.quot-terms li     { margin-bottom: 2px; }
.quot-note         { margin: 8px 20px; font-size: 8.5pt; font-style: italic; color: #444; }
.quot-full-img     { display: block; width: calc(100% - 40px); margin: 10px 20px; }
.quot-sign-row     { display: flex; justify-content: space-between; gap: 20px; padding: 16px 20px 6px; }
.quot-sign-block   { flex: 1; font-size: 9.5pt; }
.quot-sign-line    { border-bottom: 1px solid #555; margin: 20px 0 6px; }
.quot-bank-box     { margin: 8px 20px 16px; padding: 9px 13px; background: #f3f8f3; border: 1px solid #b9d9c3; font-size: 9.5pt; }
.quot-notes-box    { margin: 8px 20px 16px; padding: 9px 13px; background: #fffbea; border-left: 4px solid var(--orange); font-size: 9.5pt; }

@media (max-width: 900px) {
  .q-layout { grid-template-columns: 1fr; }
}
@media print {
  .quot-doc { max-width: 100%; }
  .quot-table, .quot-full-img { margin: 6px 0; width: 100%; }
}
