/* ============================================================
   BakatFit LP Manager — Admin Panel CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --navy:       #1B3564;
  --navy-dark:  #0F2040;
  --navy-light: #2A4A8A;
  --gold:       #E6A817;
  --red:        #C0392B;
  --green:      #16A34A;
  --yellow:     #D97706;
  --gray:       #6B7280;
  --light-gray: #F9FAFB;
  --border:     #E5E7EB;
  --white:      #FFFFFF;
  --sidebar-w:  240px;
}

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

body {
  font-family: 'Poppins', sans-serif;
  background: #F3F4F6;
  color: #1F2937;
  font-size: 14px;
  line-height: 1.5;
}

/* ── LAYOUT ── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy-dark);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform 0.25s;
}
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.main-content { padding: 24px; flex: 1; }

/* ── SIDEBAR ── */
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-logo {
  width: 40px; height: 40px; background: var(--gold);
  color: var(--navy); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; flex-shrink: 0;
}
.brand-name { color: white; font-weight: 700; font-size: 16px; }
.brand-sub  { color: rgba(255,255,255,0.5); font-size: 11px; }

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px; color: rgba(255,255,255,0.7);
  text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: white; }
.nav-item.active { background: rgba(255,255,255,0.12); color: white; border-left: 3px solid var(--gold); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 8px 0; }
.nav-logout { color: rgba(255,100,100,0.7); }
.nav-logout:hover { color: #ff6b6b; background: rgba(255,100,100,0.08); }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px; color: rgba(255,255,255,0.45); line-height: 1.5;
}
.sidebar-footer strong { color: rgba(255,255,255,0.75); }

/* ── TOPBAR ── */
.topbar {
  background: white; border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 60px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.sidebar-toggle {
  display: none; background: none; border: none;
  font-size: 20px; cursor: pointer; color: var(--navy); padding: 4px;
}
.topbar-title { font-size: 16px; font-weight: 600; color: var(--navy); flex: 1; }
.topbar-right { display: flex; gap: 8px; }

/* ── FLASH MESSAGES ── */
.flash-container { padding: 0 24px; margin-top: 16px; }
.flash {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-radius: 10px; margin-bottom: 8px;
  font-size: 14px; font-weight: 500;
}
.flash-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.flash-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.flash-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.flash-info    { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.flash-close   { background: none; border: none; cursor: pointer; font-size: 18px; opacity: 0.6; padding: 0 4px; }
.flash-close:hover { opacity: 1; }

/* ── CARDS ── */
.card {
  background: white; border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--navy); }
.card-body  { padding: 20px; }
.card-body.p-0 { padding: 0; }
.card-danger { border-color: #FECACA; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-8  { margin-top: 8px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-size: 13px;
  font-weight: 600; font-family: 'Poppins', sans-serif;
  text-decoration: none; cursor: pointer; border: none;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.98); }
