/* =========================================================
   ARA CORE - APP.CSS
   Phiên bản đồng bộ sidebar + banner + admin + public
========================================================= */

/* =========================
   ROOT
========================= */
:root{
  --bg:#fcf7f2;
  --bg-2:#f7eee6;
  --surface:#ffffff;
  --surface-soft:#fff8f2;
  --surface-glass:rgba(255,255,255,.74);

  --text:#4a3529;
  --text-strong:#2f2119;
  --muted:#8e7362;
  --muted-soft:#a68975;

  --primary:#c7742d;
  --primary-2:#e7a15d;
  --primary-3:#f4b06e;
  --primary-dark:#8d4a1f;
  --primary-soft:#fff1e2;

  --accent-brown:#4a2411;
  --accent-brown-2:#8c4e22;
  --accent-brown-3:#b06c37;
  --accent-orange:#eba258;

  --success-bg:#fff4e8;
  --success-text:#b9641d;

  --danger:#c2410c;
  --danger-dark:#9a3412;

  --line:#ead8ca;
  --line-strong:#dfc0a8;
  --line-soft:#f1e3d7;

  --sidebar-top:#5f3119;
  --sidebar-mid:#8c4e22;
  --sidebar-bottom:#b67a49;

  --shadow-xs:0 6px 16px rgba(106,64,35,.06);
  --shadow-sm:0 10px 24px rgba(120,74,40,.08);
  --shadow:0 16px 36px rgba(120,74,40,.10);
  --shadow-lg:0 24px 50px rgba(120,74,40,.14);

  --radius-sm:12px;
  --radius:18px;
  --radius-md:22px;
  --radius-lg:28px;

  --transition:.28s ease;
}

/* =========================
   RESET
========================= */
*{box-sizing:border-box}
html{scroll-behavior:smooth}
html,body{
  margin:0;
  padding:0;
  font-family:Inter, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(244,162,97,.10), transparent 22%),
    radial-gradient(circle at right 15%, rgba(255,214,170,.16), transparent 20%),
    linear-gradient(180deg,var(--bg),var(--bg-2));
  color:var(--text);
}
body{line-height:1.6}
a{text-decoration:none;color:inherit}
img{max-width:100%;display:block}
button,input,select,textarea{font:inherit}

/* =========================
   GLOBAL HELPERS
========================= */
.site-wrap{
  max-width:1200px;
  margin:0 auto;
  padding:0 18px;
}

.main--full{
  margin-left:0 !important;
  width:100%;
}

.mt-16{margin-top:16px}

.gradient-text{
  background:linear-gradient(90deg,var(--primary),var(--primary-dark));
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  color:transparent;
}

.footer-note{
  font-size:12px;
  color:var(--muted);
}

.empty{
  padding:18px;
  border:1px dashed #e8c7ae;
  border-radius:16px;
  color:var(--muted);
  background:#fffdfa;
}

.notice{
  padding:14px 16px;
  border-radius:14px;
  background:#fff5eb;
  border:1px solid #f1d2b8;
  color:#a95d12;
  box-shadow:var(--shadow-xs);
}

/* =========================
   APP LAYOUT
========================= */
.layout{
  display:flex;
  min-height:100vh;
}

/* =========================
   SIDEBAR / ADMIN
========================= */
.sidebar{
  width:380px;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.10), transparent 22%),
    radial-gradient(circle at bottom right, rgba(255,220,170,.12), transparent 28%),
    linear-gradient(180deg,var(--sidebar-top) 0%, var(--sidebar-mid) 55%, var(--sidebar-bottom) 100%);
  color:#fff;
  padding:22px 18px;
  position:fixed;
  left:0;
  top:0;
  bottom:0;
  overflow:auto;
  border-right:1px solid rgba(255,255,255,.08);
  box-shadow:
    inset -1px 0 0 rgba(255,255,255,.05),
    10px 0 30px rgba(74,36,17,.08);
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.22) transparent;
}
.sidebar::-webkit-scrollbar{width:8px}
.sidebar::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.18);
  border-radius:999px;
}
.sidebar::-webkit-scrollbar-track{background:transparent}

.brand-panel{
  display:flex;
  align-items:center;
  gap:14px;
  padding:18px 18px 20px;
  border-bottom:1px solid rgba(255,255,255,.10);
  margin-bottom:14px;
}

.brand-panel-logo-wrap{
  width:92px;
  height:92px;
  border-radius:50%;
  overflow:hidden;
  flex-shrink:0;
  background:rgba(255,255,255,.08);
  border:2px solid rgba(255,255,255,.16);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 24px rgba(0,0,0,.18);
}

