/* Market360 v1.0.0 - assets/style.css */
:root {
  --ink: #20243f;        /* sidebar đậm */
  --ink-2: #2b3054;
  --bg: #f6f5f1;         /* nền giấy ấm */
  --card: #ffffff;
  --primary: #e8542f;    /* cam nhiệt đới - hành động */
  --primary-d: #c43e1d;
  --gold: #f2b33d;
  --green: #1d9e6e;
  --red: #d23b3b;
  --text: #26283a;
  --muted: #7a7d92;
  --line: #e7e5dd;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Be Vietnam Pro', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14.5px; }
a { color: var(--primary); text-decoration: none; }

/* ===== LAYOUT ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 248px; background: var(--ink); color: #cfd2e6; display: flex; flex-direction: column; position: fixed; top:0; bottom:0; left:0; z-index: 50; transition: transform .2s; }
.brand { font-size: 19px; font-weight: 800; color: #fff; padding: 20px 18px 14px; letter-spacing: -.3px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 4px 10px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: #cfd2e6; margin-bottom: 2px; font-weight: 500; }
.sidebar nav a:hover { background: var(--ink-2); color: #fff; }
.sidebar nav a.active { background: var(--primary); color: #fff; }
.sidebar nav a .ic { width: 20px; text-align: center; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--ink-2); }
.credit-box { background: linear-gradient(135deg, #34386a, #2b3054); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.credit-box div { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.credit-box b { color: var(--gold); }
.user-mini { font-size: 13px; line-height: 1.5; }
.user-mini b { color: #fff; display: block; }
.user-mini small { color: #9a9db8; display: block; }
.user-mini a { color: #ff8b6b; font-size: 12.5px; }

.main { flex: 1; margin-left: 248px; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 16px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.topbar h1 { font-size: 19px; font-weight: 700; }
.menu-btn { display: none; background: none; border: none; font-size: 22px; cursor: pointer; }
.content { padding: 22px 24px 60px; max-width: 1200px; width: 100%; }

/* ===== CARDS / GRID ===== */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.card h2 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .num { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat.hl { background: var(--ink); border: none; color: #fff; }
.stat.hl .lbl { color: #b8bbd4; }
.stat.hl .num { color: var(--gold); }

/* ===== FORM ===== */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 9px;
  font: inherit; background: #fff; margin-bottom: 13px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { min-height: 110px; resize: vertical; }
.hint { font-size: 12.5px; color: var(--muted); margin: -8px 0 12px; }

.btn { display: inline-block; padding: 10px 18px; border-radius: 9px; border: none; cursor: pointer;
  font: inherit; font-weight: 600; background: var(--primary); color: #fff; }
.btn:hover { background: var(--primary-d); }
.btn-light { background: #fff; color: var(--text); border: 1.5px solid var(--line); }
.btn-light:hover { background: var(--bg); }
.btn-green { background: var(--green); }
.btn-red { background: var(--red); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 7px; }

/* ===== TABLE ===== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: #fbfaf7; }

/* ===== BADGE / ALERT ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.b-green { background: #e2f5ec; color: var(--green); }
.b-red { background: #fbe7e7; color: var(--red); }
.b-gold { background: #fcf2dc; color: #ad7a14; }
.b-gray { background: #ededf2; color: var(--muted); }
.b-blue { background: #e3ecfb; color: #2d5fb3; }
.alert { padding: 12px 16px; border-radius: 10px; margin: 16px 24px 0; font-weight: 500; }
.alert-success { background: #e2f5ec; color: #11744e; }
.alert-error { background: #fbe7e7; color: #a32424; }

/* ===== AUTH ===== */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink); padding: 20px; }
.auth-card { background: #fff; border-radius: 16px; padding: 32px 28px; width: 100%; max-width: 420px; }
.auth-card .brand-lg { font-size: 26px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); margin-bottom: 22px; }

/* ===== PLAN ===== */
.plan-card { border: 2px solid var(--line); border-radius: 14px; padding: 20px; text-align: center; }
.plan-card.current { border-color: var(--green); }
.plan-card .price { font-size: 24px; font-weight: 800; color: var(--primary); margin: 8px 0; }
.plan-card ul { list-style: none; text-align: left; margin: 12px 0; font-size: 13.5px; }
.plan-card li { padding: 4px 0; }

/* ===== AI RESULT ===== */
.ai-result { background: #fffdf7; border: 1.5px dashed var(--gold); border-radius: 12px; padding: 16px; white-space: pre-wrap; line-height: 1.65; }

/* ===== CHANNEL CARD ===== */
.chan { display: flex; align-items: center; gap: 12px; }
.chan .em { font-size: 26px; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .content { padding: 16px 14px 60px; }
  .tbl { display: block; overflow-x: auto; }
}
