/* Mini E-Office - Main Stylesheet */
/* Font: Sarabun (Thai) */

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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #0f172a;
  --accent: #06b6d4;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --purple: #7c3aed;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --white: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,.1), 0 10px 10px rgba(0,0,0,.04);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

html { scroll-behavior: smooth; }
body { font-family: 'Sarabun', sans-serif; font-size: 16px; color: var(--gray-800); background: var(--white); line-height: 1.6; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ===== NAVBAR ===== */
.navbar {
  background: #0f172a;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
  position: sticky; top: 0; z-index: 100;
  padding: 0;
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 20px;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.3rem; color: var(--primary); font-weight: 600;
  text-decoration: none;
}
.navbar-brand img, .navbar-logo { height: 44px; width: auto; display: block; overflow: visible; }
.sidebar-logo { height: 32px; width: auto; display: block; filter: brightness(10); }
.navbar-brand i { font-size: 1.5rem; }
.navbar-brand strong { color: var(--secondary); }
.navbar-menu {
  display: flex; list-style: none; gap: 4px; align-items: center;
}
.navbar-menu a {
  padding: 8px 14px; border-radius: var(--radius); font-size: 0.95rem;
  color: #cbd5e1; font-weight: 500; transition: all .2s;
}
.navbar-menu a:hover, .navbar-menu a.active {
  background: rgba(255,255,255,.08); color: #fff;
}
.btn-portal {
  background: #6366f1 !important;
  color: var(--white) !important; border-radius: var(--radius) !important;
  border: none !important;
}
.btn-portal:hover { background: #4f46e5 !important; box-shadow: 0 4px 12px rgba(99,102,241,.4) !important; }
.btn-admin {
  background: rgba(255,255,255,.1) !important; color: #e2e8f0 !important;
  border-radius: var(--radius) !important;
  border: 1px solid rgba(255,255,255,.15) !important;
}
.btn-admin:hover { background: rgba(255,255,255,.18) !important; color: #fff !important; }
.navbar-toggle {
  display: none; background: none; border: none; font-size: 1.3rem;
  color: #94a3b8; cursor: pointer; padding: 8px;
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0891b2 100%);
  color: var(--white); padding: 80px 0 100px; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; right: -10%;
  width: 600px; height: 600px; border-radius: 50%;
  background: rgba(255,255,255,.05); pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; bottom: -30%; left: -5%;
  width: 400px; height: 400px; border-radius: 50%;
  background: rgba(255,255,255,.04); pointer-events: none;
}
.hero-content { position: relative; z-index: 2; max-width: 700px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  padding: 6px 14px; border-radius: 50px; font-size: 0.85rem; margin-bottom: 20px;
}
.hero h1 { font-size: 2.8rem; font-weight: 700; line-height: 1.25; margin-bottom: 16px; }
.hero h1 span { color: #fde68a; }
.hero p { font-size: 1.15rem; opacity: 0.9; margin-bottom: 32px; max-width: 580px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: var(--radius); font-family: 'Sarabun',sans-serif; font-size: 0.95rem; font-weight: 600; cursor: pointer; border: none; transition: all .2s; }
.btn-white { background: var(--white); color: var(--primary); }
.btn-white:hover { background: var(--gray-100); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-outline-white { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.5); }
.btn-outline-white:hover { background: rgba(255,255,255,.1); }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-success { background: var(--success); color: var(--white); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* Hero stats */
.hero-stats { display: flex; gap: 40px; margin-top: 48px; }
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 1.8rem; font-weight: 700; }
.hero-stat .label { font-size: 0.85rem; opacity: 0.8; }

/* ===== SECTION TITLES ===== */
.section { padding: 72px 0; }
.section-alt { background: var(--gray-50); }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title .badge {
  display: inline-block; background: var(--primary-light); color: var(--primary);
  padding: 4px 12px; border-radius: 50px; font-size: 0.85rem; font-weight: 600; margin-bottom: 10px;
}
.section-title h2 { font-size: 2rem; font-weight: 700; color: var(--secondary); margin-bottom: 12px; }
.section-title p { color: var(--gray-600); max-width: 560px; margin: 0 auto; }

/* ===== SYSTEMS GRID ===== */
.systems-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.system-card {
  background: var(--white); border-radius: var(--radius-xl); padding: 28px;
  box-shadow: var(--shadow); border: 1px solid var(--gray-200);
  transition: all .3s; cursor: pointer;
}
.system-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); border-color: transparent; }
.system-icon {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 16px;
}
.system-card h3 { font-size: 1.15rem; font-weight: 700; color: var(--secondary); margin-bottom: 8px; }
.system-card p { font-size: 0.9rem; color: var(--gray-600); margin-bottom: 16px; line-height: 1.5; }
.system-features { list-style: none; margin-bottom: 20px; }
.system-features li {
  font-size: 0.85rem; color: var(--gray-600); padding: 3px 0;
  display: flex; align-items: center; gap: 6px;
}
.system-features li::before { content: '✓'; color: var(--success); font-weight: 700; }
.system-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--gray-100); }
.price-tag { font-size: 0.85rem; color: var(--gray-600); }
.price-tag strong { font-size: 1rem; color: var(--secondary); }
.btn-demo { font-size: 0.85rem; padding: 7px 14px; border-radius: var(--radius); background: var(--primary-light); color: var(--primary); font-weight: 600; transition: all .2s; }
.btn-demo:hover { background: var(--primary); color: var(--white); }

