/* AxoBilling Dashboard — Feuille de style principale */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:     #08090c;
  --bg2:    #0e1016;
  --bg3:    #13151c;
  --card:   #131620;
  --border: rgba(255,255,255,.075);
  --border2: rgba(255,255,255,.12);
  --muted:  rgba(255,255,255,.38);
  --light:  rgba(255,255,255,.6);
  --white:  #ffffff;
  --accent: #5b6cf9;
  --accent-glow: rgba(91,108,249,.25);
  --green:  #4ade80;
  --red:    #f87171;
  --yellow: #fbbf24;
  --blue:   #60a5fa;
  --radius: 10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg);
  color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
  font-size: 14.5px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
code { font-family: 'Courier New', monospace; background: rgba(255,255,255,.07); padding: 1px 5px; border-radius: 4px; font-size: .85em; }

/* ─── TYPOGRAPHY ──────────────────────────────────────────── */
h1 { font-size: clamp(2.2rem,5vw,4rem); font-weight: 700; line-height: 1.1; letter-spacing: -.5px; }
h2 { font-size: clamp(1.5rem,3vw,2.2rem); font-weight: 700; letter-spacing: -.3px; line-height: 1.15; }
h3 { font-size: 1rem; font-weight: 600; }

/* ─── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1.25rem; border-radius: var(--radius);
  font-size: .82rem; font-weight: 600; cursor: pointer;
  border: none; font-family: 'Space Grotesk', sans-serif;
  transition: all .15s; text-decoration: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-white  { background: var(--white); color: var(--bg); }
.btn-white:hover { opacity: .9; }
.btn-ghost  { background: transparent; color: var(--white); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border2); background: rgba(255,255,255,.04); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { opacity: .9; }
.btn-sm     { padding: .42rem .9rem; font-size: .78rem; border-radius: 7px; }
.btn-danger { background: rgba(248,113,113,.1); color: var(--red); border: 1px solid rgba(248,113,113,.22); }
.btn-danger:hover { background: rgba(248,113,113,.18); }
.btn-success { background: rgba(74,222,128,.08); color: var(--green); border: 1px solid rgba(74,222,128,.22); }
.btn-full { width: 100%; justify-content: center; }
.btn i { font-size: .75rem; }

/* ─── FORMS ───────────────────────────────────────────────── */
.form-group  { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.form-label  { font-size: .75rem; font-weight: 600; color: var(--light); letter-spacing: .2px; }
.form-input, .form-select, .form-textarea {
  padding: .7rem .95rem; background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--white); font-size: .875rem;
  font-family: 'Space Grotesk', sans-serif; outline: none; width: 100%;
  transition: border-color .15s, background .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent); background: rgba(91,108,249,.05);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--muted); }
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint  { font-size: .72rem; color: var(--muted); }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .75rem; }

.input-group { display: flex; }
.input-prefix, .input-suffix {
  padding: 0 .9rem; background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; color: var(--muted); font-size: .78rem; white-space: nowrap;
}
.input-prefix { border-right: none; border-radius: var(--radius) 0 0 var(--radius); }
.input-suffix { border-left: none; border-radius: 0 var(--radius) var(--radius) 0; }
.input-group .form-input { border-radius: 0; }
.input-group .form-input:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .form-input:last-child  { border-radius: 0 var(--radius) var(--radius) 0; }

