:root {
    --bg: #081120;
    --bg-soft: #0f172a;
    --panel: #ffffff;
    --panel-soft: #f8fafc;
    --line: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --purple: #7c3aed;
    --green: #16a34a;
    --yellow: #d97706;
    --danger: #dc2626;
    --success-bg: #dcfce7;
    --error-bg: #fee2e2;
    --warning-bg: #fef3c7;
    --radius: 22px;
    --shadow: 0 22px 50px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 24%),
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.12), transparent 26%),
        linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
    color: var(--text);
}

body {
    min-height: 100vh;
}

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(8, 17, 32, 0.82);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.header-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 14px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
}

.brand-badge {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    box-shadow: 0 18px 32px rgba(59, 130, 246, 0.28);
}

.brand strong {
    display: block;
    font-size: 1.05rem;
}

.brand small {
    color: rgba(255, 255, 255, 0.72);
}

.top-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.top-nav a {
    color: rgba(255, 255, 255, 0.92);
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 600;
}

.top-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.user-pill {
    display: grid;
    gap: 2px;
    min-width: 180px;
    padding: 10px 14px;
    border-radius: 16px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.user-pill span {
    font-weight: 700;
}

.user-pill small {
    color: rgba(255, 255, 255, 0.72);
}

.page-content {
    padding: 32px 0 58px;
}

.hero {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 22px;
    align-items: stretch;
    padding: 34px;
    border-radius: 32px;
    color: #fff;
    box-shadow: var(--shadow);
}

.professional-hero {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.13), transparent 28%),
        linear-gradient(135deg, #081120 0%, #16348c 58%, #312e81 100%);
}

.hero h1 {
    margin: 12px 0;
    font-size: clamp(2rem, 3vw, 3.25rem);
    line-height: 1.08;
}

.hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    max-width: 720px;
    font-size: 1.02rem;
    line-height: 1.7;
}

.hero-copy,
.hero-side {
    display: grid;
    gap: 18px;
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

.hero-points span {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.94rem;
}

.compact-points span {
    font-size: 0.88rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.hero-stat-card {
    padding: 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-stat-card.wide {
    grid-column: 1 / -1;
}

.hero-stat-card strong {
    display: block;
    font-size: 2rem;
    margin-bottom: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.dark-tag {
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.14);
}

.search-box,
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #d9e2ee;
    background: #fff;
    border-radius: 16px;
    padding: 14px 16px;
    outline: none;
    font: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.search-box:focus-within,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.search-box {
    display: grid;
    gap: 12px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 18px;
}

.search-box.elevated {
    border-radius: 24px;
}

.search-box label {
    display: grid;
    gap: 8px;
}

.search-box label span {
    font-weight: 700;
}

.search-box input {
    background: rgba(255, 255, 255, 0.96);
}

.search-box button,
.btn {
    border: none;
    border-radius: 16px;
    padding: 14px 18px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.search-box button:hover,
.btn:hover {
    transform: translateY(-1px);
}

.btn-primary,
.search-box button {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: #fff;
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover,
.search-box button:hover {
    background: linear-gradient(135deg, var(--primary-dark), #6d28d9);
}

.btn-secondary {
    background: #eff6ff;
    color: #1d4ed8;
}

.btn-block {
    width: 100%;
}

.feature-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 22px;
}

.feature-card {
    padding: 22px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.feature-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.02rem;
}

.feature-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 28px 0 18px;
}

.section-header h1,
.section-header h2,
.section-header h3 {
    margin: 0 0 6px;
}

.section-header p,
.lead-text,
.content-text,
.table-muted,
.form-group small,
.login-tip,
.empty-state p,
.stat-card span,
.sidebar-link span {
    color: var(--muted);
}

.compact {
    margin: 0 0 16px;
}

.admin-hero {
    padding: 28px;
    border-radius: 30px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(239,246,255,0.98));
    border: 1px solid rgba(226, 232, 240, 0.96);
    box-shadow: var(--shadow);
}

.grid {
    display: grid;
    gap: 20px;
}

.cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
}

.card {
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.refined-card {
    overflow: hidden;
}

.video-card {
    overflow: hidden;
}

.thumb-wrapper {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
}

.thumb-wrapper img,
.player-wrapper video,
.player-wrapper iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
}

.thumb-fallback {
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 3rem;
    color: #1e3a8a;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
}

.thumb-fallback.large {
    min-height: 320px;
    font-size: 1.3rem;
}

.card-body {
    padding: 22px;
}

.card-body h3,
.card-body h1,
.auth-card h2 {
    margin: 12px 0 10px;
}

.meta-line {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.92rem;
}

.card-actions,
.actions-inline,
.resource-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.badge,
.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
}

.badge {
    background: #eff6ff;
    color: #1d4ed8;
}

.status.published {
    background: #dcfce7;
    color: #166534;
}

.status.draft {
    background: #fef3c7;
    color: #92400e;
}

.video-page {
    display: grid;
    gap: 22px;
}

.professional-video-page {
    grid-template-columns: minmax(0, 1.6fr) minmax(290px, 0.72fr);
    align-items: start;
}

.detail-card {
    overflow: hidden;
}

.player-wrapper {
    aspect-ratio: 16/9;
    background: #000;
}

.detail-body {
    padding: 26px;
}

.resource-card,
.sidebar-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid var(--line);
}