/* ===== SERVICES SECTION ===== */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.service-card {
  background: var(--white); border-radius: var(--radius-xl); padding: 32px 24px;
  box-shadow: var(--shadow); border: 1px solid var(--gray-200); text-align: center;
  transition: all .3s; position: relative; overflow: hidden;
}
.service-card.featured { border-color: var(--primary); }
.service-card.featured::before {
  content: '⭐ แนะนำ';
  position: absolute; top: 12px; right: -28px;
  background: var(--primary); color: var(--white);
  font-size: 0.75rem; font-weight: 700; padding: 4px 36px;
  transform: rotate(45deg);
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); }
.service-icon { font-size: 2.5rem; margin-bottom: 16px; }
.service-card h3 { font-size: 1.2rem; font-weight: 700; color: var(--secondary); margin-bottom: 8px; }
.service-card p { font-size: 0.9rem; color: var(--gray-600); margin-bottom: 20px; }
.service-features { list-style: none; text-align: left; margin-bottom: 24px; }
.service-features li { padding: 5px 0; font-size: 0.9rem; color: var(--gray-600); display: flex; gap: 8px; }
.service-features li i { color: var(--success); margin-top: 3px; flex-shrink: 0; }

/* ===== PRICING ===== */
.pricing-card {
  background: var(--white); border: 2px solid var(--gray-200); border-radius: var(--radius-xl);
  padding: 32px; text-align: center; transition: all .3s;
}
.pricing-card.popular { border-color: var(--primary); position: relative; }
.pricing-card:hover { border-color: var(--primary); box-shadow: var(--shadow-xl); transform: translateY(-4px); }
.pricing-card .price { font-size: 2.2rem; font-weight: 700; color: var(--primary); }
.pricing-card .price small { font-size: 1rem; color: var(--gray-400); }

