:root {
    --bg-dark: #0f172a;
    --bg-glass: rgba(30, 41, 59, 0.7);
    --border-glass: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
}

.hidden {
    display: none !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Typography */
h1, h2, h3 {
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
    font-size: 0.95rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input[type="text"],
input[type="password"],
input[type="date"],
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: var(--bg-dark);
}

.login-panel {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    margin: 1rem;
}

.error-msg {
    color: #fca5a5;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: none;
}

/* Dashboard Layout */
.admin-header {
    position: sticky;
    top: 1rem;
    margin: 1rem 1rem 2rem 1rem;
    padding: 1rem 1.5rem;
    z-index: 10;
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.25rem;
}

.admin-section {
    padding: 2rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Items List */
.items-container {
    display: grid;
    gap: 1rem;
}

.item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .item-card {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }
}

.item-content h3 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.item-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 1rem;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 500;
    transition: bottom 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 300;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
}

.toast.show {
    bottom: 2rem;
}

/* ===== Additions: tabs, recovery views, picture fields, webinar video panel ===== */
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"] {
    width: 100%;
}
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1rem; }
.muted-inline { color: var(--text-secondary); font-size: 0.75em; font-weight: 400; }
.auth-links { margin-top: 1rem; font-size: 0.9rem; text-align: center; }
.auth-links a { color: var(--accent); }
.error-msg.ok { color: #4ade80; }
.notice {
    background: rgba(234, 179, 8, 0.15); border: 1px solid rgba(234, 179, 8, 0.5);
    color: #fde68a; padding: 0.8rem 1rem; border-radius: 10px; margin-bottom: 1rem;
}
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tab-btn {
    background: var(--bg-glass); color: var(--text-secondary); border: 1px solid var(--border-glass);
    padding: 0.55rem 1.1rem; border-radius: 999px; cursor: pointer; font: inherit;
}
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-images { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.img-label { font-weight: 600; margin-bottom: 0.4rem; font-size: 0.9rem; }
.img-row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.img-preview { width: 160px; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-glass); background: rgba(0,0,0,0.25); }
.img-controls { flex: 1; min-width: 220px; display: grid; gap: 8px; }
.texts-details { margin-top: 1.5rem; border: 1px solid var(--border-glass); border-radius: 10px; padding: 0.8rem 1rem; }
.texts-details summary { cursor: pointer; font-weight: 600; }
.text-row { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px dashed var(--border-glass); }
.text-row-label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.4rem; }
.badge { font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; vertical-align: middle; font-weight: 600; }
.badge-on { background: rgba(74, 222, 128, 0.2); color: #4ade80; }
.badge-off { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.video-panel { border: 1px solid var(--border-glass); border-radius: 10px; padding: 1rem; margin: 1rem 0; }
.video-panel legend { padding: 0 0.5rem; font-weight: 600; }
.dimmed { opacity: 0.55; }
.switch-row { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 1rem; }
.switch-row.small { margin: 0 10px 0 0; font-size: 0.85rem; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; z-index: 1; }
.slider { position: absolute; inset: 0; background: #475569; border-radius: 999px; transition: background .2s; }
.slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; }
.switch input:checked + .slider { background: #22c55e; }
.switch input:checked + .slider::before { transform: translateX(20px); }
.toast.error { background: var(--danger); }
.item-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
input[type="email"], input[type="number"] {
    width: 100%; padding: 0.75rem 1rem; background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass); border-radius: 8px; color: var(--text-primary); font-family: inherit;
}
.login-panel .btn-primary { width: 100%; margin-top: 0.5rem; }

/* ===== Articles: Markdown help, preview, anchors ===== */
code { background: rgba(148, 163, 184, 0.18); padding: 1px 6px; border-radius: 5px; font-size: 0.85em; }
.md-help { line-height: 1.9; }
.md-preview-btn { margin-top: 8px; }
.md-preview {
    margin-top: 10px; padding: 14px 16px; max-height: 320px; overflow: auto;
    background: rgba(15, 23, 42, 0.6); border: 1px dashed var(--border-glass); border-radius: 8px;
    color: var(--text-primary);
}
.md-preview .md-h1 { font-size: 1.5rem; margin: 0.9em 0 0.4em; }
.md-preview .md-h2 { font-size: 1.25rem; margin: 0.9em 0 0.4em; }
.md-preview .md-h3 { font-size: 1.05rem; margin: 0.9em 0 0.4em; }
.md-preview p { margin: 0 0 0.8em; }
.md-preview ul { list-style: disc; padding-left: 1.4em; margin: 0 0 0.8em; }
.md-preview ol { list-style: decimal; padding-left: 1.4em; margin: 0 0 0.8em; }
.anchor-line { margin-top: 6px; font-size: 0.85rem; }
select {
    padding: 0.6rem 0.8rem; background: rgba(15, 23, 42, 0.6); color: var(--text-primary);
    border: 1px solid var(--border-glass); border-radius: 8px; font-family: inherit;
}