.btn-primary  { background: var(--navy);  color: white; }
.btn-success  { background: var(--green); color: white; }
.btn-warning  { background: var(--yellow);color: white; }
.btn-danger   { background: var(--red);   color: white; }
.btn-outline  { background: white; color: var(--navy); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--navy); }
.btn-secondary{ background: #F3F4F6; color: #374151; }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-xs  { padding: 4px 8px;  font-size: 11px; border-radius: 6px; }
.btn-lg  { padding: 12px 24px; font-size: 15px; }
.btn-full{ width: 100%; justify-content: center; }
.mb-8  { margin-bottom: 8px; }

/* ── TABLES ── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 10px 16px; text-align: left; font-size: 12px;
  font-weight: 600; color: var(--gray); text-transform: uppercase;
  letter-spacing: 0.5px; background: var(--light-gray);
  border-bottom: 1px solid var(--border);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: #F9FAFB; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray); }
.text-navy   { color: var(--navy); }
.text-danger { color: var(--red); }
.text-sm     { font-size: 12px; }
.text-lg     { font-size: 16px; }
.font-600    { font-weight: 600; }
.font-700    { font-weight: 700; }

/* ── BADGES ── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
}
.badge-success   { background: #DCFCE7; color: #166534; }
.badge-warning   { background: #FFFBEB; color: #92400E; }
.badge-danger    { background: #FEF2F2; color: #991B1B; }
.badge-secondary { background: #F3F4F6; color: #374151; }
.badge-info      { background: #EFF6FF; color: #1E40AF; }
.badge-lg        { padding: 5px 14px; font-size: 13px; }

/* ── FORMS ── */
.form-layout { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.form-col-main { display: flex; flex-direction: column; gap: 0; }
.form-col-side { display: flex; flex-direction: column; gap: 0; }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { font-size: 13px; font-weight: 600; color: #374151; }
.form-label .req { color: var(--red); margin-left: 2px; }
.form-optional { font-size: 11px; color: var(--gray); font-weight: 400; }
.form-input {
  padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: 'Poppins', sans-serif; color: #1F2937;
  background: var(--light-gray); transition: border-color 0.2s, background 0.2s;
  width: 100%;
}
.form-input:focus { outline: none; border-color: var(--navy); background: white; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint  { font-size: 11px; color: var(--gray); }
.form-error { font-size: 12px; color: var(--red); font-weight: 500; }
.has-error .form-input { border-color: var(--red); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-prefix-group { display: flex; align-items: center; }
.input-prefix {
  background: var(--light-gray); border: 1.5px solid var(--border);
  border-right: none; border-radius: 8px 0 0 8px;
  padding: 9px 10px; font-size: 12px; color: var(--gray);
  white-space: nowrap;
}
.input-prefix-group .form-input { border-radius: 0 8px 8px 0; }
.input-with-toggle { position: relative; }
.input-with-toggle .form-input { padding-right: 40px; }
.toggle-password {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 16px; opacity: 0.6;
}
.color-input-group { display: flex; align-items: center; gap: 8px; }
.color-input-group input[type="color"] { width: 40px; height: 38px; border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; padding: 2px; }
.color-hex { flex: 1; }

/* ── THEME PREVIEW ── */
.theme-preview { display: flex; gap: 6px; border-radius: 8px; overflow: hidden; height: 36px; }
.theme-preview-bar,
.theme-preview-accent,
.theme-preview-highlight {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ── PAGE HEADER ── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.page-heading    { font-size: 20px; font-weight: 700; color: var(--navy); }
.page-subheading { font-size: 13px; color: var(--gray); margin-top: 2px; }
.back-link { font-size: 13px; color: var(--gray); text-decoration: none; display: block; margin-bottom: 4px; }
.back-link:hover { color: var(--navy); }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── STATUS BAR ── */
.status-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: white; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 16px; margin-bottom: 20px; flex-wrap: wrap; gap: 8px;
}
.status-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ml-8 { margin-left: 8px; }

/* ── TABS ── */
.tab-bar { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 0; }
.tab {
  padding: 10px 16px; font-size: 13px; font-weight: 500; color: var(--gray);
  text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -2px;
  display: flex; align-items: center; gap: 6px; transition: color 0.15s;
}
.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }
.tab-count {
  background: var(--light-gray); color: var(--gray);
  font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px;
}
.tab-count--green  { background: #DCFCE7; color: #166534; }
.tab-count--yellow { background: #FFFBEB; color: #92400E; }
.tab-count--red    { background: #FEF2F2; color: #991B1B; }

/* ── DASHBOARD ── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: white; border-radius: 12px; border: 1px solid var(--border);
  padding: 20px; display: flex; align-items: center; gap: 16px;
}
.stat-card--green  { border-left: 4px solid var(--green); }
.stat-card--yellow { border-left: 4px solid var(--yellow); }
.stat-card--blue   { border-left: 4px solid var(--navy); }
.stat-icon  { font-size: 28px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--navy); }
.stat-label { font-size: 12px; color: var(--gray); font-weight: 500; }
.dashboard-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dashboard-col  { display: flex; flex-direction: column; }

/* ── SUBMISSION LIST ── */
.submission-list { list-style: none; }
.submission-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.submission-item:last-child { border-bottom: none; }
.submission-avatar {
  width: 36px; height: 36px; background: var(--navy); color: white;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.submission-info { flex: 1; min-width: 0; }
.submission-name { font-weight: 600; font-size: 13px; color: #1F2937; }
.submission-meta { font-size: 11px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.submission-right { text-align: right; flex-shrink: 0; }
.submission-time  { font-size: 11px; color: var(--gray); margin-top: 3px; }

/* ── SECTIONS GRID ── */
.sections-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.section-card {
  background: white; border-radius: 12px; border: 1px solid var(--border);
  overflow: hidden; transition: box-shadow 0.2s;
}
.section-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.section-card--disabled { opacity: 0.55; }
.section-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.section-info { display: flex; align-items: center; gap: 10px; }
.section-icon { font-size: 20px; }
.section-label { font-size: 13px; font-weight: 600; color: var(--navy); }
.section-key-badge {
  font-size: 10px; color: var(--gray); background: var(--light-gray);
  padding: 1px 6px; border-radius: 4px; font-family: monospace;
}
.section-card-body { padding: 10px 16px; }
.section-status { font-size: 12px; font-weight: 500; }
.section-status--ok    { color: var(--green); }
.section-status--empty { color: var(--yellow); }
.section-status--info  { color: var(--navy); }
.section-card-footer { padding: 10px 16px; border-top: 1px solid var(--border); }

/* ── TOGGLE SWITCH ── */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; }
.toggle-input  { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: #D1D5DB; border-radius: 24px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-input:checked + .toggle-slider { background: var(--navy); }
.toggle-input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── SUBMISSION DETAIL ── */
.submission-detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.detail-list { display: flex; flex-direction: column; gap: 0; }
.detail-row {
  display: flex; padding: 10px 0; border-bottom: 1px solid var(--border);
  gap: 16px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row dt { width: 140px; flex-shrink: 0; font-size: 13px; color: var(--gray); font-weight: 500; }
.detail-row dd { flex: 1; font-size: 13px; color: #1F2937; }

/* ── PAGINATION ── */
.pagination { display: flex; gap: 4px; padding: 16px; justify-content: center; }
.page-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 13px; font-weight: 500; text-decoration: none;
  color: var(--navy); border: 1px solid var(--border); background: white;
}
.page-btn.active { background: var(--navy); color: white; border-color: var(--navy); }
.page-btn:hover:not(.active) { background: var(--light-gray); }

/* ── MISC ── */
.empty-state { padding: 48px 24px; text-align: center; color: var(--gray); }
.empty-icon  { font-size: 40px; margin-bottom: 12px; }
.empty-state p { margin-bottom: 16px; }
.action-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.page-title-cell { display: flex; flex-direction: column; gap: 4px; }
.page-colors { display: flex; gap: 4px; }
.color-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.1); }
.url-cell { font-size: 12px; font-family: monospace; }
.ext-icon { font-size: 10px; }
.link-primary { color: var(--navy); text-decoration: none; font-weight: 500; }
.link-primary:hover { text-decoration: underline; }
.link-muted { color: var(--gray); text-decoration: none; }
.link-muted:hover { color: var(--navy); }
.flex-row { display: flex; gap: 12px; flex-wrap: wrap; }
.gap-12 { gap: 12px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

/* ── LOGIN ── */
.login-body { background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrapper { width: 100%; max-width: 420px; padding: 24px; }
.login-card { background: white; border-radius: 20px; padding: 40px 36px; box-shadow: 0 24px 60px rgba(0,0,0,0.3); }
.login-brand { text-align: center; margin-bottom: 32px; }
.login-logo {
  width: 64px; height: 64px; background: var(--navy); color: var(--gold);
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 24px; margin: 0 auto 12px;
}
.login-title    { font-size: 24px; font-weight: 700; color: var(--navy); }
.login-subtitle { font-size: 13px; color: var(--gray); margin-top: 4px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-hint { text-align: center; font-size: 12px; color: var(--gray); margin-top: 20px; }
.login-hint a { color: var(--navy); }

/* ── PACKAGES ── */
.packages-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.features-textarea { min-height: 140px; font-size: 13px; }
.featured-toggle { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--light-gray); border-radius: 8px; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .form-layout { grid-template-columns: 1fr; }
  .dashboard-cols { grid-template-columns: 1fr; }
  .submission-detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .sections-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .main-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .header-actions { width: 100%; }
}