/* public_html/assets/css/main.css */

/* =========================
   NOBLEXTRADE UI KIT (Modern Blue)
   ========================= */
:root{
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #0F172A;
  --muted: #475569;
  --border: #E2E8F0;

  --primary: #1D4ED8;  /* royal blue */
  --primary-600: #1E40AF;
  --primary-50: #EFF6FF;

  --accent: #22C55E;   /* emerald */
  --accent-600: #16A34A;
  --accent-50: #F0FDF4;

  --danger: #EF4444;
  --warning: #F59E0B;

  --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 6px 16px rgba(15, 23, 42, 0.06);

  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 10px;

  --container: 1120px;

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

/* Base reset */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
img{max-width:100%;display:block}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}
::selection{background: rgba(29,78,216,0.18)}

/* Layout helpers */
.container{
  width:100%;
  max-width:var(--container);
  margin:0 auto;
  padding:0 16px;
}

.page{
  min-height:100%;
  display:flex;
  flex-direction:column;
}

main{flex:1}

/* Top bar (public + dashboard can reuse) */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(248,250,252,0.86);
  backdrop-filter:saturate(1.4) blur(10px);
  border-bottom:1px solid var(--border);
}
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 0;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  letter-spacing:-0.02em;
}
.brand-badge{
  width:40px;height:40px;
  border-radius:12px;
  background:linear-gradient(135deg, var(--primary), #3B82F6);
  color:#fff;
  display:grid;
  place-items:center;
  box-shadow: var(--shadow-soft);
  font-weight:900;
}
.nav{
  display:flex;
  align-items:center;
  gap:10px;
}
.nav a{
  padding:10px 12px;
  border-radius:12px;
  color:var(--muted);
  font-weight:700;
}
.nav a:hover{
  background:rgba(29,78,216,0.06);
  color:var(--text);
}

/* Hero */
.hero{
  padding:34px 0 18px;
}
.hero-grid{
  display:grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap:18px;
  align-items:stretch;
}
@media (max-width: 900px){
  .hero-grid{grid-template-columns:1fr}
}
.hero-card{
  background:linear-gradient(180deg, #FFFFFF, #F9FBFF);
  border:1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding:22px;
  overflow:hidden;
  position:relative;
}
.hero-card::before{
  content:"";
  position:absolute;
  inset:-60px -60px auto auto;
  width:220px;height:220px;
  background: radial-gradient(circle at 30% 30%, rgba(34,197,94,0.20), transparent 60%);
  pointer-events:none;
}
.hero-kicker{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background: rgba(29,78,216,0.08);
  color: var(--primary-600);
  font-weight:800;
  font-size:13px;
}
.h1{
  margin:12px 0 8px;
  font-size:40px;
  line-height:1.05;
  letter-spacing:-0.03em;
}
@media (max-width: 520px){
  .h1{font-size:32px}
}
.p{
  margin:0;
  color:var(--muted);
  line-height:1.6;
  font-size:15.5px;
}
.hero-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

/* Cards + sections */
.section{padding:18px 0}
.section-title{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.section-title h2{
  margin:0;
  font-size:20px;
  letter-spacing:-0.02em;
}
.grid{
  display:grid;
  gap:12px;
}
.grid.cols-3{grid-template-columns:repeat(3,1fr)}
.grid.cols-2{grid-template-columns:repeat(2,1fr)}
@media (max-width: 900px){
  .grid.cols-3{grid-template-columns:1fr}
  .grid.cols-2{grid-template-columns:1fr}
}
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft);
  padding:16px;
}
.card h3{
  margin:0 0 6px;
  font-size:15.5px;
  letter-spacing:-0.01em;
}
.card p{
  margin:0;
  color:var(--muted);
  line-height:1.55;
  font-size:14.5px;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:12px 14px;
  border-radius: 14px;
  border:1px solid transparent;
  font-weight:800;
  cursor:pointer;
  transition: transform .05s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
  user-select:none;
}
.btn:active{transform: translateY(1px)}
.btn-primary{
  background: var(--primary);
  color:#fff;
  box-shadow: 0 10px 18px rgba(29,78,216,0.20);
}
.btn-primary:hover{background: var(--primary-600)}
.btn-accent{
  background: var(--accent);
  color:#fff;
  box-shadow: 0 10px 18px rgba(34,197,94,0.18);
}
.btn-accent:hover{background: var(--accent-600)}
.btn-ghost{
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover{background: rgba(29,78,216,0.05); border-color: rgba(29,78,216,0.20)}
.btn-link{
  background:transparent;
  border-color:transparent;
  color: var(--primary-600);
  padding:10px 10px;
}
.btn-link:hover{background: rgba(29,78,216,0.06)}

/* Forms */
.form{
  display:grid;
  gap:10px;
}
.label{
  font-weight:800;
  font-size:13px;
  color:var(--text);
}
.input, .select, .textarea{
  width:100%;
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  background:#fff;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus{
  border-color: rgba(29,78,216,0.45);
  box-shadow: 0 0 0 4px rgba(29,78,216,0.12);
}
.help{
  margin:0;
  font-size:12.5px;
  color:var(--muted);
  line-height:1.45;
}

/* Alerts */
.alert{
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid;
  font-weight:700;
  font-size:14px;
}
.alert-success{
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.25);
  color: #166534;
}
.alert-danger{
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.25);
  color: #7F1D1D;
}
.alert-info{
  background: rgba(29,78,216,0.08);
  border-color: rgba(29,78,216,0.25);
  color: #1E3A8A;
}

