/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy:    #1E3A5F;
  --gold:    #C9A84C;
  --gold2:   #E8C87A;
  --bg:      #F2F4F7;
  --surface: #FFFFFF;
  --border:  #E5E7EB;
  --text:    #1A1A2E;
  --muted:   #6B7280;
  --danger:  #DC2626;
  --success: #16A34A;
  --radius:  10px;
  --shadow:  0 2px 12px rgba(0,0,0,.07);
  --sidebar: 240px;
  --topbar:  60px;
}
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
a { text-decoration: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 13px; }
h1,h2,h3,h4 { font-weight: 700; }

/* ── Login ────────────────────────────────────────────────── */
.login-overlay { position: fixed; inset: 0; background: var(--navy); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.login-card { background: #fff; border-radius: 20px; padding: 44px 36px 36px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-logo { font-size: 36px; color: var(--gold); text-align: center; margin-bottom: 8px; }
.login-title { font-family: 'Instrument Serif', serif; font-size: 28px; text-align: center; color: var(--navy); }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.login-hint { font-size: 11px; color: var(--muted); text-align: center; margin-top: 14px; }

/* ── App Layout ───────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }
aside#sidebar { width: var(--sidebar); background: var(--navy); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transition: transform .25s; }
main#main { margin-left: var(--sidebar); flex: 1; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar-brand { padding: 20px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-icon { color: var(--gold); font-size: 20px; }
.brand-name { color: #fff; font-weight: 800; font-size: 15px; font-family: 'Instrument Serif', serif; }
.brand-sub { color: rgba(255,255,255,.5); font-size: 11px; }
.sidebar-nav { flex: 1; padding: 12px 10px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 8px; color: rgba(255,255,255,.7); font-weight: 500; font-size: 13px; transition: all .18s; margin-bottom: 2px; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.12); color: #fff; }
.nav-item.active .nav-icon { color: var(--gold); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; justify-content: space-between; }
#sidebar-user { color: rgba(255,255,255,.7); font-size: 12px; }
.btn-logout { background: rgba(255,255,255,.1); border: none; color: rgba(255,255,255,.7); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: background .18s; }
.btn-logout:hover { background: rgba(220,50,50,.4); color: #fff; }

/* ── Top Bar ──────────────────────────────────────────────── */
.topbar { height: var(--topbar); background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; gap: 14px; position: sticky; top: 0; z-index: 50; }
.hamburger { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text); }
.page-title { font-size: 16px; font-weight: 700; flex: 1; }
.topbar-actions { display: flex; gap: 8px; }

/* ── Views ────────────────────────────────────────────────── */
.view { padding: 24px; }

/* ── Stats ────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; box-shadow: var(--shadow); }
.stat-icon { font-size: 24px; margin-bottom: 8px; }
.stat-val { font-size: 28px; font-weight: 800; color: var(--navy); }
.stat-lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Section Header ───────────────────────────────────────── */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-header h3 { font-size: 16px; font-weight: 700; }
.search-input { padding: 8px 14px; border: 1px solid var(--border); border-radius: 20px; font-family: inherit; font-size: 13px; outline: none; width: 220px; transition: border-color .2s; }
.search-input:focus { border-color: var(--navy); }

/* ── Cards Grid ───────────────────────────────────────────── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card-item { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.card-item:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.card-cover { height: 80px; display: flex; flex-direction: column; align-items: center; padding-bottom: 0; position: relative; }
.card-avatar { width: 60px; height: 60px; border-radius: 50%; border: 3px solid #fff; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.2); position: absolute; bottom: -30px; background: #ccc; }
.card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.card-avatar-init { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; font-weight: 700; }
.card-info { padding: 38px 16px 14px; text-align: center; border-bottom: 1px solid var(--border); }
.card-info .c-name { font-weight: 700; font-size: 15px; font-family: 'Instrument Serif', serif; }
.card-info .c-title { font-size: 12px; font-weight: 600; margin-top: 2px; }
.card-info .c-dept { font-size: 11px; color: var(--muted); }
.card-badges { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 8px; }
.badge { border-radius: 20px; padding: 2px 8px; font-size: 10px; font-weight: 700; }
.badge-blue { background: #EFF6FF; color: #1D4ED8; }
.badge-green { background: #F0FDF4; color: #166534; }
.badge-amber { background: #FFFBEB; color: #92400E; }
.badge-red { background: #FEF2F2; color: #991B1B; }
.card-actions { padding: 10px 12px; display: flex; gap: 8px; }
.card-qr { padding: 0 12px 12px; display: flex; align-items: center; gap: 8px; }
.card-qr img { border-radius: 4px; border: 1px solid var(--border); }
.card-qr-url { font-size: 10px; color: var(--muted); word-break: break-all; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn { padding: 8px 16px; border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all .18s; display: inline-flex; align-items: center; gap: 5px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #162D4E; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-full { width: 100%; justify-content: center; padding: 11px; }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 16px; color: var(--muted); padding: 4px; transition: color .18s; }
.btn-icon:hover { color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 11px; }

/* ── Forms ────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .8px; text-transform: uppercase; margin-bottom: 5px; }
.field input[type=text], .field input[type=email], .field input[type=url], .field input[type=password], .field input[type=number], .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 13px; color: var(--text); outline: none; transition: border-color .2s; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(30,58,95,.08); }
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-container { max-width: 760px; background: #fff; border-radius: var(--radius); border: 1px solid var(--border); padding: 28px; }
.form-title { font-size: 18px; margin-bottom: 24px; color: var(--navy); }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; }
.upload-label { cursor: pointer; white-space: nowrap; }
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.alert-error { background: #FEF2F2; border: 1px solid #FECACA; color: #DC2626; }
.alert-success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534; }

/* ── Color Fields ─────────────────────────────────────────── */
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type=color] { width: 44px; height: 36px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; padding: 2px; background: #fff; }
.color-txt { width: 90px !important; }

/* ── Social Grid ──────────────────────────────────────────── */
.social-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.social-field { display: flex; align-items: center; gap: 8px; }
.social-field .field { flex: 1; margin: 0; }
.social-badge { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; flex-shrink: 0; }
.ig { background: #E1306C; }
.fb { background: #1877F2; }
.tw { background: #000; }
.li { background: #0A66C2; }
.yt { background: #FF0000; }
.tt { background: #E5007C; }

/* ── Design Preview ───────────────────────────────────────── */
.design-preview { min-height: 140px; border-radius: 12px; overflow: hidden; margin-bottom: 20px; background: #f2f4f7; }
.design-preview-bar { height: 6px; flex: 1; border-radius: 3px; }

/* ── Photo Preview ────────────────────────────────────────── */
.photo-preview-row { display: flex; gap: 16px; align-items: flex-start; padding: 16px; background: var(--bg); border-radius: 10px; margin-bottom: 16px; }
.avatar-preview { width: 70px; height: 70px; border-radius: 50%; background: var(--navy); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; font-weight: 700; flex-shrink: 0; border: 3px solid #fff; box-shadow: var(--shadow); overflow: hidden; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ── CTA / Video / Publication items ─────────────────────── */
.dynamic-item { background: var(--bg); border-radius: 10px; padding: 14px; margin-bottom: 10px; border: 1px solid var(--border); position: relative; }
.dynamic-item .remove-item { position: absolute; top: 10px; right: 10px; background: #FEE2E2; border: 1px solid #FECACA; color: var(--danger); border-radius: 6px; padding: 3px 8px; font-size: 11px; cursor: pointer; font-family: inherit; }
.content-section h4 { font-size: 14px; margin-bottom: 14px; color: var(--navy); }
.section-intro { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 20px; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 760px; display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.modal-sm { max-width: 380px; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.modal-header h3 { font-size: 16px; }
.modal-header-actions { display: flex; gap: 8px; align-items: center; }
.modal-tabs { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--border); flex-shrink: 0; padding: 0 12px; }
.tab { padding: 12px 14px; border: none; background: none; font-family: inherit; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: all .18s; }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); }
.modal-body { overflow-y: auto; padding: 24px 24px 32px; flex: 1; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Toast ────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--text); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 20px rgba(0,0,0,.2); transform: translateY(100px); opacity: 0; transition: all .3s; z-index: 999; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  aside#sidebar { transform: translateX(-100%); }
  aside#sidebar.open { transform: translateX(0); }
  main#main { margin-left: 0; }
  .hamburger { display: block; }
  .field-row { grid-template-columns: 1fr; }
  .social-grid { grid-template-columns: 1fr; }
  .topbar-actions .btn span { display: none; }
}
/* ── Append to admin.css ───────────────────────────────────── */
/* Services nav tabs in admin view */
.services-tabs-nav{display:flex;gap:6px;margin-bottom:16px;flex-wrap:wrap;}
/* Chart wrapper */
.chart-wrap{background:#fff;border-radius:12px;padding:20px 16px;border:1px solid var(--border);box-shadow:var(--shadow);}
/* Sidebar extra link */
.sidebar-extra{padding:0 10px 8px;}
.nav-item-outline{color:rgba(255,255,255,.6)!important;border:1px solid rgba(255,255,255,.2)!important;font-size:12px!important;}
.nav-item-outline:hover{color:#fff!important;background:rgba(255,255,255,.1)!important;}
/* Service type buttons in modal */
.type-btn{padding:7px 14px;border-radius:8px;border:1px solid var(--border);background:transparent;color:var(--muted);font-family:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:all .18s;}
.type-btn.active{background:var(--navy);color:#fff;border-color:var(--navy);}
/* View-all link */
.view-all-link{font-size:13px;color:var(--navy);font-weight:600;}
.view-all-link:hover{text-decoration:underline;}

/* ── Toggle Switch ────────────────────────────────────────── */
.toggle-switch { position: relative; display: inline-block; width: 46px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; border-radius: 24px; transition: .3s; }
.toggle-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .3s; }
.toggle-switch input:checked + .toggle-slider { background: var(--navy); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(22px); }

/* ── Button style previews ────────────────────────────────── */
.btn-preview-opt { background: none; border: 2px solid transparent; border-radius: 8px; padding: 4px; cursor: pointer; transition: border-color .18s; }
.btn-preview-opt.active { border-color: var(--gold); }
.btn-preview-opt:hover { border-color: var(--border); }

/* ── Wide Modal with Preview Pane ─────────────────────────── */
.modal-wide { max-width: 1100px; display: flex; flex-direction: row; flex-wrap: nowrap; max-height: calc(100vh - 40px); }
.modal-wide .modal-header  { flex-shrink: 0; width: 100%; border-bottom: 1px solid var(--border); }
.modal-wide .modal-tabs    { flex-shrink: 0; }
.modal-wide .modal-body    { flex: 1; min-width: 0; overflow-y: auto; }

/* When preview is shown, layout changes to side-by-side */
.modal-wide.show-preview { flex-direction: column; }
.modal-wide.show-preview .modal-content-wrap { display: flex; flex-direction: row; flex: 1; min-height: 0; overflow: hidden; }
.modal-wide.show-preview .modal-body  { flex: 1; min-width: 0; overflow-y: auto; border-right: 1px solid var(--border); }
.modal-wide.show-preview .preview-pane { display: flex !important; }

/* ── Preview Pane ─────────────────────────────────────────── */
.preview-pane { width: 420px; flex-shrink: 0; display: none; flex-direction: column; background: #E8EBF0; overflow: hidden; }
.preview-pane-header { background: #fff; border-bottom: 1px solid var(--border); padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.preview-pane-title  { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.preview-pane-body   { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 16px 12px; }
.preview-device-switcher { display: flex; gap: 4px; }
.dev-btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; background: transparent; font-size: 11px; cursor: pointer; color: var(--muted); font-family: inherit; transition: all .18s; }
.dev-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── Phone Frame ──────────────────────────────────────────── */
.phone-frame { background: #1a1a2e; border-radius: 36px; padding: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.35); width: 360px; transition: width .3s; }
.phone-frame::before { content: ''; display: block; width: 80px; height: 6px; background: #333; border-radius: 3px; margin: 0 auto 10px; }
.phone-frame iframe { width: 100%; height: 580px; border-radius: 24px; display: block; border: none; background: #f2f4f7; }
.preview-hint { font-size: 11px; color: #888; margin-top: 10px; text-align: center; }

/* ── Wrap for column inside modal ─────────────────────────── */
.modal-content-wrap { display: contents; }
.modal-wide { flex-direction: column; }

@media (max-width: 900px) {
  .modal-wide.show-preview .modal-content-wrap { flex-direction: column; }
  .preview-pane { width: 100%; height: 500px; }
}