.brand-panel-logo{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.brand-panel-meta h1{
  margin:0 0 6px;
  font-size:24px;
  line-height:1.08;
  font-weight:800;
  color:#fff8f3;
  letter-spacing:.3px;
}

.brand-panel-meta small{
  display:block;
  margin:0;
  font-size:14px;
  line-height:1.55;
  color:rgba(255,255,255,.82);
}

.sidebar-search-note{
  font-size:12px;
  line-height:1.65;
  color:rgba(255,245,239,.76);
  padding:0 18px 12px;
}

.menu-group{
  margin-top:12px;
}

.menu-group--accordion{
  margin-top:12px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:24px;
  background:rgba(255,255,255,.05);
  box-shadow:0 10px 22px rgba(52,26,12,.12);
  overflow:hidden;
  backdrop-filter:blur(8px);
}

.menu-group__toggle{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:16px 18px;
  background:rgba(255,255,255,.03);
  border:none;
  color:#fff;
  font-weight:800;
  cursor:pointer;
}

.menu-group__toggle-main{
  display:flex;
  align-items:center;
  gap:10px;
}

.menu-group__badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:12px;
  background:rgba(255,255,255,.11);
  border:1px solid rgba(255,255,255,.08);
  font-size:16px;
  color:#ffd4ab;
}

.menu-group__handle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  color:rgba(255,255,255,.50);
  cursor:grab;
  letter-spacing:-1px;
}

.menu-group__icon{
  transition:transform .25s ease;
  color:#f3d6c3;
}

.menu-group--accordion.is-open .menu--accordion{
  display:block;
}

.menu-group--accordion.is-open .menu-group__icon{
  transform:rotate(180deg);
}

.menu--accordion{
  display:none;
  padding:8px 10px 12px;
}

.menu-title{
  font-size:12px;
  text-transform:uppercase;
  color:#ecd7ca;
  letter-spacing:.08em;
  margin:8px 12px;
}

.menu,
.submenu{
  display:block;
}

.menu a,
.submenu a,
.menu--accordion a{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  margin:6px 6px;
  border-radius:18px;
  color:rgba(255,247,241,.93);
  transition:all var(--transition);
  position:relative;
  font-weight:600;
}

.menu-link__icon{
  display:inline-flex;
  width:20px;
  justify-content:center;
  margin-right:2px;
  opacity:.95;
  flex:0 0 20px;
}

.menu a:hover,
.submenu a:hover,
.menu--accordion a:hover{
  background:rgba(255,255,255,.10);
  color:#fff;
  transform:translateX(2px);
}

.menu a.active,
.submenu a.active,
.menu--accordion a.active{
  background:linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.08));
  color:#fff;
  font-weight:800;
  box-shadow:
    inset 4px 0 0 #f4a340,
    0 10px 20px rgba(53,24,8,.12);
}

