*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; background: #f5f0ea; color: #1a2e3b; min-height: 100vh; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #e0d6ca; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #8899a4; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #6b7a85; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.login-card { background: #fff; border-radius: 16px; padding: 48px 40px; width: 100%; max-width: 400px; box-shadow: 0 8px 48px rgba(27,94,122,0.1); }
.login-logo { font-family: 'Bebas Neue', sans-serif; font-size: 2rem; letter-spacing: 0.05em; color: #1a5c7a; text-align: center; }
.login-logo span { color: #e8631a; }
.login-subtitle { text-align: center; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em; color: #8899a4; margin: 8px 0 32px; }
.login-field { margin-bottom: 20px; }
.login-field label { display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #1a2e3b; margin-bottom: 8px; }
.login-field input { width: 100%; padding: 13px 16px; border: 2px solid #e0d6ca; border-radius: 10px; font-family: 'DM Sans', sans-serif; font-size: 0.9rem; color: #1a2e3b; background: #faf5ec; outline: none; transition: border-color 0.2s; }
.login-field input:focus { border-color: #5b9bbf; background: #fff; }
.login-error { color: #e74c3c; font-size: 0.85rem; margin-bottom: 16px; min-height: 20px; }
.login-btn { width: 100%; padding: 14px; border: none; border-radius: 50px; background: #e8631a; color: #fff; font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; transition: all 0.3s; }
.login-btn:hover { background: #d4550f; }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Dashboard */
.dashboard { display: flex; min-height: 100vh; }
.dash-sidebar { width: 240px; background: #1a5c7a; color: #fff; padding: 32px 24px; flex-shrink: 0; }
.dash-logo { font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem; letter-spacing: 0.05em; margin-bottom: 40px; }
.dash-logo span { color: #e8631a; }
.dash-nav { list-style: none; }
.dash-nav li { margin-bottom: 4px; }
.dash-nav a { display: block; padding: 12px 16px; color: rgba(255,255,255,0.75); text-decoration: none; border-radius: 10px; font-size: 0.9rem; font-weight: 500; transition: all 0.2s; }
.dash-nav a:hover, .dash-nav a.active { background: rgba(255,255,255,0.12); color: #fff; }
.dash-nav .logout-link { margin-top: 40px; color: rgba(255,255,255,0.5); }
.dash-nav .logout-link:hover { background: rgba(231,76,60,0.2); color: #e74c3c; }
.dash-main { flex: 1; padding: 40px; }
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.dash-header h1 { font-size: 1.6rem; font-weight: 700; }
.dash-header .user-badge { font-size: 0.85rem; color: #8899a4; }
.dash-table-wrap { background: #fff; border-radius: 16px; box-shadow: 0 4px 24px rgba(27,94,122,0.06); overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 700px; }
.dash-table th { text-align: left; padding: 16px 20px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: #8899a4; font-weight: 700; background: #faf5ec; border-bottom: 2px solid #e0d6ca; white-space: nowrap; }
.dash-table td { padding: 14px 20px; border-bottom: 1px solid #f0ebe3; vertical-align: middle; }
.dash-table tr:hover td { background: #faf5ec; }
.dash-table .status { display: inline-block; padding: 4px 12px; border-radius: 50px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.status-pending { background: #fff3e0; color: #e65100; }
.status-confirmed { background: #e8f5e9; color: #1b5e20; }
.status-cancelled { background: #fce4ec; color: #c62828; }
.dash-actions { display: flex; gap: 6px; }
.dash-actions button { padding: 6px 14px; border: none; border-radius: 6px; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.actions-dropdown { padding: 6px 14px; border: 2px solid #e0d6ca; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 0.78rem; font-weight: 600; background: #faf5ec; color: #1a2e3b; cursor: pointer; outline: none; transition: border-color 0.2s; appearance: none; -webkit-appearance: none; -moz-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 5 5-5' fill='none' stroke='%238899a4' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.actions-dropdown:focus { border-color: #5b9bbf; }
.program-card-admin .btn-delete { background: #3a1a1a; color: #ff8a80; border: none; border-radius: 50px; padding: 8px 20px; font-weight: 600; font-size: 0.8rem; cursor: pointer; transition: all 0.2s; }
.program-card-admin .btn-delete:hover { background: #4a2525; }
.dash-empty { text-align: center; padding: 60px 20px; color: #8899a4; }
.dash-section-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.dash-flex-row { display: flex; gap: 12px; align-items: center; }
.dash-btn-sm { width: auto; padding: 10px 24px; font-size: 0.8rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dash-btn-group { display: flex; gap: 8px; margin-top: 12px; }
.preview-img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }
.dash-loading { text-align: center; padding: 60px 20px; color: #8899a4; }
.dash-loading::after { content: '...'; animation: dots 1.5s steps(4, end) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.dash-section { display: none; }
.dash-section.active { display: block; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.program-card-admin { background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 4px 24px rgba(27,94,122,0.06); }
.program-card-admin h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.program-card-admin .meta { font-size: 0.8rem; color: #8899a4; margin-bottom: 16px; }
.program-card-admin .field { margin-bottom: 12px; }
.program-card-admin .field label { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #1a2e3b; margin-bottom: 4px; }
.program-card-admin .field input, .program-card-admin .field textarea { width: 100%; padding: 10px 14px; border: 2px solid #e0d6ca; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 0.85rem; outline: none; transition: border-color 0.2s; background: #faf5ec; }
.program-card-admin .field input:focus, .program-card-admin .field textarea:focus { border-color: #5b9bbf; background: #fff; }
.program-card-admin .field textarea { resize: vertical; min-height: 60px; }
.save-btn { padding: 8px 20px; border: none; border-radius: 50px; background: #1a5c7a; color: #fff; font-weight: 600; font-size: 0.8rem; cursor: pointer; transition: all 0.2s; font-family: 'DM Sans', sans-serif; }
.save-btn:hover { background: #154c66; }
.save-btn.preview-btn { background: #5b9bbf; }
.save-btn.preview-btn:hover { background: #4a8aa8; }
.program-card-admin select.field-level { width:100%; padding:10px 14px; border:2px solid #e0d6ca; border-radius:8px; font-family:'DM Sans',sans-serif; font-size:0.85rem; outline:none; transition:border-color 0.2s; background:#faf5ec; cursor:pointer; appearance: none; -webkit-appearance: none; -moz-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238899a4' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.program-card-admin select.field-level:focus { border-color:#5b9bbf; background:#fff; }
.program-card-admin input[type=number] { -moz-appearance: textfield; }
.program-card-admin input[type=number]::-webkit-outer-spin-button,
.program-card-admin input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.program-card-admin .file-input-wrap { display: flex; align-items: center; gap: 10px; }
.program-card-admin .file-input-wrap input[type=file] { display: none; }
.file-input-label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: #1a5c7a; color: #fff; border: none; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: background 0.2s; white-space: nowrap; }
.file-input-label:hover { background: #154c66; }
.file-input-label::before { content: ''; display: inline-block; width: 14px; height: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zM6 20V4h7v5h5v11H6z'/%3E%3C/svg%3E") no-repeat center; background-size: contain; }
.file-input-name { font-size: 0.78rem; color: #8899a4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }

/* Email Configuration */
.email-layout { display: grid; grid-template-columns: 1fr 1.5fr; gap: 24px; align-items: start; }
.email-card { background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 4px 24px rgba(27,94,122,0.06); }
.email-card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.email-card-desc { font-size: 0.8rem; color: #8899a4; margin-bottom: 20px; }
.email-input { width: 100%; padding: 10px 14px; border: 2px solid #e0d6ca; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 0.85rem; outline: none; transition: border-color 0.2s; background: #faf5ec; color: #1a2e3b; }
.email-card .field label { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #1a2e3b; margin-bottom: 4px; }
.email-input:focus { border-color: #5b9bbf; background: #fff; }
select.email-input { appearance: none; -webkit-appearance: none; -moz-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238899a4' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; cursor: pointer; }
.email-status { margin-top: 12px; font-size: 0.85rem; min-height: 24px; }
.email-status.success { color: #1b5e20; }
.email-status.error { color: #c62828; }
.template-card { background: #faf5ec; border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.template-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-left: 12px; }
.template-card .field { margin-bottom: 12px; }
.template-card .field label { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #1a2e3b; margin-bottom: 4px; }
.template-card .field input, .template-card .field textarea { width: 100%; padding: 10px 14px; border: 2px solid #e0d6ca; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 0.85rem; outline: none; transition: border-color 0.2s; background: #fff; }
.template-card .field input:focus, .template-card .field textarea:focus { border-color: #5b9bbf; }
.template-card .field textarea { resize: vertical; min-height: 80px; font-family: 'Courier New', monospace; font-size: 0.8rem; }

/* ── I18N Multilingual Fields ── */
.field-i18n { margin-bottom: 16px; }
.field-i18n > label { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #1a2e3b; margin-bottom: 6px; }
.i18n-inputs { display: flex; flex-direction: column; gap: 6px; }
.i18n-row { display: flex; align-items: center; gap: 8px; }
.i18n-lang-badge { min-width: 32px; text-align: center; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; color: #8899a4; background: #e0d6ca; border-radius: 4px; padding: 4px 6px; }
.i18n-row input, .i18n-row textarea { flex: 1; padding: 8px 12px; border: 2px solid #e0d6ca; border-radius: 8px; font-family: 'DM Sans', sans-serif; font-size: 0.85rem; outline: none; transition: border-color 0.2s; background: #fff; }
.i18n-row input:focus, .i18n-row textarea:focus { border-color: #5b9bbf; }
.i18n-row textarea { resize: vertical; min-height: 32px; }

@media(max-width:1024px){
  .email-layout { grid-template-columns: 1fr; }
}

@media(max-width:768px){
  .dashboard { flex-direction: column; }
  .dash-sidebar { width: 100%; padding: 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
  .dash-logo { margin-bottom: 0; }
  .dash-nav { display: flex; gap: 8px; flex-wrap: wrap; }
  .dash-nav li { margin-bottom: 0; }
  .dash-nav .logout-link { margin-top: 0; margin-left: auto; }
  .dash-main { padding: 24px 16px; }
  .dash-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}