/* Footer */
.footer{
  border-top:1px solid var(--border);
  padding:18px 0;
  color:var(--muted);
  font-size:13px;
}
.footer a{color:var(--primary-600); font-weight:800}
.footer a:hover{text-decoration:underline}

/* Small utilities */
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.spacer{height:10px}
.badge{
  display:inline-flex;align-items:center;gap:8px;
  padding:6px 10px;border-radius:999px;
  background: rgba(34,197,94,0.10);
  color:#166534;
  font-weight:900;
  font-size:12px;
}
.kpi{
  display:grid;gap:4px;
}
.kpi .v{font-weight:900;font-size:20px;letter-spacing:-0.02em}
.kpi .k{color:var(--muted);font-weight:800;font-size:12.5px}
/* =========================
   DASHBOARD (mobile-first)
   ========================= */
.dash-wrap{
  padding: 18px 0;
}
.dash-grid{
  display:grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  align-items:start;
}
@media (max-width: 980px){
  .dash-grid{grid-template-columns:1fr}
}

.dash-side{
  position: sticky;
  top: 76px; /* below sticky header */
}
@media (max-width: 980px){
  .dash-side{position: static; top:auto}
}

.dash-menu{
  display:flex;
  flex-direction:column;
  gap:8px;
}
@media (max-width: 980px){
  .dash-menu{
    flex-direction:row;
    overflow:auto;
    padding-bottom:6px;
  }
  .dash-menu::-webkit-scrollbar{height:6px}
}

.dash-link{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  background:#fff;
  color: var(--text);
  font-weight:900;
  white-space:nowrap;
}
.dash-link:hover{
  border-color: rgba(29,78,216,0.25);
  background: rgba(29,78,216,0.05);
}
.dash-link.active{
  border-color: rgba(29,78,216,0.35);
  background: rgba(29,78,216,0.08);
  color: var(--primary-600);
}
.dash-ico{
  width:18px;height:18px; flex:0 0 18px;
  color: var(--primary);
}

.kpi-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 900px){
  .kpi-grid{grid-template-columns:1fr}
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius: var(--r-lg);
  background:#fff;
}
.table th, .table td{
  padding:12px;
  text-align:left;
  border-bottom:1px solid var(--border);
  font-size:14px;
}
.table th{color:var(--muted); font-weight:900; background: rgba(15,23,42,0.02)}
.table tr:last-child td{border-bottom:none}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  font-weight:900;
  font-size:12px;
  color: var(--text);
}
.pill.blue{
  border-color: rgba(29,78,216,0.25);
  background: rgba(29,78,216,0.06);
  color: var(--primary-600);
}
.pill.green{
  border-color: rgba(34,197,94,0.25);
  background: rgba(34,197,94,0.06);
  color: #166534;
}
/* =========================
   FINAL UI POLISH (mobile)
   ========================= */
@media (max-width: 520px){
  .topbar-inner{gap:10px}
  .brand img{height:30px !important}
  .nav{gap:8px}
  .nav .btn{padding:10px 10px; font-size:13px}
}

.btn{touch-action: manipulation}
.input, .select, .textarea{font-size:16px} /* prevents iOS zoom */
.card{overflow:hidden} /* clean edges on mobile */
.table{display:block; overflow:auto} /* tables scroll cleanly on phones */