/* ─── TOGGLE ──────────────────────────────────────────────── */
.toggle { position: relative; width: 38px; height: 20px; flex-shrink: 0; cursor: pointer; display: inline-block; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: rgba(255,255,255,.1); border-radius: 999px; border: 1px solid var(--border); transition: background .2s; }
.toggle-slider::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::after { transform: translateX(18px); background: #fff; }

/* ─── CARDS ───────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; }
.card-body { padding: 1.5rem; }
.card-title { font-size: .88rem; font-weight: 700; margin-bottom: .2rem; }
.card-sub   { font-size: .78rem; color: var(--muted); margin-bottom: 1rem; }

/* ─── ALERTS ──────────────────────────────────────────────── */
.alert { padding: .85rem 1.1rem; border-radius: var(--radius); font-size: .84rem; margin-bottom: 1rem; display: flex; align-items: center; gap: .6rem; }
.alert-success { background: rgba(74,222,128,.07); border: 1px solid rgba(74,222,128,.2); color: var(--green); }
.alert-error   { background: rgba(248,113,113,.07); border: 1px solid rgba(248,113,113,.2); color: var(--red); }
.alert-warning { background: rgba(251,191,36,.07); border: 1px solid rgba(251,191,36,.2); color: var(--yellow); }
.alert-info    { background: rgba(96,165,250,.07); border: 1px solid rgba(96,165,250,.2); color: var(--blue); }

/* ─── BADGES ──────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .55rem; border-radius: 5px; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.badge-free    { background: rgba(255,255,255,.07); color: var(--muted); }
.badge-pro     { background: var(--white); color: var(--bg); }
.badge-success { background: rgba(74,222,128,.1); color: var(--green); }
.badge-warning { background: rgba(251,191,36,.1); color: var(--yellow); }
.badge-error   { background: rgba(248,113,113,.1); color: var(--red); }
.badge-online  { background: rgba(74,222,128,.1); color: var(--green); }
.badge-offline { background: rgba(255,255,255,.06); color: var(--muted); }
.badge::before { content:''; width:5px; height:5px; border-radius:50%; background:currentColor; flex-shrink:0; }
.badge-free::before,.badge-offline::before { display:none; }

/* ─── TABLES ──────────────────────────────────────────────── */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--muted); padding: .7rem 1.1rem; text-align: left;
  border-bottom: 1px solid var(--border); white-space: nowrap;
  background: rgba(255,255,255,.015);
}
.data-table td { padding: .82rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.04); font-size: .85rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover td { background: rgba(255,255,255,.025); }

/* ─── LAYOUT ──────────────────────────────────────────────── */
.dash-wrap { display: flex; min-height: 100vh; }

