:root {
    --brand-primary: #3b82f6;
    --brand-primary-dark: #2563eb;
    --brand-primary-light: #60a5fa;
    --brand-accent: #8b5cf6;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --info: #0ea5e9;
    --info-dark: #0284c7;
    --text: #1f2937;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --bg: #f8fafc;
    --bg-dark: #eef2f7;
    --surface: #ffffff;
    --border: #e5e7eb;
    --border-dark: #d1d5db;
    --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.25);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 150ms ease-in-out;
}

/* Stable BlueGorilla brand utilities for public pages. */
.bg-brand { background-color: #1e3a5f !important; }
.bg-brand-dark { background-color: #0f243d !important; }
.bg-accent { background-color: #ff6b35 !important; }
.bg-accent-dark { background-color: #e55a2b !important; }
.text-brand { color: #1e3a5f !important; }
.text-accent { color: #ff6b35 !important; }
.text-white { color: #ffffff !important; }
.border-brand { border-color: #1e3a5f !important; }
.border-white\/30 { border-color: rgba(255, 255, 255, 0.3) !important; }
.bg-white\/5 { background-color: rgba(255, 255, 255, 0.05) !important; }
.hover\:bg-brand:hover { background-color: #1e3a5f !important; }
.hover\:bg-brand-dark:hover { background-color: #0f243d !important; }
.hover\:bg-accent:hover { background-color: #ff6b35 !important; }
.hover\:bg-accent-dark:hover { background-color: #e55a2b !important; }
.hover\:bg-white\/10:hover { background-color: rgba(255, 255, 255, 0.1) !important; }
.hover\:border-white:hover { border-color: #ffffff !important; }
.hover\:text-accent:hover { color: #ff6b35 !important; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { line-height: 1.15; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
body > :first-child { margin-top: 0 !important; }

.site-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0;
}

.panel-bg-gradient {
    background: linear-gradient(180deg, #eef2f7 0%, #f8fafc 400px, #f8fafc 100%);
    min-height: calc(100vh - 64px);
    padding: 24px 32px 48px;
}

.admin-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
}
.brand-text {
    letter-spacing: -0.02em;
}
.gorilla-logo {
    font-size: 28px;
    display: inline-block;
    animation: gorilla-bounce 4s ease-in-out infinite;
}
@keyframes gorilla-bounce {
    0%, 88%, 100% { transform: translateY(0) rotate(0deg); }
    92% { transform: translateY(-3px) rotate(-2deg); }
    96% { transform: translateY(-3px) rotate(2deg); }
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.admin-nav a {
    padding: 8px 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}
.admin-nav a:hover {
    background: var(--bg-dark);
    color: var(--text);
}
.admin-nav a.active {
    background: var(--brand-primary);
    color: #ffffff;
}
.admin-nav a.active:hover {
    background: var(--brand-primary-dark);
}

.admin-main {
    animation: fade-in 0.6s ease-out;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}
.page-header h1 small {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 14px;
    margin-left: 6px;
}
.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.tab {
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: var(--transition);
    font-size: 13px;
}
.tab:hover {
    color: var(--text);
    border-bottom-color: var(--border-dark);
}
.tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}
.card-body { padding: 24px; }
.card-body h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
}
.cms-preview-frame {
    width: 100%;
    min-height: 540px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}
.cms-editor {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.cms-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.cms-editor-toolbar .btn {
    min-width: 0;
}
.cms-rich-editor {
    min-height: 540px;
    padding: 28px;
    line-height: 1.8;
    color: #334155;
    font-size: 1.0625rem;
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
}
.cms-rich-editor:focus {
    outline: none;
}
.cms-rich-editor h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #0f172a;
}
.cms-rich-editor h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: #0f172a;
}
.cms-rich-editor h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: #0f172a;
}
.cms-rich-editor h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
    color: #0f172a;
}
.cms-rich-editor p,
.cms-rich-editor ul,
.cms-rich-editor ol,
.cms-rich-editor blockquote,
.cms-rich-editor pre,
.cms-rich-editor table {
    margin: 0 0 1.25rem;
}
.cms-rich-editor ul,
.cms-rich-editor ol {
    padding-left: 1.75rem;
}
.cms-rich-editor li {
    margin-bottom: 0.6rem;
    line-height: 1.7;
    color: #334155;
}
.cms-rich-editor blockquote {
    border-left: 4px solid #ff6b35;
    padding: 1rem 1.5rem;
    margin: 1.75rem 0;
    background: #fff7ed;
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
    color: #475569;
}
.cms-rich-editor a {
    color: #ff6b35;
    text-decoration: underline;
}
.cms-rich-editor a:hover {
    color: #e55a2b;
}
.cms-rich-editor code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    font-family: monospace;
}
.cms-rich-editor pre {
    background: #0f243d;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 0.75rem;
    overflow-x: auto;
}
.cms-rich-editor pre code {
    background: none;
    padding: 0;
    color: inherit;
}
.cms-rich-editor table {
    width: 100%;
    border-collapse: collapse;
}
.cms-rich-editor th,
.cms-rich-editor td {
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    text-align: left;
}
.cms-rich-editor th {
    background: #f8fafc;
    font-weight: 600;
}
.cms-rich-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
}
.cms-editor-source-hidden {
    display: none;
}
.note-editor.note-frame {
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    background: #fff !important;
}
.note-editor.note-frame .note-toolbar {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 12px !important;
}
.note-editor.note-frame .note-statusbar {
    border-top: 1px solid #e2e8f0 !important;
}
/* === PRIMARY SELECTOR: exact parity with public front-end .post-content === */
.note-editor.note-frame .note-editing-area .note-editable,
.note-editor .note-editing-area .note-editable,
.note-editable,
div.note-editable {
    min-height: 620px !important;
    padding: 32px !important;
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%) !important;
    color: #334155 !important;
    font-size: 1.0625rem !important;
    line-height: 1.8 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    max-width: 100% !important;
    display: block !important;
}
.note-editor.note-frame .note-editing-area .note-editable h1,
.note-editor .note-editing-area .note-editable h1,
.note-editable h1 {
    display: block !important;
    font-size: 2.25rem !important;
    font-weight: 800 !important;
    margin: 0 0 1rem 0 !important;
    color: #0f172a !important;
    line-height: 1.2 !important;
}
.note-editor.note-frame .note-editing-area .note-editable h2,
.note-editor .note-editing-area .note-editable h2,
.note-editable h2 {
    display: block !important;
    font-size: 1.875rem !important;
    font-weight: 700 !important;
    margin: 2rem 0 1rem 0 !important;
    color: #0f172a !important;
    line-height: 1.25 !important;
}
.note-editor.note-frame .note-editing-area .note-editable h3,
.note-editor .note-editing-area .note-editable h3,
.note-editable h3 {
    display: block !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    margin: 1.5rem 0 0.75rem 0 !important;
    color: #0f172a !important;
    line-height: 1.3 !important;
}
.note-editor.note-frame .note-editing-area .note-editable h4,
.note-editor .note-editing-area .note-editable h4,
.note-editable h4 {
    display: block !important;
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    margin: 1.25rem 0 0.5rem 0 !important;
    color: #0f172a !important;
    line-height: 1.35 !important;
}
.note-editor.note-frame .note-editing-area .note-editable p,
.note-editor .note-editing-area .note-editable p,
.note-editable p {
    display: block !important;
    margin: 0 0 1.25rem 0 !important;
    line-height: 1.8 !important;
    color: #334155 !important;
    font-size: 1.0625rem !important;
}
.note-editor.note-frame .note-editing-area .note-editable ul,
.note-editor .note-editing-area .note-editable ul,
.note-editable ul {
    display: block !important;
    list-style: disc !important;
    list-style-type: disc !important;
    padding-left: 1.75rem !important;
    margin: 0 0 1.25rem 0 !important;
}
.note-editor.note-frame .note-editing-area .note-editable ol,
.note-editor .note-editing-area .note-editable ol,
.note-editable ol {
    display: block !important;
    list-style: decimal !important;
    list-style-type: decimal !important;
    padding-left: 1.75rem !important;
    margin: 0 0 1.25rem 0 !important;
}
.note-editor.note-frame .note-editing-area .note-editable li,
.note-editor .note-editing-area .note-editable li,
.note-editable li {
    display: list-item !important;
    margin-bottom: 0.6rem !important;
    line-height: 1.7 !important;
    color: #334155 !important;
    list-style: inherit !important;
}
.note-editor.note-frame .note-editing-area .note-editable blockquote,
.note-editor .note-editing-area .note-editable blockquote,
.note-editable blockquote {
    display: block !important;
    border-left: 4px solid #ff6b35 !important;
    padding: 1rem 1.5rem !important;
    margin: 1.75rem 0 !important;
    background: #fff7ed !important;
    border-radius: 0 0.5rem 0.5rem 0 !important;
    font-style: italic !important;
    color: #475569 !important;
}
.note-editor.note-frame .note-editing-area .note-editable a,
.note-editor .note-editing-area .note-editable a,
.note-editable a {
    color: #ff6b35 !important;
    text-decoration: underline !important;
}
.note-editor.note-frame .note-editing-area .note-editable a:hover,
.note-editor .note-editing-area .note-editable a:hover,
.note-editable a:hover {
    color: #e55a2b !important;
}
.note-editor.note-frame .note-editing-area .note-editable code,
.note-editor .note-editing-area .note-editable code,
.note-editable code {
    background: #f1f5f9 !important;
    padding: 0.15rem 0.4rem !important;
    border-radius: 0.25rem !important;
    font-size: 0.9em !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    color: #be123c !important;
}
.note-editor.note-frame .note-editing-area .note-editable pre,
.note-editor .note-editing-area .note-editable pre,
.note-editable pre {
    display: block !important;
    background: #0f243d !important;
    color: #e2e8f0 !important;
    padding: 1.5rem !important;
    border-radius: 0.75rem !important;
    overflow-x: auto !important;
    margin: 1.5rem 0 !important;
    line-height: 1.6 !important;
}
.note-editor.note-frame .note-editing-area .note-editable pre code,
.note-editor .note-editing-area .note-editable pre code,
.note-editable pre code {
    background: none !important;
    padding: 0 !important;
    color: inherit !important;
    font-size: 0.875rem !important;
}
.note-editor.note-frame .note-editing-area .note-editable img,
.note-editor .note-editing-area .note-editable img,
.note-editable img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 0.75rem !important;
    margin: 1.5rem 0 !important;
    display: block !important;
}
.note-editor.note-frame .note-editing-area .note-editable table,
.note-editor .note-editing-area .note-editable table,
.note-editable table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 1.5rem 0 !important;
    display: table !important;
}
.note-editor.note-frame .note-editing-area .note-editable th,
.note-editor .note-editing-area .note-editable th,
.note-editable th {
    border: 1px solid #e2e8f0 !important;
    padding: 0.75rem 1rem !important;
    text-align: left !important;
    background: #f8fafc !important;
    font-weight: 600 !important;
    display: table-cell !important;
}
.note-editor.note-frame .note-editing-area .note-editable td,
.note-editor .note-editing-area .note-editable td,
.note-editable td {
    border: 1px solid #e2e8f0 !important;
    padding: 0.75rem 1rem !important;
    text-align: left !important;
    display: table-cell !important;
}
.note-editor.note-frame .note-editing-area .note-editable hr,
.note-editor .note-editing-area .note-editable hr,
.note-editable hr {
    border: none !important;
    border-top: 1px solid #e2e8f0 !important;
    margin: 1.5rem 0 !important;
    display: block !important;
}
.note-editor.note-frame .note-editing-area .note-editable strong,
.note-editor .note-editing-area .note-editable strong,
.note-editable strong {
    font-weight: 700 !important;
    color: #0f172a !important;
}
.note-editor.note-frame.note-fullscreen .note-editing-area .note-editable,
.note-editor.note-fullscreen .note-editable {
    padding: 40px 56px !important;
    max-width: 820px !important;
    margin: 0 auto !important;
}
.card-body h4 {
    margin: 20px 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}
.post-content figure.post-hero-image,
.post-content figure {
    margin: 2rem 0 2.25rem;
    text-align: center;
}
.post-content figure.post-hero-image img,
.post-content figure img.featured-inline,
.post-content .wp-post-image {
    max-width: 100%;
    width: 100%;
    border-radius: 1rem !important;
    box-shadow: 0 12px 32px -8px rgba(15, 36, 61, 0.18);
    margin: 0 auto;
    display: block;
}
.post-content figure figcaption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #64748b;
    font-style: italic;
    text-align: center;
}
.note-editor .note-editable figure.post-hero-image,
.note-editor .note-editable figure {
    margin: 1.5rem 0;
    text-align: center;
}
.note-editor .note-editable figure.post-hero-image img,
.note-editor .note-editable figure img.featured-inline,
.note-editor .note-editable .wp-post-image {
    max-width: 100%;
    width: 100%;
    border-radius: 1rem !important;
    box-shadow: 0 10px 24px -6px rgba(15, 36, 61, 0.18);
    margin: 0 auto;
    display: block;
}

.form-main { width: 100%; }
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}
.form-group {
    margin-bottom: 16px;
    min-width: 0;
}
.col-12 { flex: 0 0 100%; width: 100%; }
.col-6 { flex: 0 0 calc(50% - 8px); width: calc(50% - 8px); }
.col-4 { flex: 0 0 calc(33.333% - 11px); width: calc(33.333% - 11px); }
.col-3 { flex: 0 0 calc(25% - 12px); width: calc(25% - 12px); }
@media (max-width: 992px) {
    .col-lg-8, .col-lg-6, .col-lg-4 { flex: 0 0 100%; width: 100%; }
}
@media (max-width: 768px) {
    .col-md-6, .col-md-4, .col-md-3 { flex: 0 0 100%; width: 100%; }
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text);
    font-size: 13px;
}
.form-group .req { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }

.input-text, .textarea, .select {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}
.input-text::placeholder, .textarea::placeholder { color: var(--text-light); }
.input-text:focus, .textarea:focus, .select:focus {
    border-color: var(--brand-primary);
    box-shadow: var(--focus-ring);
}
.textarea { resize: vertical; min-height: 80px; }
.textarea-sm { min-height: 60px; }
.select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}
.promo-input {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: 1px;
}
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
    padding-top: 6px;
}
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-primary);
}
.form-check-group { display: flex; align-items: flex-end; padding-bottom: 16px; }

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}
.form-actions-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.form-actions-inline label { width: 100%; }
.form-inline {
    display: inline-flex;
    margin: 0;
    padding: 0;
}
.form-filter { margin-bottom: 8px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    user-select: none;
}
.btn:focus {
    outline: none;
    box-shadow: var(--focus-ring);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }
.btn-block { width: 100%; }

.btn-primary {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}
.btn-primary:hover:not(:disabled) {
    background: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-secondary {
    background: #f3f4f6;
    color: var(--text);
    border-color: var(--border-dark);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--border);
    border-color: #9ca3af;
    transform: translateY(-1px);
}
.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border-color: var(--border-dark);
}
.btn-outline:hover:not(:disabled) {
    background: var(--bg-dark);
    color: var(--text);
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
    line-height: 1.6;
    letter-spacing: 0.02em;
}
.badge-green { background: #d1fae5; color: #065f46; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-gray { background: #f3f4f6; color: #4b5563; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-red { background: #fee2e2; color: #991b1b; }

.flash {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-weight: 500;
    border: 1px solid transparent;
}
.flash-success {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}
.flash-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}
.flash-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}
@keyframes fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.table thead th {
    text-align: left;
    padding: 10px 12px;
    background: var(--bg-dark);
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}
.table tbody tr:hover { background: #fafafa; }
.table tbody tr:last-child td { border-bottom: none; }
.table .text-center { text-align: center; }
.actions-cell {
    white-space: nowrap;
    width: 1%;
}
.actions-cell .form-inline { margin-left: 6px; }

.code-slug {
    background: var(--bg-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--text);
    word-break: break-all;
}
.mono {
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.pagination {
    display: flex;
    gap: 4px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.page-link {
    padding: 6px 12px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    transition: var(--transition);
}
.page-link:hover {
    background: var(--bg-dark);
    border-color: var(--border-dark);
}
.page-link.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.icon-home {
    font-size: 16px;
    margin-right: 4px;
    color: var(--warning);
}

.upload-dropzone {
    border: 2px dashed var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    background: var(--bg-dark);
    text-align: center;
    transition: var(--transition);
}
.upload-dropzone.dragover {
    border-color: var(--brand-primary);
    background: #eff6ff;
}
.upload-inner .upload-icon {
    font-size: 48px;
    margin: 0 0 12px;
    opacity: 0.5;
}
.upload-hint {
    color: var(--text-muted);
    margin: 0 0 20px;
    font-size: 14px;
}
#file-upload { display: none; }

.media-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.media-item {
    flex: 0 0 calc(20% - 13px);
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}
.media-item:hover {
    border-color: var(--brand-primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.media-thumb {
    aspect-ratio: 1 / 1;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}
.placeholder-icon { font-size: 40px; }
.media-info { padding: 10px 12px; }
.media-name {
    font-weight: 500;
    font-size: 12px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.media-meta {
    display: flex;
    gap: 6px;
    color: var(--text-muted);
    font-size: 11px;
    margin: 4px 0 8px;
}
.media-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
@media (max-width: 1200px) {
    .media-item { flex: 0 0 calc(25% - 12px); }
}
@media (max-width: 900px) {
    .media-item { flex: 0 0 calc(33.333% - 11px); }
}
@media (max-width: 600px) {
    .media-item { flex: 0 0 calc(50% - 8px); }
}
.col-full { flex: 0 0 100%; width: 100%; }

.promo-code {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--brand-primary);
    letter-spacing: 0.05em;
}
.ml-5 { margin-left: 5px; }
.py-40 { padding: 40px 0; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.mt-10 { margin-top: 10px; }

.log-viewer {
    width: 100%;
    padding: 16px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #e5e7eb;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: var(--radius-md);
    resize: vertical;
    min-height: 500px;
    white-space: pre-wrap;
    word-break: break-all;
}
.log-viewer:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.variables-box {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
}
.variables-box summary {
    cursor: pointer;
    padding: 4px 0;
}
.variables-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}
.var-chip {
    background: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--brand-primary-dark);
}

.details-inline {
    background: var(--bg-dark);
    padding: 6px 10px;
    border-radius: var(--radius);
}
.details-inline summary {
    cursor: pointer;
    font-size: 12px;
    color: var(--brand-primary);
    font-weight: 500;
}
.json-pre {
    margin: 8px 0 0;
    padding: 8px;
    background: #1f2937;
    color: #e5e7eb;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.5;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

.btn-block { width: 100%; }

@media (max-width: 768px) {
    .panel-bg-gradient { padding: 16px; }
    .header-inner { padding: 10px 16px; }
    .page-header h1 { font-size: 18px; }
    .card-body { padding: 16px; }
    .form-actions { justify-content: stretch; }
    .form-actions .btn { flex: 1; }
}