.menu a.active::before,
.submenu a.active::before,
.menu--accordion a.active::before{
  content:"";
  position:absolute;
  left:0;
  top:10px;
  bottom:10px;
  width:4px;
  border-radius:999px;
  background:linear-gradient(180deg,#f7b267,var(--primary));
}

.menu-group.is-dragging{
  opacity:.75;
  transform:scale(.98);
}

/* =========================
   MAIN
========================= */
.main{
  margin-left:380px;
  flex:1;
  padding:20px 24px 28px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:18px;
  gap:16px;
  flex-wrap:wrap;
}

.page-head h2{
  margin:0;
  font-size:30px;
  color:var(--text-strong);
}

.page-head p{
  margin:6px 0 0;
  color:var(--muted);
  font-size:15px;
}

.user-chip{
  background:rgba(255,255,255,.72);
  backdrop-filter:blur(12px);
  box-shadow:var(--shadow-xs);
  padding:12px 16px;
  border-radius:999px;
  border:1px solid var(--line);
  color:#6b4e3b;
}

/* =========================
   CARD / GRID / STAT
========================= */
.card{
  background:rgba(255,255,255,.88);
  backdrop-filter:blur(12px);
  border:1px solid var(--line);
  border-radius:var(--radius-md);
  box-shadow:var(--shadow-sm);
  padding:18px;
  margin-bottom:16px;
  transition:transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover{
  transform:translateY(-3px);
  box-shadow:var(--shadow);
  border-color:var(--line-strong);
}

.soft-box{
  background:linear-gradient(180deg,#ffffff,#fff7f1);
  border:1px solid var(--line);
  border-radius:18px;
  padding:18px;
  box-shadow:var(--shadow-xs);
  transition:var(--transition);
}

.soft-box:hover{
  transform:translateY(-3px);
  box-shadow:var(--shadow-sm);
}

.grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.grid-2{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.grid-cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px;
  margin-top:18px;
}

.stat{
  padding:18px;
  background:linear-gradient(180deg,#ffffff,#fff8f2);
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:var(--shadow-xs);
  transition:transform var(--transition), box-shadow var(--transition);
}

.stat:hover{
  transform:translateY(-3px);
  box-shadow:var(--shadow-sm);
}

.stat .label{
  color:var(--muted);
  font-size:13px;
}

.stat .value{
  font-size:30px;
  font-weight:800;
  margin-top:8px;
  color:var(--primary-dark);
}

.mini-card{
  border:1px solid var(--line);
  border-radius:18px;
  padding:18px;
  background:#fffdfb;
  box-shadow:var(--shadow-xs);
}

/* =========================
   TYPOGRAPHY
========================= */
.section-title{
  margin:0 0 8px;
  font-size:20px;
  color:var(--text-strong);
}

.section-subtitle{
  margin:0;
  color:var(--muted);
}

.article-title{
  font-size:30px;
  margin-top:8px;
  color:var(--text-strong);
}

.article-body,
.prose-block{
  margin-top:18px;
  line-height:1.85;
  color:var(--text);
}

.article-body ul,
.prose-block ul{
  padding-left:20px;
}

.article-detail h3{
  margin-top:24px;
}

.prose-block img{
  max-width:100%;
  border-radius:16px;
}

.doc-note{
  font-size:14px;
  color:#59463d;
  margin-bottom:12px;
}

/* =========================
   BUTTONS
========================= */
.btn,
.btn-secondary,
.btn-danger,
.btn-primary,
.btn-outline,
.btn-small{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:none;
  border-radius:14px;
  padding:11px 16px;
  cursor:pointer;
  font-weight:700;
  transition:transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}

.btn:hover,
.btn-secondary:hover,
.btn-danger:hover,
.btn-primary:hover,
.btn-outline:hover,
.btn-small:hover{
  transform:translateY(-2px);
}

.btn,
.btn-primary,
.btn-small{
  background:linear-gradient(135deg,var(--primary),var(--primary-2));
  color:#fff;
  box-shadow:0 12px 24px rgba(199,116,45,.20);
}

.btn:hover,
.btn-primary:hover,
.btn-small:hover{
  box-shadow:0 18px 30px rgba(199,116,45,.26);
}

.btn-secondary,
.btn-outline{
  background:var(--surface-soft);
  color:var(--primary-dark);
  border:1px solid var(--line);
}

.btn-secondary:hover,
.btn-outline:hover{
  background:#fff1e3;
  border-color:#edc8a7;
}

.btn-danger{
  background:linear-gradient(135deg,var(--danger),var(--danger-dark));
  color:#fff;
  box-shadow:0 10px 22px rgba(194,65,12,.20);
}

.btn-primary.large,
.btn-outline.large{
  min-width:220px;
  padding:16px 24px;
}

/* =========================
   TOOLBAR / INLINE
========================= */
.toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.inline-actions,
.hero-actions,
.story-detail-actions,
.philosophy-action{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

/* =========================
   TABLE
========================= */
.table-wrap{overflow:auto}

table,
.table{
  width:100%;
  border-collapse:collapse;
  background:transparent;
}

th,td,
.table th,.table td{
  padding:12px 10px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
  text-align:left;
}

th,
.table th{
  font-size:13px;
  color:var(--muted);
  font-weight:700;
}

td,
.table td{
  font-size:14px;
  color:var(--text);
}

/* =========================
   FORM
========================= */
label{
  display:block;
  font-weight:600;
  margin-bottom:6px;
}

input,
select,
textarea{
  width:100%;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fffdfb;
  outline:none;
  color:var(--text);
  transition:border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input::placeholder,
textarea::placeholder{
  color:#b79a88;
}

input:focus,
select:focus,
textarea:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(199,116,45,.12);
  background:#fff;
}

textarea{
  min-height:110px;
  resize:vertical;
}

input[type="file"]{
  padding:10px 12px;
}

.checkbox-row{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:14px;
}

.checkbox-row input{
  width:auto;
}

/* =========================
   BADGES / SMALL BLOCKS
========================= */
.badge,
.story-tag{
  display:inline-block;
  background:var(--primary-soft);
  color:var(--primary-dark);
  padding:5px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  border:1px solid #f2d3ba;
}

.kv{
  display:grid;
  grid-template-columns:180px 1fr;
  gap:8px 14px;
}

.more-link,
.story-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-top:12px;
  color:#c27a3d;
  font-weight:700;
  text-decoration:none;
}

.more-link:hover,
.story-link:hover{
  text-decoration:underline;
}

/* =========================
   PUBLIC HEADER
========================= */
.site-header{
  position:sticky;
  top:0;
  z-index:1000;
  background:linear-gradient(90deg,#2f1d14 0%, #6a3d21 45%, #f29433 100%);
  border-bottom:1px solid rgba(255,255,255,.08);
  box-shadow:0 10px 30px rgba(30,15,8,.18);
}

.header-container{
  width:min(1320px, calc(100% - 28px));
  margin:0 auto;
  min-height:88px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:280px;
  text-decoration:none;
  flex:0 0 auto;
}

.brand-logo-wrap{
  width:82px;
  height:82px;
  border-radius:50%;
  overflow:hidden;
  background:rgba(255,255,255,.08);
  box-shadow:0 8px 22px rgba(0,0,0,.20);
  border:2px solid rgba(255,255,255,.16);
  flex-shrink:0;
}

.brand-logo{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.brand-meta{
  display:flex;
  flex-direction:column;
  justify-content:center;
  line-height:1.12;
  min-width:250px;
}

.brand-name{
  font-size:1.55rem;
  font-weight:800;
  letter-spacing:.3px;
  color:#fffaf5;
}

.brand-slogan{
  margin-top:6px;
  font-size:.72rem;
  line-height:1.4;
  color:rgba(255,243,231,.82);
  max-width:280px;
}

.main-nav{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:2px;
  flex-wrap:nowrap;
}

.main-nav a{
  position:relative;
  color:rgba(255,247,240,.94);
  font-size:.90rem;
  font-weight:700;
  padding:10px 10px;
  border-radius:14px;
  transition:all .25s ease;
  white-space:nowrap;
  flex:0 0 auto;
}

.main-nav a:hover{
  background:rgba(255,255,255,.10);
  color:#fff;
}

.main-nav a.active,
.main-nav a[aria-current="page"]{
  background:rgba(255,225,190,.14);
  color:#fff;
}

.main-nav a.active::after,
.main-nav a[aria-current="page"]::after{
  content:"";
  position:absolute;
  left:12px;
  right:12px;
  bottom:6px;
  height:3px;
  border-radius:999px;
  background:linear-gradient(90deg,#ffd9a8,#fff4df);
}

.header-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
}

.btn-header{
  min-height:42px;
  padding:0 16px;
  border-radius:999px;
  font-size:.92rem;
  font-weight:700;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition:all .25s ease;
  white-space:nowrap;
}

.btn-header-light{
  color:#fff;
  border:1px solid rgba(255,255,255,.28);
  background:rgba(255,255,255,.08);
}

.btn-header-light:hover{
  background:rgba(255,255,255,.14);
}

.btn-header-primary{
  color:#fff;
  background:linear-gradient(135deg,#ff9b34,#ffc061);
  box-shadow:0 8px 20px rgba(255,153,52,.28);
}

.btn-header-primary:hover{
  transform:translateY(-1px);
  filter:brightness(1.03);
}

/* =========================
   PUBLIC MAIN
========================= */
.public-main{
  padding:28px 18px 40px;
}

.hero-card{
  padding:38px;
  background:
    radial-gradient(circle at top right, rgba(244,162,97,.12), transparent 26%),
    linear-gradient(135deg,#fffdfb,#fff5ed);
  border:1px solid var(--line);
  border-radius:28px;
  box-shadow:var(--shadow);
}

.hero-title{
  font-size:42px;
  line-height:1.15;
  margin:14px 0;
  color:var(--text-strong);
}

.hero-text{
  font-size:17px;
  color:var(--muted);
  max-width:860px;
}

/* =========================
   PHILOSOPHY PAGE
========================= */
.philosophy-page{
  max-width:1200px;
  margin:0 auto;
  padding:48px 20px 70px;
}

.philosophy-hero{
  background:linear-gradient(135deg,#7a4b2c,#c88245);
  color:#fff;
  border-radius:24px;
  padding:56px 40px;
  box-shadow:0 18px 45px rgba(0,0,0,.12);
  margin-bottom:36px;
}

.philosophy-badge{
  display:inline-block;
  background:rgba(255,255,255,.18);
  color:#fff;
  padding:10px 18px;
  border-radius:999px;
  font-size:14px;
  font-weight:700;
  margin-bottom:18px;
}

.philosophy-hero h1{
  font-size:52px;
  line-height:1.1;
  margin:0 0 16px;
  font-weight:800;
}

.philosophy-subtitle{
  font-size:20px;
  line-height:1.7;
  max-width:760px;
  margin:0;
  opacity:.96;
}

.philosophy-section{
  margin-top:12px;
  margin-bottom:36px;
}

.philosophy-section h2{
  font-size:32px;
  color:#7a4b2c;
  margin-bottom:22px;
  font-weight:800;
}

.philosophy-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:24px;
  margin-bottom:36px;
}

.philosophy-card{
  background:#fff;
  border-radius:20px;
  padding:28px 24px;
  box-shadow:0 10px 28px rgba(0,0,0,.07);
  border:1px solid rgba(201,131,63,.12);
  transition:transform .25s ease, box-shadow .25s ease;
}

.philosophy-card:hover{
  transform:translateY(-4px);
  box-shadow:0 16px 34px rgba(0,0,0,.10);
}

.philosophy-card h3{
  font-size:24px;
  color:#8b4f24;
  margin:0 0 12px;
  font-weight:800;
}

.philosophy-card p{
  font-size:17px;
  line-height:1.8;
  color:#4f4f4f;
  margin:0;
}

.philosophy-quote{
  background:#fff7f0;
  border-left:6px solid #d8893e;
  border-radius:18px;
  padding:28px 24px;
  margin-bottom:32px;
}

.philosophy-quote blockquote{
  margin:0;
  font-size:24px;
  line-height:1.7;
  font-weight:700;
  color:#7a4b2c;
}

/* =========================
   JOURNEY / REFLECTION / CTA
========================= */
.journey-steps{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.journey-step{
  display:flex;
  gap:18px;
  align-items:flex-start;
  background:#fff;
  border-radius:20px;
  padding:24px;
  box-shadow:0 10px 28px rgba(0,0,0,.07);
  border:1px solid rgba(201,131,63,.12);
}

.journey-number{
  width:48px;
  height:48px;
  border-radius:50%;
  background:linear-gradient(135deg,#ee9322,#ffb24a);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:18px;
  flex-shrink:0;
}

.journey-content h3{
  margin:0 0 8px;
  font-size:22px;
  color:#8b4f24;
  font-weight:800;
}

.journey-content p{
  margin:0;
  font-size:17px;
  line-height:1.8;
  color:#4f4f4f;
}

.reflection-list{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.reflection-item{
  display:flex;
  gap:18px;
  align-items:flex-start;
  background:#fffaf5;
  border:1px solid rgba(216,137,62,.16);
  border-radius:18px;
  padding:18px 20px;
}

.reflection-item span{
  min-width:50px;
  height:50px;
  border-radius:14px;
  background:#fff;
  border:1px solid rgba(216,137,62,.22);
  color:#c27a3d;
  font-size:16px;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:center;
}

.reflection-item p{
  margin:0;
  font-size:17px;
  line-height:1.8;
  color:#4f4f4f;
}

.conversion-box{
  margin-top:40px;
  background:linear-gradient(135deg,#7a4b2c,#c88245);
  color:#fff;
  border-radius:24px;
  padding:34px 28px;
  display:flex;
  justify-content:space-between;
  gap:24px;
  flex-wrap:wrap;
  box-shadow:0 18px 45px rgba(0,0,0,.12);
}

.conversion-content{
  flex:1 1 540px;
}

.conversion-content h2{
  margin:0 0 12px;
  font-size:34px;
  font-weight:800;
}

.conversion-content p{
  margin:0 0 16px;
  font-size:18px;
  line-height:1.8;
  opacity:.97;
}

.conversion-list{
  margin:0;
  padding-left:20px;
}

.conversion-list li{
  margin-bottom:8px;
  line-height:1.8;
  font-size:17px;
}

.conversion-actions{
  display:flex;
  flex-direction:column;
  gap:14px;
  justify-content:center;
  min-width:240px;
}

/* =========================
   STORY PAGES
========================= */
.section-head{
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:20px;
  margin-bottom:20px;
  flex-wrap:wrap;
}

.story-grid-4{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:22px;
}

.story-card{
  height:100%;
  display:flex;
  flex-direction:column;
}

.story-card .story-link{
  margin-top:auto;
}

.story-page,
.story-detail-page{
  max-width:1100px;
  margin:0 auto;
  padding:48px 20px 70px;
}

.story-hero,
.story-detail-hero{
  background:linear-gradient(135deg,#7a4b2c,#c88245);
  color:#fff;
  border-radius:24px;
  padding:44px 34px;
  margin-bottom:28px;
  box-shadow:0 18px 45px rgba(0,0,0,.12);
}

.story-hero h1,
.story-detail-hero h1{
  margin:0 0 12px;
  font-size:42px;
  font-weight:800;
  line-height:1.15;
}

.story-hero p,
.story-detail-hero p{
  margin:0;
  font-size:18px;
  line-height:1.8;
  opacity:.98;
  max-width:850px;
}

.story-detail-content{
  background:#fff;
  border-radius:22px;
  padding:30px 28px;
  box-shadow:0 10px 28px rgba(0,0,0,.06);
  border:1px solid rgba(201,131,63,.12);
}

.story-detail-content p{
  margin:0 0 18px;
  font-size:18px;
  line-height:1.95;
  color:#4f4f4f;
}

/* =========================
   PRODUCT / ADMIN
========================= */
.product-admin-shell,
.academy-admin-shell{
  display:grid;
  gap:18px;
}

.product-category-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:16px;
}

.product-category-card{
  display:grid;
  grid-template-columns:76px 1fr;
  gap:14px;
  align-items:center;
  padding:14px;
  border:1px solid #ead7ca;
  border-radius:22px;
  background:linear-gradient(180deg,#fffdfb,#fff5ed);
  box-shadow:var(--shadow-xs);
  transition:var(--transition);
}

.product-category-card:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-sm);
  border-color:#e0c1a9;
}

.product-category-card img{
  width:76px;
  height:76px;
  border-radius:18px;
  object-fit:cover;
  background:#fff;
  border:1px solid #efddd1;
}

.product-category-card h4{
  margin:0 0 6px;
  font-size:16px;
  color:#452d1f;
}

.product-category-card p{
  margin:0;
  color:#8b6b56;
  font-size:13px;
}

.product-grid-cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:16px;
}

.product-admin-card{
  background:#fff;
  border:1px solid #ead8ca;
  border-radius:22px;
  overflow:hidden;
  box-shadow:var(--shadow-xs);
  display:grid;
}

.product-admin-card__media{
  position:relative;
  height:180px;
  background:linear-gradient(180deg,#fff6ef,#fff);
}

.product-admin-card__media img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:14px;
}

.product-admin-card__body{
  padding:16px;
  display:grid;
  gap:10px;
}

.product-admin-card__meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  font-size:12px;
  color:#8d6d58;
}

.product-chip{
  padding:6px 10px;
  border-radius:999px;
  background:#fff4ea;
  border:1px solid #f0d3bb;
  font-weight:700;
}

.product-admin-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.product-form-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

.product-form-grid .span-2{
  grid-column:1/-1;
}

.product-form-grid label{
  display:grid;
  gap:8px;
  font-weight:700;
  color:#593924;
}

.product-form-grid input,
.product-form-grid textarea,
.product-form-grid select{
  width:100%;
  border:1px solid #dfc4ad;
  border-radius:14px;
  padding:12px 14px;
  background:#fffdfa;
  color:#4f311d;
  font:inherit;
}

.product-form-grid textarea{
  min-height:120px;
}

.product-form-side{
  display:grid;
  gap:14px;
}

.form-preview-card{
  border:1px solid #ead7ca;
  border-radius:20px;
  background:linear-gradient(180deg,#fffdfa,#fff4ec);
  padding:16px;
  display:grid;
  gap:12px;
}

.form-preview-card img{
  width:100%;
  height:240px;
  object-fit:contain;
  background:#fff;
  border-radius:18px;
  border:1px solid #f1dfd1;
  padding:12px;
}

.image-library{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin-top:12px;
}

.image-choice{
  border:1px solid var(--line);
  border-radius:16px;
  padding:10px;
  background:#fff;
  cursor:pointer;
  transition:var(--transition);
  display:flex;
  flex-direction:column;
  gap:8px;
}

.image-choice:hover,
.image-choice.is-selected{
  border-color:var(--primary);
  box-shadow:var(--shadow-xs);
  transform:translateY(-2px);
}

.image-choice img{
  width:100%;
  aspect-ratio:1/1;
  object-fit:cover;
  border-radius:12px;
  background:#fff7f0;
}

.image-choice small{
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}

.product-preview-large{
  width:100%;
  aspect-ratio:1/1;
  object-fit:cover;
  border-radius:18px;
  background:#fff7f0;
  border:1px solid var(--line);
}

/* =========================
   LESSON EDITOR / ACADEMY
========================= */
.lesson-template-bar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:16px 0 14px;
}

.lesson-template-btn{
  border:1px solid var(--line);
  background:#fff7f0;
  border-radius:999px;
  padding:10px 14px;
  font-weight:700;
  color:var(--accent-brown);
  cursor:pointer;
  transition:var(--transition);
}

.lesson-template-btn:hover{
  border-color:var(--primary);
  color:var(--primary-dark);
  background:#fff2e6;
}

.lesson-editor-grid{
  display:grid;
  grid-template-columns:minmax(0,1.6fr) 360px;
  gap:18px;
  align-items:start;
}

.lesson-editor-main{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.lesson-side-panel{
  display:flex;
  flex-direction:column;
  gap:16px;
  position:sticky;
  top:16px;
}

.lesson-builder-palette{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.palette-card{
  background:linear-gradient(180deg,#fff,#fff6ef);
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px;
  cursor:pointer;
  transition:var(--transition);
}

.palette-card:hover{
  border-color:var(--primary);
  box-shadow:var(--shadow-xs);
  transform:translateY(-2px);
}

.palette-card strong{
  display:block;
  margin-bottom:6px;
  color:var(--text-strong);
}

.palette-card p{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}

.academy-section-list{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.academy-section-card{
  border:1px solid var(--line);
  border-radius:22px;
  background:#fff;
  padding:16px 16px 14px;
  box-shadow:var(--shadow-xs);
}

.academy-section-card.is-dragging{
  opacity:.55;
}

.academy-section-card__head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
}

.academy-section-card__title{
  display:flex;
  align-items:center;
  gap:10px;
}

.academy-section-card__number{
  display:flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:12px;
  background:#fff1e3;
  color:var(--primary-dark);
  font-weight:700;
}

.drag-handle{
  cursor:grab;
  color:#9e7f6c;
  font-size:18px;
  padding:4px 8px;
  border-radius:10px;
  background:#fff7f0;
}

.editor-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:8px 0 0;
}

.editor-toolbar button{
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  padding:8px 10px;
  color:var(--accent-brown);
  cursor:pointer;
}

.editor-toolbar button:hover{
  border-color:var(--primary);
  color:var(--primary-dark);
}

.lesson-media-library{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:10px;
}

.lesson-media-choice{
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  background:#fff;
  cursor:pointer;
  transition:var(--transition);
}

.lesson-media-choice:hover{
  border-color:var(--primary);
  transform:translateY(-2px);
  box-shadow:var(--shadow-xs);
}

.lesson-media-choice img{
  display:block;
  width:100%;
  height:118px;
  object-fit:cover;
}

.lesson-media-choice span{
  display:block;
  padding:10px 10px 12px;
  font-size:12px;
  color:var(--muted);
}

.lesson-live-preview{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.lesson-live-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:22px;
  padding:16px;
  box-shadow:var(--shadow-xs);
}

.lesson-live-card h4{
  margin:0 0 8px;
  color:var(--text-strong);
}

.lesson-live-card p{
  margin:0;
  color:var(--muted);
  line-height:1.6;
}

.lesson-live-list{
  margin:0;
  padding-left:18px;
  color:var(--muted);
}

.builder-note{
  margin-top:0;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width:1280px){
  .sidebar{width:330px}
  .main{margin-left:330px}
}

@media (max-width:1200px){
  .grid-4{grid-template-columns:repeat(2,1fr)}
  .grid-3{grid-template-columns:repeat(2,1fr)}
  .story-grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width:1100px){
  .lesson-editor-grid{
    grid-template-columns:1fr;
  }
  .lesson-side-panel{
    position:static;
  }
  .image-library{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .lesson-builder-palette,
  .lesson-media-library{
    grid-template-columns:1fr;
  }
}

@media (max-width:980px){
  .header-container{
    min-height:auto;
    padding:14px 0;
    flex-wrap:wrap;
    justify-content:center;
  }

  .brand{
    width:100%;
    justify-content:center;
  }

  .brand-meta{
    align-items:center;
    text-align:center;
  }

  .brand-slogan{
    max-width:100%;
  }

  .main-nav{
    width:100%;
    justify-content:center;
    flex-wrap:wrap;
  }

  .header-actions{
    width:100%;
    justify-content:center;
  }
}

@media (max-width:900px){
  .sidebar{
    position:relative;
    width:100%;
    height:auto;
    border-bottom:1px solid rgba(255,255,255,.08);
  }

  .main{
    margin-left:0;
  }

  .layout{
    display:block;
  }

  .grid-4,
  .grid-3,
  .grid-2,
  .philosophy-grid,
  .product-form-grid{
    grid-template-columns:1fr;
  }

  .kv{
    grid-template-columns:1fr;
  }

  .hero-title{
    font-size:32px;
  }

  .page-head h2{
    font-size:24px;
  }

  .hero-card{
    padding:24px;
    border-radius:22px;
  }

  .card,
  .soft-box,
  .stat{
    border-radius:16px;
  }

  .btn,
  .btn-secondary,
  .btn-danger{
    width:100%;
  }

  .hero-actions,
  .inline-actions,
  .toolbar,
  .philosophy-action{
    flex-direction:column;
    align-items:stretch;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td{
    display:block;
    width:100%;
  }

  thead{
    display:none;
  }

  tr{
    border-bottom:1px solid var(--line);
    padding:8px 0;
  }

  td{
    border:none;
    padding:8px 0;
  }

  .journey-step{
    flex-direction:column;
  }

  .conversion-box{
    padding:26px 20px;
  }

  .conversion-content h2{
    font-size:28px;
  }

  .conversion-actions{
    width:100%;
  }
}

@media (max-width:768px){
  .story-grid-4{grid-template-columns:1fr}

  .philosophy-hero{
    padding:36px 24px;
  }

  .philosophy-hero h1{
    font-size:36px;
  }

  .philosophy-subtitle{
    font-size:17px;
  }

  .philosophy-section h2{
    font-size:26px;
  }

  .philosophy-card h3{
    font-size:21px;
  }

  .philosophy-quote blockquote{
    font-size:20px;
  }

  .story-hero h1,
  .story-detail-hero h1{
    font-size:32px;
  }

  .story-detail-content{
    padding:24px 20px;
  }

  .story-detail-content p{
    font-size:17px;
  }
}

@media (max-width:640px){
  body{
    font-size:15px;
  }

  .site-wrap,
  .main,
  .public-main{
    padding-left:14px;
    padding-right:14px;
  }

  .brand-logo-wrap{
    width:46px;
    height:46px;
  }

  .brand-name{
    font-size:1.18rem;
  }

  .brand-slogan{
    font-size:.68rem;
  }

  .hero-title{
    font-size:28px;
  }

  .article-title{
    font-size:24px;
  }

  .section-title{
    font-size:18px;
  }

  .stat .value{
    font-size:26px;
  }

  .main-nav a{
    font-size:.9rem;
    padding:8px 10px;
  }

  .btn-header{
    min-height:40px;
    font-size:.88rem;
    padding:0 14px;
  }

  .product-category-grid,
  .product-grid-cards{
    grid-template-columns:1fr;
  }
}
/* ===== VIDEO STORY VIP++ ===== */
.story-video {
    max-width: 420px;
    margin: 20px auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.story-video video {
    width: 100%;
    height: auto;
    display: block;
}

/* ===== FIX logged-in public header ===== */
.header-container--loggedin{
  gap:14px;
}
.header-actions--loggedin{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex:0 1 auto;
  min-width:0;
}
.btn-header-greeting{
  max-width:260px;
  overflow:hidden;
  text-overflow:ellipsis;
}
@media (min-width: 981px){
  .header-container--loggedin .brand{
    min-width:240px;
  }
  .header-container--loggedin .brand-meta{
    min-width:180px;
  }
  .header-container--loggedin .main-nav{
    justify-content:flex-start;
    gap:0;
  }
  .header-container--loggedin .main-nav a{
    padding:10px 8px;
    font-size:.86rem;
  }
}
@media (max-width: 1280px){
  .header-container--loggedin{
    flex-wrap:wrap;
    justify-content:center;
    padding:14px 0;
  }
  .header-container--loggedin .brand,
  .header-container--loggedin .main-nav,
  .header-container--loggedin .header-actions--loggedin{
    width:100%;
    justify-content:center;
  }
  .header-container--loggedin .main-nav{
    flex-wrap:wrap;
  }
  .header-container--loggedin .header-actions--loggedin{
    flex-wrap:wrap;
  }
  .btn-header-greeting{
    max-width:100%;
  }
}

/* ===== FOOTER ===== */
.site-footer{
    background:linear-gradient(180deg, var(--bg-2) 0%, #e8ddd4 100%);
    border-top:1px solid var(--line);
    padding:56px 0 0;
    margin-top:48px;
}

.footer-container{
    max-width:1200px;
    margin:0 auto;
    padding:0 24px;
}

.footer-grid{
    display:grid;
    grid-template-columns:2fr 1fr 1fr 1fr;
    gap:40px;
    padding-bottom:40px;
}

.footer-brand{
    max-width:280px;
}

.footer-logo{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:12px;
}

.footer-logo img{
    width:48px;
    height:48px;
    border-radius:50%;
    object-fit:cover;
}

.footer-logo span{
    font-size:22px;
    font-weight:800;
    color:var(--text-strong);
    letter-spacing:.5px;
}

.footer-tagline{
    color:var(--muted);
    font-size:14px;
    line-height:1.6;
    margin:0;
}

.footer-links h4,
.footer-contact h4{
    font-size:15px;
    font-weight:700;
    color:var(--text-strong);
    margin:0 0 16px;
    text-transform:uppercase;
    letter-spacing:.5px;
}

.footer-links ul{
    list-style:none;
    margin:0;
    padding:0;
}

.footer-links li{
    margin-bottom:10px;
}

.footer-links a{
    color:var(--muted);
    font-size:14px;
    transition:color .25s ease;
}

.footer-links a:hover{
    color:var(--primary);
}

.footer-social{
    display:flex;
    gap:10px;
}

.social-link{
    width:40px;
    height:40px;
    border-radius:10px;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:all .25s ease;
}

.social-link--phone{
    background:var(--primary-soft);
    color:var(--primary-dark);
}

.social-link--zalo{
    background:#0068FF;
    color:#fff;
    font-weight:700;
    font-size:14px;
}

.social-link--facebook{
    background:#1877F2;
    color:#fff;
}

.social-link:hover{
    transform:translateY(-2px);
    box-shadow:var(--shadow-sm);
}

.footer-bottom{
    border-top:1px solid var(--line);
    padding:20px 0;
    text-align:center;
}

.footer-bottom p{
    margin:0;
    font-size:13px;
    color:var(--muted);
}

@media (max-width:1024px){
    .footer-grid{
        grid-template-columns:1fr 1fr;
        gap:32px;
    }
    .footer-brand{
        grid-column:1 / -1;
        max-width:100%;
    }
}

@media (max-width:640px){
    .footer-grid{
        grid-template-columns:1fr;
        gap:28px;
    }
    .site-footer{
        padding:40px 0 0;
    }
}

/* ===== MOBILE MENU ===== */
.mobile-menu-toggle{
    display:none;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    width:44px;
    height:44px;
    background:transparent;
    border:none;
    cursor:pointer;
    padding:8px;
    border-radius:8px;
    transition:background .25s ease;
}

.mobile-menu-toggle:hover{
    background:rgba(0,0,0,.05);
}

.mobile-menu-toggle span{
    display:block;
    width:22px;
    height:2px;
    background:var(--text);
    border-radius:2px;
    margin:3px 0;
    transition:all .3s ease;
}

.mobile-menu-toggle.is-active span:nth-child(1){
    transform:translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.is-active span:nth-child(2){
    opacity:0;
}

.mobile-menu-toggle.is-active span:nth-child(3){
    transform:translateY(-8px) rotate(-45deg);
}

@media (max-width:900px){
    .mobile-menu-toggle{
        display:flex;
    }
    
    .main-nav{
        position:fixed;
        top:0;
        left:0;
        right:0;
        bottom:0;
        background:rgba(255,255,255,.98);
        backdrop-filter:blur(12px);
        flex-direction:column;
        align-items:center;
        justify-content:center;
        gap:8px;
        opacity:0;
        visibility:hidden;
        transition:all .3s ease;
        z-index:100;
    }
    
    .main-nav.is-open{
        opacity:1;
        visibility:visible;
    }
    
    .main-nav a{
        font-size:20px;
        padding:14px 24px;
        color:var(--text);
    }
    
    .main-nav a.active{
        color:var(--primary);
    }
}

@media (max-width:768px){
    .header-container--public{
        flex-wrap:wrap;
        gap:12px;
    }
    
    .header-container--public .main-nav{
        order:10;
        width:100%;
        position:relative;
        flex-direction:row;
        flex-wrap:wrap;
        justify-content:center;
        gap:4px;
        padding:12px 0;
        border-top:1px solid var(--line);
    }
    
    .header-container--public .main-nav a{
        font-size:13px;
        padding:8px 12px;
        background:var(--surface-soft);
        border-radius:8px;
    }
    
    .header-container--public .header-actions{
        order:5;
        margin-left:auto;
    }
    
    .header-container--public .brand{
        flex:1;
        min-width:0;
    }
    
    .header-container--public .brand-meta{
        min-width:0;
    }
    
    .header-container--public .brand-name{
        font-size:18px;
    }
    
    .header-container--public .brand-slogan{
        display:none;
    }
}