.resource-card {
    flex: 1 1 260px;
}

.sidebar-card {
    padding: 22px;
    position: sticky;
    top: 92px;
}

.sidebar-links {
    display: grid;
    gap: 12px;
}

.sidebar-link strong {
    font-size: 0.98rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    padding: 22px;
    border-radius: 24px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: var(--shadow);
}

.professional-stats .stat-card {
    color: #fff;
}

.stat-blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.stat-green { background: linear-gradient(135deg, #16a34a, #15803d); }
.stat-yellow { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-purple { background: linear-gradient(135deg, #7c3aed, #6d28d9); }

.stat-card strong {
    display: block;
    font-size: 2rem;
    margin-bottom: 8px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 22px;
}

.admin-grid-professional {
    align-items: start;
}

.form-card,
.list-card,
.single-form-card {
    padding: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group span {
    font-weight: 700;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-note-card {
    padding: 16px;
    border-radius: 18px;
    background: var(--panel-soft);
    border: 1px dashed #cbd5e1;
}

.full-width {
    grid-column: 1 / -1;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
}

.table-wrapper {
    overflow-x: auto;
}

.table-wrapper table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrapper th,
.table-wrapper td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.professional-table th {
    color: #334155;
    font-size: 0.92rem;
}

.compact-actions {
    gap: 10px;
}

.link-btn {
    color: var(--primary);
    font-weight: 700;
}

.link-btn.danger {
    color: var(--danger);
}

.auth-wrapper {
    min-height: calc(100vh - 220px);
    display: grid;
    place-items: center;
}

.professional-auth {
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 460px);
    gap: 24px;
    align-items: stretch;
}

.auth-hero-card,
.auth-card {
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.auth-hero-card {
    padding: 28px;
    color: #fff;
    background: linear-gradient(135deg, #081120 0%, #16348c 58%, #312e81 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-hero-card p {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.7;
}

.auth-card {
    width: min(520px, 100%);
    padding: 26px;
}

.refined-auth-card {
    align-self: center;
}

.boxed-tip {
    padding: 16px;
    background: #f8fafc;
    border-radius: 18px;
    border: 1px dashed #cbd5e1;
}

.alert {
    border-radius: 18px;
    padding: 14px 18px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--success-bg);
    color: #166534;
    border-color: #bbf7d0;
}

.alert-error {
    background: var(--error-bg);
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background: var(--warning-bg);
    color: #92400e;
    border-color: #fde68a;
}

.empty-state {
    padding: 40px;
    text-align: center;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-state.small {
    padding: 22px;
}

.site-footer {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding: 22px 0;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 0.95rem;
}

@media (max-width: 1100px) {
    .header-content,
    .professional-video-page,
    .professional-auth,
    .hero,
    .admin-grid,
    .stats-grid,
    .feature-strip {
        grid-template-columns: 1fr;
    }

    .sidebar-card {
        position: static;
    }
}

@media (max-width: 780px) {
    .header-content,
    .top-nav,
    .footer-inner,
    .section-header {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .page-content {
        padding-top: 22px;
    }

    .hero,
    .admin-hero,
    .auth-hero-card,
    .card,
    .feature-card {
        border-radius: 24px;
    }

    .hero,
    .auth-card,
    .form-card,
    .list-card,
    .single-form-card {
        padding: 22px;
    }

    .hero-stat-card.wide {
        grid-column: auto;
    }

    .form-grid,
    .hero-stats {
        grid-template-columns: 1fr;
    }

    .container {
        width: min(100%, calc(100% - 24px));
    }

    .user-pill {
        min-width: 0;
        width: 100%;
    }
}
