/* ExcelNeon NFC Card app - login, dashboard, admin. Self-contained (does not use main style.css). */
:root {
  --blue: #0041FF;
  --blue-dark: #0033cc;
  --gold: #e6a000;
  --gold-text: #7a5300;
  --bg: #f5f5f7;
  --card: #ffffff;
  --line: rgba(0,0,0,0.1);
  --text: #111111;
  --muted: #555566;
  --red: #c62828;
  --green: #1b7a3a;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Open Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { font-family: 'Poppins', 'Open Sans', sans-serif; line-height: 1.2; }
img { max-width: 100%; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 10px; border: 2px solid transparent; font: 600 15px/1 'Open Sans', sans-serif; cursor: pointer; transition: .2s; text-decoration: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn-gold { background: var(--gold); color: #000; }
.btn-outline { background: #fff; color: var(--text); border-color: rgba(0,0,0,0.15); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger { background: #fff; color: var(--red); border-color: rgba(198,40,40,.35); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: #222; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 12px 14px; border: 1.5px solid rgba(0,0,0,0.15); border-radius: 10px; font: 15px 'Open Sans', sans-serif; background: #fff; color: var(--text); }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,65,255,.12); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* Auth pages */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; background: radial-gradient(circle at 20% 0%, rgba(0,65,255,.10), transparent 50%), radial-gradient(circle at 100% 100%, rgba(230,160,0,.12), transparent 45%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 34px 30px; box-shadow: 0 20px 60px rgba(0,0,0,.08); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 18px; color: var(--text); }
.auth-brand img { width: 38px; height: 38px; border-radius: 50%; }
.auth-brand span { color: var(--gold-text); }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.auth-foot { text-align: center; font-size: 14px; color: var(--muted); margin-top: 18px; }
.notice { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.notice-info { background: rgba(0,65,255,.08); color: #0a2a8a; }
.notice-ok { background: rgba(27,122,58,.1); color: var(--green); }
.notice-warn { background: rgba(230,160,0,.15); color: var(--gold-text); }
.uname-status { font-size: 12px; margin-top: 4px; min-height: 16px; }
.uname-status.ok { color: var(--green); } .uname-status.bad { color: var(--red); }

/* Dashboard */
.dash-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 10px 5%; gap: 12px; }
.dash-brand { display: flex; align-items: center; gap: 10px; font-family: 'Poppins', sans-serif; font-weight: 800; color: var(--text); }
.dash-brand img { width: 36px; height: 36px; border-radius: 50%; }
.dash-brand span { color: var(--gold-text); }
.dash-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.dash-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #ddd; }
.dash-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 5%; background: #fff; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.dash-tabs::-webkit-scrollbar { display: none; }
.tab-btn { flex: 0 0 auto; border: 0; background: transparent; padding: 10px 16px; border-radius: 10px; font: 600 14px 'Open Sans', sans-serif; color: var(--muted); cursor: pointer; }
.tab-btn.active { background: var(--blue); color: #fff; }
.dash-body { max-width: 860px; margin: 0 auto; padding: 24px 16px 80px; }
.tab-section { display: none; }
.tab-section.active { display: block; }
.card { background: var(--card); border-radius: var(--radius); padding: 24px; margin-bottom: 18px; border: 1px solid var(--line); }
.card h2 { font-size: 18px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.card h2 i { color: var(--blue); }
.card .desc { color: var(--muted); font-size: 13px; margin: -8px 0 16px; }

/* Image uploads */
.img-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 640px) { .img-row { grid-template-columns: 1fr; } }
.img-up { border: 2px dashed rgba(0,0,0,.15); border-radius: 12px; padding: 14px; text-align: center; cursor: pointer; transition: .2s; background: #fafafa; }
.img-up:hover, .img-up.drag { border-color: var(--blue); background: rgba(0,65,255,.04); }
.img-up .thumb { width: 84px; height: 84px; margin: 0 auto 8px; border-radius: 50%; background: #e9e9ee center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: #999; font-size: 26px; }
.img-up.logo .thumb { border-radius: 12px; background-size: contain; background-color: #fff; border: 1px solid var(--line); }
.img-up.cover .thumb { width: 100%; height: 84px; border-radius: 10px; }
.img-up b { display: block; font-size: 14px; }
.img-up small { color: var(--muted); font-size: 12px; }

/* Links list */
.add-link-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .add-link-row { grid-template-columns: 1fr; } }
.link-wrap { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: #fff; }
.link-wrap.hidden-link { opacity: .5; }
.link-row { display: flex; align-items: center; gap: 12px; padding: 12px; }
.drag-handle { cursor: grab; color: #999; font-size: 18px; padding: 0 4px; user-select: none; }
.link-icon { width: 36px; height: 36px; border-radius: 10px; background: rgba(0,65,255,.08); color: var(--blue); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.link-info { flex: 1; min-width: 0; }
.link-label { font-weight: 700; font-size: 14px; }
.link-url { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: #f0f0f4; color: var(--text); }
.icon-btn.del:hover { color: var(--red); }
.link-edit { display: none; padding: 0 12px 12px; }
.link-edit.open { display: block; }
.empty { text-align: center; color: var(--muted); padding: 24px; font-size: 14px; }
.sortable-ghost { opacity: .4; }

/* Theme */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 42px; height: 42px; border-radius: 50%; cursor: pointer; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.swatch.selected { box-shadow: 0 0 0 3px var(--blue); }
.style-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.style-opt { border: 2px solid var(--line); background: #fff; padding: 10px 16px; border-radius: 10px; cursor: pointer; font: 600 13px 'Open Sans', sans-serif; }
.style-opt.selected { border-color: var(--blue); color: var(--blue); }

/* Share */
.share-box { display: flex; gap: 10px; margin-bottom: 12px; }
.share-box input { flex: 1; }
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qr-wrap #dash-qr { padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat i { color: var(--blue); }
.stat .num { font: 800 28px 'Poppins', sans-serif; margin: 6px 0 2px; }
.stat .lbl { font-size: 13px; color: var(--muted); }
.stat .sub { font-size: 12px; color: var(--muted); }

/* Tables (admin, my cards) */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.tbl code { background: #f0f0f4; padding: 3px 7px; border-radius: 6px; font-size: 13px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 50px; font-size: 12px; font-weight: 700; }
.badge-ok { background: rgba(27,122,58,.12); color: var(--green); }
.badge-off { background: rgba(198,40,40,.1); color: var(--red); }
.badge-new { background: rgba(230,160,0,.18); color: var(--gold-text); }

/* Toast + loading */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; background: #111; color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 14px; z-index: 999; transition: .3s; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--red); }
.page-loading { display: flex; justify-content: center; padding: 80px 0; }
.spinner { width: 36px; height: 36px; border: 3px solid rgba(0,0,0,.1); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* v2: company + card pages bar, locked field, price quote */
.page-bar { background: #fff; border-bottom: 1px solid var(--line); padding: 14px 5%; }
.page-bar-in { max-width: 860px; margin: 0 auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-bar-in > div { flex: 1; min-width: 220px; }
.company-name { font: 800 17px 'Poppins', sans-serif; display: flex; align-items: center; gap: 8px; }
.company-name .fa-building { color: var(--blue); }
.company-name .lock, .locked-field i { color: var(--gold-text); font-size: 13px; }
.locked-field { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 10px; background: #f0f0f4; border: 1.5px dashed rgba(0,0,0,.15); font-weight: 700; }
.photo-row { margin-bottom: 18px; }
.quote { background: rgba(0,65,255,.06); border-radius: 12px; padding: 14px 16px; margin: 4px 0 16px; font-size: 14px; line-height: 1.8; }
.quote b.total { font: 800 22px 'Poppins', sans-serif; color: var(--blue); }
.badge-paid { background: rgba(0,65,255,.1); color: var(--blue); }
.mini-sel { padding: 7px 10px; border-radius: 8px; border: 1.5px solid rgba(0,0,0,.15); font: 13px 'Open Sans', sans-serif; max-width: 220px; }
/* v3: combined My Page + Portfolio */
.img-row.three { grid-template-columns: 1fr 1fr 2fr; }
@media (max-width: 640px) { .img-row.three { grid-template-columns: 1fr 1fr; } .img-row.three .cover { grid-column: 1 / -1; } }
.form-label small { font-weight: 400; color: var(--muted); }
.pf-imgs { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }
.pf-img { position: relative; width: 86px; height: 86px; border-radius: 10px; background: #eee center/cover no-repeat; border: 1px solid var(--line); }
.pf-img button { position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--red); color: #fff; cursor: pointer; font-size: 12px; }
.pf-add { width: 86px; height: 86px; border: 2px dashed rgba(0,0,0,.18); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; color: var(--muted); font-size: 12px; text-align: center; }
.pf-add:hover { border-color: var(--blue); color: var(--blue); }
.pf-video { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; font-size: 13px; }
.pf-video video { width: 220px; max-width: 100%; border-radius: 10px; background: #000; }
.pf-thumb { width: 36px; height: 36px; border-radius: 10px; background: #eee center/cover no-repeat; flex: 0 0 auto; }
/* v4: designs, Arabic box, leads, review cards */
.designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-bottom: 8px; }
.design { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 8px; cursor: pointer; font: 600 12px 'Open Sans', sans-serif; color: var(--text); text-align: center; }
.design.selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,65,255,.15); }
.design .dz { position: relative; display: block; height: 62px; border-radius: 8px; margin-bottom: 6px; overflow: hidden; }
.design .dz i { position: absolute; left: 10px; right: 10px; bottom: -10px; height: 40px; border-radius: 8px 8px 0 0; border-top: 3px solid; }
.design .dz b { position: absolute; left: 50%; top: 10px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; border: 2px solid #fff; }
.ar-box { border: 1px dashed rgba(0,0,0,.18); border-radius: 12px; padding: 12px 14px; margin: 4px 0 16px; }
.ar-box summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 8px; cursor: pointer; }
.check-row input { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 auto; }
.review-row { display: flex; gap: 6px; min-width: 260px; }
.review-row .form-input { padding: 7px 10px; font-size: 13px; }
