/* Amazing Glazing — Admin panel styles */
:root {
  --navy: #16223D; --navy-deep: #0E1729; --blue: #2F6FE0; --blue-dark: #245BC0;
  --ice: #EEF2F8; --ice-line: #DCE4F0; --text: #1F2A37; --muted: #5C6B7A; --white: #fff;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Plus Jakarta Sans", -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--ice); color: var(--text); }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
.icon { width: 20px; height: 20px; } .icon-sm { width: 16px; height: 16px; }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(135deg, var(--navy-deep), var(--navy)); }
.login-card { background: #fff; border-radius: 16px; padding: 40px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3); }
.login-card .login-logo { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px; display: block; }
.login-card h1 { text-align: center; font-size: 1.4rem; color: var(--navy); margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 0.9rem; margin-bottom: 26px; }

/* ---- Shell ---- */
.admin { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy-deep); color: rgba(255,255,255,0.8); padding: 24px 16px; }
.sidebar .s-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; color: #fff; font-weight: 800; }
.sidebar .s-brand img { width: 38px; height: 38px; border-radius: 50%; background: #fff; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px;
  font-weight: 600; font-size: 0.94rem; color: rgba(255,255,255,0.75); margin-bottom: 4px; transition: all 0.15s; }
.sidebar nav a:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar nav a.active { background: var(--blue); color: #fff; }
.sidebar .s-foot { margin-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 16px; }

.content { padding: 30px 36px; }
.content-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.content-head h1 { font-size: 1.5rem; color: var(--navy); }
.view-site { color: var(--blue); font-weight: 600; font-size: 0.9rem; }

/* ---- Cards / panels ---- */
.panel { background: #fff; border: 1px solid var(--ice-line); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.panel h2 { font-size: 1.1rem; color: var(--navy); margin-bottom: 16px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 18px; margin-bottom: 24px; }
.kpi { background: #fff; border: 1px solid var(--ice-line); border-radius: var(--radius); padding: 22px; }
.kpi .k-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--ice); color: var(--blue); display: grid; place-items: center; margin-bottom: 12px; }
.kpi .k-num { font-size: 1.9rem; font-weight: 800; color: var(--navy); }
.kpi .k-label { color: var(--muted); font-size: 0.9rem; }

/* ---- Forms ---- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; color: var(--navy); }
.field input, .field select, .field textarea { width: 100%; padding: 11px 13px; border: 1.5px solid var(--ice-line);
  border-radius: 9px; font-family: inherit; font-size: 0.95rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,111,224,0.15); }
.field textarea { min-height: 110px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--blue); color: #fff; border: 0;
  padding: 11px 22px; border-radius: 9px; font-weight: 700; font-size: 0.92rem; cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--blue-dark); }
.btn svg { width: 16px; height: 16px; }
.btn-light { background: var(--ice); color: var(--navy); }
.btn-danger { background: #d8413f; } .btn-danger:hover { background: #b8312f; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

/* ---- Tables / lists ---- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--ice-line); font-size: 0.92rem; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }

.grid-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 16px; }
.thumb-card { border: 1px solid var(--ice-line); border-radius: 10px; overflow: hidden; background: #fff; }
.thumb-card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.thumb-card .tc-body { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.thumb-card .tc-cap { font-size: 0.82rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--blue); background: var(--ice); padding: 3px 9px; border-radius: 50px; }

.alert { padding: 12px 16px; border-radius: 9px; margin-bottom: 18px; font-size: 0.92rem; }
.alert-success { background: #e7f6ee; color: #176c3a; border: 1px solid #b6e3c8; }
.alert-error { background: #fdecec; color: #a52828; border: 1px solid #f3c4c4; }

.inline-form { display: inline; }

/* ---- Enquiry cards + reply ---- */
.enq { border: 1px solid var(--ice-line); border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; background: #fff; }
.enq-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.enq-name { font-weight: 700; color: var(--navy); margin-right: 6px; }
.enq-meta { color: var(--muted); font-size: 0.86rem; margin-top: 4px; }
.enq-meta svg { vertical-align: -3px; }
.enq-msg { margin-top: 12px; color: var(--text); font-size: 0.94rem; background: var(--ice); border-radius: 8px; padding: 12px 14px; }
.replied { color: #176c3a; font-size: 0.8rem; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }
.reply-sent { margin-top: 10px; background: #f0f7f1; border: 1px solid #c9e6d3; border-radius: 8px; padding: 10px 12px; font-size: 0.9rem; color: #1c5b36; }
details.reply { margin-top: 0; flex: 1; }
details.reply summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 700; font-size: 0.9rem; list-style: none; }
details.reply summary::-webkit-details-marker { display: none; }
details.reply[open] summary { margin-bottom: 12px; }
.enq-actions { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; }

/* ---- Thumbnail card actions + inline edit ---- */
.tc-actions { display: flex; gap: 6px; }
.card-edit { border-top: 1px solid var(--ice-line); }
.card-edit > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; padding: 9px 12px; color: var(--blue); font-weight: 700; font-size: 0.82rem; }
.card-edit > summary::-webkit-details-marker { display: none; }
.card-edit[open] > summary { border-bottom: 1px solid var(--ice-line); }
.card-edit form { padding: 12px; }
.card-edit .field { margin-bottom: 10px; }
.btn .icon-sm { width: 15px; height: 15px; }
a.btn { text-decoration: none; }

@media (max-width: 800px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  .sidebar .s-brand { width: 100%; padding-bottom: 12px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 6px; }
  .sidebar nav a { margin: 0; padding: 8px 12px; }
  .sidebar .s-foot { margin: 0; border: 0; padding: 0; }
  .form-row { grid-template-columns: 1fr; }
  .content { padding: 20px; }
}
