/* ==========================================================
   AQS Certification – admin panel styles
   ========================================================== */
:root {
  --navy: #14477f; --navy-dark: #0d325c; --navy-light: #1f5fa8; --gold: #d9a520; --gold-dark: #b8880f;
  --ink: #1e2a3a; --muted: #61708a; --line: #e2e8f0; --bg: #f2f5f9; --white: #fff;
  --radius: 12px; --shadow: 0 6px 20px rgba(20,71,127,.08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 15px; }
a { color: var(--navy); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5em; color: var(--navy-dark); line-height: 1.25; }
h3 { font-size: 1.05rem; }
.muted { color: var(--muted); } .small { font-size: .82rem; }
.icon { vertical-align: -0.2em; }

/* Layout */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: linear-gradient(180deg, var(--navy-dark), #0a2543); color: #c9d9ee; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px 22px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.sidebar-brand span { font-weight: 800; font-size: 1.25rem; line-height: 1.1; display: flex; flex-direction: column; }
.sidebar-brand small { font-weight: 500; font-size: .72rem; color: #9db5d6; }
.sidebar-nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 9px; color: #c9d9ee; font-weight: 500; position: relative; }
.sidebar-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav a.active { background: var(--gold); color: #1a1a1a; font-weight: 700; }
.sidebar-nav .pill { margin-left: auto; background: #e8532e; color: #fff; font-style: normal; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.sidebar-foot { padding: 14px 12px 20px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 4px; }
.sidebar-foot a { display: flex; align-items: center; gap: 10px; padding: 9px 14px; color: #c9d9ee; border-radius: 8px; font-size: .9rem; }
.sidebar-foot a:hover { background: rgba(255,255,255,.07); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; padding: 14px 28px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar h1 { font-size: 1.25rem; margin: 0; flex: 1; }
.topbar .user { color: var(--muted); font-size: .9rem; display: flex; gap: 6px; align-items: center; }
.sidebar-toggle { display: none; background: none; border: 0; color: var(--navy); cursor: pointer; }
.content { padding: 28px; }

/* Panels & grids */
.panel { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px; border: 1px solid var(--line); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 22px; }
.stat { background: #fff; border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: center; border: 1px solid var(--line); box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 1.6rem; color: var(--navy-dark); line-height: 1.1; }
.stat span:last-child { font-size: .78rem; color: var(--muted); }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat-icon.blue { background: #e6eefa; color: var(--navy); } .stat-icon.green { background: #e2f6ea; color: #17804a; }
.stat-icon.amber { background: #fff3d6; color: #9a6a05; } .stat-icon.red { background: #fde3e3; color: #b91c1c; }
.quick-actions { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 12px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); background: #f8fafc; }
.table tr:hover td { background: #fafcff; }
.table tr.inactive td { opacity: .55; }
.actions { white-space: nowrap; }
.actions a, .icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--navy); background: #eef3fa; border: 0; cursor: pointer; margin-right: 4px; vertical-align: middle; }
.actions a:hover, .icon-btn:hover { background: var(--navy); color: #fff; }
.icon-btn.danger { color: #b91c1c; background: #fde3e3; } .icon-btn.danger:hover { background: #b91c1c; color: #fff; }
.toggle { width: 42px; height: 24px; border-radius: 999px; background: #cbd5e1; border: 0; position: relative; cursor: pointer; }
.toggle span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle.on { background: #1e9e5a; } .toggle.on span { left: 21px; }

/* Badges & alerts */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.badge-valid { background: #e2f6ea; color: #17804a; } .badge-expired { background: #fff3d6; color: #9a6a05; }
.badge-suspended { background: #ffe8d9; color: #a24d05; } .badge-withdrawn { background: #fde3e3; color: #8e1f1f; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.alert-success { background: #e2f6ea; color: #17804a; border: 1px solid #b7e6ca; }
.alert-error { background: #fde3e3; color: #8e1f1f; border: 1px solid #f5c2c2; }

/* Forms */
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
label.check input { width: auto; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 9px; font: inherit; color: var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-light); box-shadow: 0 0 0 4px rgba(31,95,168,.12); }
textarea { min-height: 110px; resize: vertical; }
.form-group { margin-bottom: 16px; }
.form-group small { display: block; margin-top: 4px; font-size: .78rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.form-grid .span-2 { grid-column: span 2; }
.form-section { padding-bottom: 8px; margin-bottom: 20px; border-bottom: 1px dashed var(--line); }
.form-section h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; align-items: center; flex: 1; flex-wrap: wrap; }
.filters input { max-width: 340px; } .filters select { max-width: 180px; }
.check-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: #f8fafc; padding: 14px; border-radius: 10px; }
.cat-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: #eef3fa; color: var(--navy); vertical-align: middle; margin-right: 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 9px; font-weight: 600; font-size: .9rem; border: 2px solid transparent; cursor: pointer; font-family: inherit; transition: .2s; line-height: 1.2; }
.btn-primary { background: var(--navy); color: #fff; } .btn-primary:hover { background: var(--navy-light); }
.btn-outline { border-color: var(--navy); color: var(--navy); background: #fff; } .btn-outline:hover { background: var(--navy); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: .82rem; } .btn-lg { padding: 13px 26px; font-size: 1rem; } .btn-block { width: 100%; justify-content: center; }

/* Inquiries */
.inquiry-list { display: flex; flex-direction: column; gap: 14px; }
.inquiry { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.inquiry.unread { border-color: #f5c9a8; background: #fffaf5; }
.inquiry-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.inquiry p { margin: 0; white-space: pre-wrap; }

/* Login */
.login-body { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(900px 500px at 80% -10%, #2d74c4 0%, transparent 60%), linear-gradient(135deg, var(--navy-dark), var(--navy)); padding: 20px; }
.login-card { background: #fff; border-radius: 18px; padding: 40px; width: 100%; max-width: 420px; box-shadow: 0 30px 80px rgba(0,0,0,.35); text-align: center; }
.login-logo { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; margin: 0 auto 16px; display: block; }
.login-card h1 { font-size: 1.5rem; margin-bottom: 4px; }
.login-card form { text-align: left; margin-top: 22px; }
.login-card .small { margin-top: 18px; }

/* Responsive */
@media (max-width: 1200px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: -260px; z-index: 30; transition: .25s; height: 100vh; }
  .sidebar.open { left: 0; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .sidebar-toggle { display: block; }
  .grid-2, .form-grid, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .check-grid { grid-template-columns: 1fr; }
  .content { padding: 18px; }
}
