@import url('https://fonts.googleapis.com/css2?family=Teachers:ital,wght@0,400..800;1,400..800&display=swap');

:root {
    --black: #111111;
    --black-soft: #1b1b1b;
    --red: #dc1f26;
    --red-dark: #b7191f;
    --red-soft: #fff1f2;
    --yellow: #f4c430;
    --yellow-dark: #d7a915;
    --yellow-soft: #fff9df;

    --background: #f6f6f4;
    --surface: #ffffff;
    --text: #171717;
    --muted: #6b7280;
    --border: #e4e4e1;
    --success: #16a05d;

    --shadow-small: 0 5px 16px rgba(17, 17, 17, 0.05);
    --shadow: 0 14px 35px rgba(17, 17, 17, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family: "Teachers", sans-serif !important;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

/* =====================================
   TOP HEADER
===================================== */

.topbar {
    min-height: 82px;
    padding: 0 5vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--black);
    color: #ffffff;
    border-bottom: 3px solid var(--yellow);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar > div,
.topbar-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-brand,
.brand-logo {
    display: inline-flex;
    align-items: center;
}

.topbar-brand img,
.brand-logo img,
.header-logo {
    display: block;
    width: 85px;
    max-width: 85px;
    height: 54px;
    object-fit: contain;
    object-position: left center;
}

.topbar span {
    padding-left: 18px;
    border-left: 1px solid #3f3f3f;
    color: #d1d5db;
    font-size: 15px;
    font-weight: 500;
}

.topbar .btn.ghost {
    min-width: 105px;
}

/* =====================================
   PAGE LAYOUT
===================================== */

.container {
    width: min(1220px, 91vw);
    margin: 46px auto 80px;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.page-head h1 {
    margin: 0 0 10px;
    color: var(--black);
    font-size: clamp(38px, 4vw, 52px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1.6px;
}

.page-head h1::after {
    content: "";
    display: block;
    width: 68px;
    height: 4px;
    margin-top: 16px;
    border-radius: 10px;
    background: linear-gradient(
        90deg,
        var(--red) 0 62%,
        var(--yellow) 62% 100%
    );
}

.page-head p,
.muted {
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.55;
}

/* =====================================
   GRID
===================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 26px;
}

.span-2 {
    grid-column: span 2;
}

/* =====================================
   PANELS
===================================== */

.panel {
    position: relative;
    padding: 28px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 74px;
    height: 4px;
    border-radius: 0 0 8px 0;
    background: linear-gradient(
        90deg,
        var(--red),
        var(--yellow)
    );
}

.panel h2 {
    margin: 0 0 22px;
    color: var(--black);
    font-size: 24px;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.4px;
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 31px;
    padding: 5px 13px;
    border: 1px solid #ecd16a;
    border-radius: 999px;
    background: var(--yellow-soft);
    color: var(--black);
    font-size: 13px;
    font-weight: 650;
}

/* =====================================
   FORMS
===================================== */

.form-grid {
    display: grid;
    gap: 17px;
}

.form-grid.two-col {
    grid-template-columns: 1fr 1fr;
}

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

label {
    display: grid;
    gap: 8px;
    color: #292929;
    font-size: 15px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-height: 52px;
    padding: 12px 15px;
    border: 1px solid #d6d6d2;
    border-radius: 11px;
    outline: none;
    background: #ffffff;
    color: var(--text);
    font-size: 16px;
    font-weight: 400;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

textarea {
    min-height: 115px;
    resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #b8b8b3;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--yellow-dark);
    box-shadow: 0 0 0 4px rgba(244, 196, 48, 0.18);
}

input[type="file"] {
    padding: 8px;
    background: #fafafa;
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    background: var(--black);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
    background: var(--red);
}

input[type="radio"] {
    width: 20px;
    height: 20px;
    min-height: 0;
    accent-color: var(--red);
}

/* =====================================
   BUTTONS
===================================== */

.btn {
    min-height: 48px;
    padding: 11px 18px;
    border: none;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 650;
    line-height: 1;
    transition:
        transform 0.16s ease,
        background 0.16s ease,
        box-shadow 0.16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.primary {
    background: var(--red);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(220, 31, 38, 0.18);
}

.btn.primary:hover {
    background: var(--red-dark);
    box-shadow: 0 10px 25px rgba(220, 31, 38, 0.24);
}

.btn.secondary {
    background: var(--yellow);
    color: var(--black);
    box-shadow: 0 8px 20px rgba(244, 196, 48, 0.2);
}

.btn.secondary:hover {
    background: #e6b925;
}

.btn.ghost {
    background: transparent;
    color: #ffffff;
    border: 1px solid #575757;
}

.btn.ghost:hover {
    background: #ffffff;
    color: var(--black);
    border-color: #ffffff;
}

.btn.danger {
    background: var(--red-soft);
    color: var(--red);
    border: 1px solid #ffc9cc;
}

.btn.danger:hover {
    background: var(--red);
    color: #ffffff;
    border-color: var(--red);
}

.btn.small {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 14px;
}

.btn.full {
    width: 100%;
}

.text-link {
    display: inline-flex;
    margin-top: 18px;
    color: var(--red);
    font-size: 15px;
    font-weight: 600;
}

.text-link:hover {
    color: var(--red-dark);
}

/* =====================================
   LOGIN
===================================== */

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(244, 196, 48, 0.22),
            transparent 31%
        ),
        radial-gradient(
            circle at 90% 90%,
            rgba(220, 31, 38, 0.12),
            transparent 35%
        ),
        #f7f7f5;
}

.auth-card {
    width: min(460px, 100%);
    padding: 42px;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border);
    border-top: 4px solid var(--yellow);
    border-radius: 20px;
    box-shadow: 0 24px 65px rgba(17, 17, 17, 0.13);
}

.auth-card::after {
    content: "";
    position: absolute;
    top: -45px;
    right: -45px;
    width: 115px;
    height: 115px;
    border-radius: 50%;
    background: rgba(220, 31, 38, 0.06);
}

.wide-card {
    width: min(760px, 100%);
}

.auth-card h1 {
    margin: 25px 0 8px;
    color: var(--black);
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -1.2px;
}

.auth-card .muted {
    margin-bottom: 26px;
    font-size: 16px;
}

.brand-mark,
.login-brand {
    width: 85px;
    max-width: 85px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.brand-mark img,
.login-brand img {
    display: block;
    width: 85px;
    max-width: 85px;
    height: 62px;
    object-fit: contain;
    object-position: left center;
}

.hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

/* =====================================
   STATUS
===================================== */

.status-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.status-line {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 12px;
    color: var(--black);
    font-size: 17px;
    font-weight: 600;
}

.status-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #a1a1a1;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 0 6px rgba(22, 160, 93, 0.13);
}

.small-text {
    margin-bottom: 25px;
    font-size: 15px;
}

.status-card form {
    margin-top: auto;
}

/* =====================================
   ALERTS
===================================== */

.alert {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 550;
}

.alert.success {
    background: #e8f8ef;
    color: #08703d;
    border: 1px solid #bfe8d0;
}

.alert.error {
    background: var(--red-soft);
    color: var(--red-dark);
    border: 1px solid #ffc8cb;
}

/* =====================================
   TABLE
===================================== */

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 15px;
}

th {
    background: #fafaf8;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

tbody tr:hover {
    background: #fffdf4;
}

.right {
    text-align: right;
}

.empty {
    padding: 40px;
    color: var(--muted);
    text-align: center;
}

/* =====================================
   CONTENT LIBRARY
===================================== */

.content-panel {
    padding-bottom: 90px;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.content-card {
    padding: 15px;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.content-card:hover {
    transform: translateY(-3px);
    border-color: #cfcfca;
    box-shadow: var(--shadow);
}

.selected-card {
    background: #fffef9;
    border: 2px solid var(--yellow);
    box-shadow: 0 0 0 4px rgba(244, 196, 48, 0.12);
}

.select-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 13px;
    color: var(--black);
    font-size: 16px;
    font-weight: 600;
}

.preview {
    height: 205px;
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #141414;
    border-radius: 12px;
}

.preview img,
.preview video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.type-label {
    position: absolute;
    right: 9px;
    bottom: 9px;
    padding: 5px 9px;
    border-radius: 6px;
    background: rgba(17, 17, 17, 0.9);
    color: var(--yellow);
    font-size: 11px;
    font-weight: 650;
}

.link-preview {
    height: 100%;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    color: var(--yellow);
    text-align: center;
    font-size: 38px;
}

.link-preview small {
    color: #e5e7eb;
    font-size: 13px;
}

.content-meta {
    display: grid;
    gap: 4px;
    padding: 14px 4px 12px;
}

.content-meta strong {
    overflow: hidden;
    color: var(--black);
    font-size: 19px;
    font-weight: 650;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.content-meta span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 550;
}

.delete-btn {
    width: 100%;
}

.empty-card {
    grid-column: 1 / -1;
    padding: 50px;
    background: #fafaf8;
    border: 1px dashed #bdbdb7;
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
}

/* =====================================
   STICKY DISPLAY BUTTON
===================================== */

.sticky-action {
    position: fixed;
    left: 50%;
    bottom: 25px;
    z-index: 50;
    transform: translateX(-50%);
}

.sticky-action .btn {
    min-width: 270px;
    min-height: 52px;
    box-shadow: 0 12px 28px rgba(220, 31, 38, 0.27);
}

/* =====================================
   RESPONSIVE
===================================== */

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .span-2 {
        grid-column: 1 / -1;
    }

    .content-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 620px) {
    .dashboard-grid,
    .content-grid,
    .form-grid.two-col {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }

    .container {
        width: 92vw;
        margin-top: 28px;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-head h1 {
        font-size: 38px;
    }

    .topbar {
        min-height: 72px;
        padding: 0 4vw;
    }

    .topbar span {
        display: none;
    }

    .topbar-brand img,
    .brand-logo img,
    .header-logo {
        width: 85px;
        max-width: 85px;
        height: 45px;
    }

    .auth-card {
        padding: 31px 25px;
    }

    .auth-card h1 {
        font-size: 35px;
    }

    .preview {
        height: 220px;
    }

    .sticky-action {
        width: calc(100% - 32px);
    }

    .sticky-action .btn {
        width: 100%;
        min-width: 0;
    }
}

/* =====================================
   INTERACTIVE BUTTON MANAGER
===================================== */

.interactive-panel {
    margin-top: 28px;
}

.interactive-heading {
    align-items: flex-start;
    margin-bottom: 25px;
}

.interactive-heading h2 {
    margin-bottom: 7px;
}

.interactive-layout {
    display: grid;
    grid-template-columns:
        minmax(280px, 0.8fr)
        minmax(450px, 1.4fr);
    gap: 25px;
    align-items: start;
}

.button-create-form {
    padding: 23px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fafaf8;
}

.button-create-form h3,
.button-manager h3 {
    margin: 0 0 19px;
    color: var(--black);
    font-size: 21px;
    font-weight: 650;
}

.button-manager {
    display: grid;
    gap: 16px;
}

.button-editor {
    display: grid;
    gap: 14px;
    padding: 19px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
}

.button-editor-form {
    display: grid;
    grid-template-columns:
        minmax(150px, 1fr)
        minmax(190px, 1.2fr)
        minmax(150px, 0.85fr)
        auto;
    gap: 13px;
    align-items: end;
}

.button-editor-form .btn {
    min-width: 135px;
}

.button-empty {
    padding: 32px;
    border: 1px dashed #c7c7c2;
    border-radius: 14px;
    color: var(--muted);
    background: #fafaf8;
    text-align: center;
}

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

    .button-editor-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 620px) {
    .interactive-heading {
        flex-direction: column;
    }

    .button-editor-form {
        grid-template-columns: 1fr;
    }

    .button-create-form,
    .button-editor {
        padding: 17px;
    }
}