/* ===== HOW IT WORKS ===== */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.step { text-align: center; }
.step-num {
  width: 56px; height: 56px; border-radius: 50%; background: var(--primary);
  color: var(--white); font-size: 1.4rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.step h3 { font-size: 1rem; font-weight: 700; color: var(--secondary); margin-bottom: 8px; }
.step p { font-size: 0.9rem; color: var(--gray-600); }

/* ===== TESTIMONIALS ===== */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.testimonial-card {
  background: var(--white); border-radius: var(--radius-xl); padding: 28px;
  box-shadow: var(--shadow); border: 1px solid var(--gray-200);
}
.stars { color: #f59e0b; margin-bottom: 12px; }
.testimonial-card p { font-size: 0.95rem; color: var(--gray-600); margin-bottom: 16px; font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; color: var(--primary); font-weight: 700;
}
.testimonial-author strong { font-size: 0.9rem; color: var(--secondary); display: block; }
.testimonial-author span { font-size: 0.8rem; color: var(--gray-400); }

/* ===== CTA ===== */
.cta-section {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: var(--white); padding: 72px 0; text-align: center;
}
.cta-section h2 { font-size: 2rem; font-weight: 700; margin-bottom: 16px; }
.cta-section p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 32px; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== FOOTER ===== */
.footer { background: var(--secondary); color: rgba(255,255,255,.8); padding: 56px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 40px; margin-bottom: 40px; }
.footer-col h3 { color: var(--white); font-size: 1.1rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.footer-col h4 { color: var(--white); font-size: 0.95rem; margin-bottom: 12px; }
.footer-col p { font-size: 0.9rem; line-height: 1.7; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul li a { font-size: 0.9rem; color: rgba(255,255,255,.7); transition: color .2s; display: flex; align-items: center; gap: 8px; }
.footer-col ul li a:hover { color: var(--white); }
.contact-list li { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; padding: 3px 0; }
.contact-list li i { width: 16px; color: var(--accent); }
.social-links { display: flex; gap: 12px; margin-top: 16px; }
.social-links a {
  width: 36px; height: 36px; border-radius: 8px; background: rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.8);
  transition: all .2s; font-size: 1rem;
}
.social-links a:hover { background: var(--primary); color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; text-align: center; }
.footer-bottom p { font-size: 0.85rem; opacity: 0.6; }

/* ===== ADMIN ===== */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--secondary); color: var(--white); flex-shrink: 0; }
.sidebar-header { padding: 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-header a { color: var(--white); font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sidebar-menu { list-style: none; padding: 12px 0; }
.sidebar-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: rgba(255,255,255,.7); font-size: 0.9rem; transition: all .2s; }
.sidebar-menu a:hover, .sidebar-menu a.active { background: rgba(255,255,255,.1); color: var(--white); }
.sidebar-menu a i { width: 18px; text-align: center; }
.admin-content { flex: 1; padding: 24px; background: var(--gray-50); }
.admin-topbar { background: var(--white); padding: 14px 24px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: space-between; margin: -24px -24px 24px; }
.admin-topbar h1 { font-size: 1.1rem; font-weight: 700; color: var(--secondary); }
.card { background: var(--white); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); border: 1px solid var(--gray-200); margin-bottom: 24px; }
.card-title { font-size: 1rem; font-weight: 700; color: var(--secondary); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--gray-200); display: flex; align-items: center; gap: 16px; }
.stat-card-icon { width: 48px; height: 48px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-card-num { font-size: 1.6rem; font-weight: 700; color: var(--secondary); line-height: 1; }
.stat-card-label { font-size: 0.8rem; color: var(--gray-400); margin-top: 2px; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--gray-100); font-size: 0.9rem; }
th { background: var(--gray-50); font-weight: 700; color: var(--gray-600); font-size: 0.8rem; text-transform: uppercase; }
tr:hover td { background: var(--gray-50); }
.badge-active { display: inline-block; padding: 2px 8px; border-radius: 50px; font-size: 0.75rem; font-weight: 600; background: #d1fae5; color: #065f46; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; border-radius: var(--radius); font-weight: 600; }
.btn-edit { background: var(--primary-light); color: var(--primary); }
.btn-delete { background: #fee2e2; color: var(--danger); }
.btn-edit:hover { background: var(--primary); color: var(--white); }
.btn-delete:hover { background: var(--danger); color: var(--white); }
.action-btns { display: flex; gap: 6px; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 14px; border: 1px solid var(--gray-200);
  border-radius: var(--radius); font-family: 'Sarabun',sans-serif; font-size: 0.95rem;
  color: var(--gray-800); background: var(--white); transition: border .2s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
textarea.form-control { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Page header */
.page-header { background: linear-gradient(135deg, #1e3a8a, #2563eb); color: var(--white); padding: 48px 0; text-align: center; }
.page-header h1 { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.page-header p { opacity: 0.85; }

/* Alert */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.9rem; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Demo frame */
.demo-frame { border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-xl); }
.demo-topbar { background: var(--gray-200); padding: 10px 16px; display: flex; align-items: center; gap: 8px; }
.demo-dot { width: 12px; height: 12px; border-radius: 50%; }
.demo-body { background: var(--gray-50); padding: 20px; }

/* Login page */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e3a8a, #2563eb); }
.login-card { background: var(--white); border-radius: var(--radius-xl); padding: 40px; width: 100%; max-width: 400px; box-shadow: var(--shadow-xl); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo i { font-size: 2.5rem; color: var(--primary); }
.login-logo h2 { font-size: 1.3rem; font-weight: 700; color: var(--secondary); margin-top: 8px; }

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero-stats { gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .navbar-menu { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: #0f172a; border-top: 1px solid rgba(255,255,255,.08); padding: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.4); gap: 2px; }
  .navbar-menu.open { display: flex; }
  .navbar-toggle { display: block; }
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.7rem; }
  .systems-grid { grid-template-columns: 1fr; }
}