/* ─── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: 232px;
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 50; overflow-y: auto;
}

/* Logo */
.sidebar-logo {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.sidebar-logo-mark {
  display: flex; align-items: center; gap: .45rem;
}
.sidebar-logo-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent-glow);
}
.sidebar-logo-text { font-size: 1rem; font-weight: 700; letter-spacing: -.2px; color: var(--white); }
.sidebar-logo-text span { color: var(--muted); }
.sidebar-plan { font-size: .6rem; font-weight: 700; padding: .15rem .5rem; border-radius: 4px; }
.sidebar-plan-free { background: rgba(255,255,255,.06); color: var(--muted); }
.sidebar-plan-pro  { background: rgba(91,108,249,.15); color: #818cf8; }

/* Nav groups */
.sidebar-nav { padding: .65rem 0; flex: 1; overflow-y: auto; }
.sidebar-group-label {
  font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2.5px;
  color: rgba(255,255,255,.2); padding: .7rem 1.25rem .3rem;
}
.sidebar-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .52rem 1.25rem;
  color: var(--muted); text-decoration: none;
  font-size: .82rem; font-weight: 500;
  transition: background .12s, color .12s;
  border-radius: 0;
  position: relative;
}
.sidebar-link:hover { background: rgba(255,255,255,.04); color: rgba(255,255,255,.75); }
.sidebar-link.active {
  background: rgba(91,108,249,.1);
  color: var(--white);
}
.sidebar-link.active::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--accent); border-radius: 0 2px 2px 0;
}
.sidebar-link .sl-icon {
  width: 26px; height: 26px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; flex-shrink: 0;
  background: rgba(255,255,255,.05);
  transition: background .12s;
}
.sidebar-link:hover .sl-icon { background: rgba(255,255,255,.08); }
.sidebar-link.active .sl-icon { background: rgba(91,108,249,.2); color: #818cf8; }
.sidebar-link .sl-label { flex: 1; }
.sidebar-link .badge-sm {
  font-size: .6rem; font-weight: 700; background: rgba(255,255,255,.08);
  color: var(--light); padding: .1rem .42rem; border-radius: 999px;
}
.sidebar-link .badge-sm.pro { background: rgba(91,108,249,.2); color: #818cf8; }

/* Shop mini card in sidebar */
.sidebar-shop-item {
  display: flex; align-items: center; gap: .55rem;
  padding: .5rem 1.25rem;
  color: var(--muted); text-decoration: none;
  font-size: .8rem; font-weight: 500;
  transition: background .12s, color .12s;
}
.sidebar-shop-item:hover { background: rgba(255,255,255,.04); color: rgba(255,255,255,.75); }
.sidebar-shop-thumb {
  width: 22px; height: 22px; border-radius: 5px;
  background: rgba(255,255,255,.07); display: flex; align-items: center;
  justify-content: center; font-size: .6rem; flex-shrink: 0; overflow: hidden;
}
.sidebar-shop-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Sidebar footer */
.sidebar-footer {
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.user-snippet { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; flex-shrink: 0;
  color: #fff; text-transform: uppercase;
}
.user-name  { font-size: .8rem; font-weight: 600; line-height: 1.2; }
.user-email { font-size: .67rem; color: var(--muted); }

/* ─── MAIN AREA ───────────────────────────────────────────── */
.main-area {
  margin-left: 232px; flex: 1;
  display: flex; flex-direction: column; min-height: 100vh;
}

/* Topbar */
.topbar {
  padding: 0 2rem; height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(8,9,12,.75); backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 40; gap: 1rem;
  flex-shrink: 0;
}
.topbar-title { font-size: .9rem; font-weight: 700; color: var(--white); }
.topbar-breadcrumb { display: flex; align-items: center; gap: .45rem; font-size: .8rem; color: var(--muted); }
.topbar-breadcrumb .sep { opacity: .35; }
.topbar-right { display: flex; align-items: center; gap: .6rem; }

/* Page content */
.page-content { padding: 1.75rem 2rem; flex: 1; }
.page-header { margin-bottom: 1.6rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -.2px; }
.page-sub   { font-size: .8rem; color: var(--muted); margin-top: .2rem; }

/* ─── STAT BOXES ──────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: .85rem; margin-bottom: 1.75rem; }
.stat-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.25rem 1.4rem;
  transition: border-color .2s;
}
.stat-box:hover { border-color: rgba(255,255,255,.13); }
.stat-box-icon-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: .7rem; }
.stat-box-ico { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.stat-box-label { font-size: .7rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-box-val { font-size: 1.65rem; font-weight: 700; letter-spacing: -.5px; line-height: 1; margin-bottom: .25rem; }
.stat-box-sub { font-size: .72rem; color: var(--muted); }

/* ─── PRODUCT CARDS ───────────────────────────────────────── */
.product-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: border-color .2s, transform .15s; display: flex; flex-direction: column; }
.product-card:hover { border-color: rgba(255,255,255,.14); transform: translateY(-2px); }
.product-card-img { width: 100%; height: 140px; object-fit: cover; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.product-card-body { padding: 1.1rem; flex: 1; display: flex; flex-direction: column; }
.product-card-name { font-size: .9rem; font-weight: 600; margin-bottom: .3rem; }
.product-card-desc { font-size: .78rem; color: var(--muted); line-height: 1.6; flex: 1; margin-bottom: 1rem; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.product-price { font-size: 1.1rem; font-weight: 700; letter-spacing: -.3px; }

/* ─── MODAL ───────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(6px); z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s; padding: 1rem; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.75rem; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; transform: scale(.97) translateY(8px); transition: transform .2s; }
.modal-overlay.open .modal { transform: none; }
.modal-title { font-size: 1rem; font-weight: 700; margin-bottom: .2rem; }
.modal-sub { font-size: .8rem; color: var(--muted); margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: .65rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* ─── UPLOAD ZONE ─────────────────────────────────────────── */
.upload-zone { border: 1px dashed var(--border); border-radius: 12px; padding: 1.5rem; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.upload-zone:hover { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.02); }
.upload-zone p { font-size: .8rem; color: var(--muted); margin-top: .35rem; }

/* ─── KEY BOX ──────────────────────────────────────────────── */
.key-box { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.key-val { font-family: 'Courier New', monospace; font-size: .78rem; color: var(--light); word-break: break-all; }

/* ─── PROGRESS ─────────────────────────────────────────────── */
.progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width .4s; }

/* ─── SECTION LABEL ───────────────────────────────────────── */
.section-label { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); }

/* ─── ANIMATIONS ───────────────────────────────────────────── */
.fade-up { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.fade-up.visible { opacity: 1; transform: none; }

/* ─── STORE NAV (landing) ─────────────────────────────────── */
.store-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 5%; background: rgba(8,9,12,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.store-nav-logo { font-size: 1.1rem; font-weight: 800; }
.store-nav-actions { display: flex; align-items: center; gap: 1rem; }

/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s cubic-bezier(.4,0,.2,1); }
  .sidebar.open { transform: none; box-shadow: 8px 0 32px rgba(0,0,0,.5); }
  .main-area { margin-left: 0; }
  .stats-row, .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .topbar, .page-content { padding-left: 1rem; padding-right: 1rem; }
  .table-wrap { overflow-x: auto; }
  .modal { padding: 1.25rem; }
}

/* Mobile sidebar toggle */
@media (max-width: 768px) {
  #sidebar-toggle { display: block !important; }
}
