/* ============================================================
   RESET
============================================================ */

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: #f5f6f4;
    color: #17201e;
    font-family:
        Pretendard,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

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

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

button {
    cursor: pointer;
}

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


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

.admin-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
}

.admin-main {
    min-width: 0;
}

.admin-content {
    width: min(1400px, calc(100% - 84px));
    margin: 0 auto;
    padding: 50px 0 80px;
}


/* ============================================================
   SIDEBAR
============================================================ */

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 32px 22px 24px;
    background: #10201e;
    color: #fff;
}

.admin-sidebar__brand {
    display: block;
    padding: 0 10px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.admin-sidebar__brand strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .18em;
    white-space: nowrap;
}

.admin-sidebar__brand span {
    display: block;
    margin-top: 6px;
    color: rgba(255, 255, 255, .48);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .24em;
}


/* ============================================================
   SIDEBAR NAV
============================================================ */

.admin-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 30px;
}

.admin-nav-label {
    margin: 0 10px 10px;
    color: rgba(255, 255, 255, .35);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .15em;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 9px;
    color: rgba(255, 255, 255, .67);
    font-size: 13px;
    font-weight: 500;
    transition:
        background .2s,
        color .2s;
}

.admin-nav-item:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.admin-nav-item.active {
    background: #fff;
    color: #10201e;
    font-weight: 700;
}

.admin-nav-icon {
    width: 21px;
    flex: none;
    text-align: center;
    font-size: 17px;
}


/* ============================================================
   SIDEBAR BOTTOM
============================================================ */

.admin-sidebar__bottom {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
}

.admin-user__avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    font-size: 12px;
    font-weight: 700;
}

.admin-user__info {
    min-width: 0;
    flex: 1;
}

.admin-user__name {
    display: block;
    overflow: hidden;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user__role {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, .4);
    font-size: 10px;
}

.admin-logout {
    display: block;
    margin-top: 8px;
    padding: 10px;
    border-radius: 7px;
    color: rgba(255, 255, 255, .5);
    text-align: center;
    font-size: 11px;
}

.admin-logout:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}


/* ============================================================
   TOPBAR
============================================================ */

.admin-topbar {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 42px;
    border-bottom: 1px solid #e5e7e4;
    background: rgba(255, 255, 255, .85);
}

.admin-topbar__title {
    font-size: 14px;
    font-weight: 700;
}

.admin-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-outline-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 15px;
    border: 1px solid #dfe2df;
    border-radius: 7px;
    background: #fff;
    color: #56605d;
    font-size: 11px;
    font-weight: 600;
}

.admin-outline-button:hover {
    border-color: #10201e;
    color: #10201e;
}


/* ============================================================
   PAGE HEADER
============================================================ */

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

.admin-eyebrow {
    display: block;
    margin-bottom: 9px;
    color: #a86d4d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .2em;
}

.admin-page-title {
    margin: 0;
    font-size: clamp(27px, 2.5vw, 36px);
    line-height: 1.25;
    letter-spacing: -.045em;
}

.admin-page-description {
    margin: 10px 0 0;
    color: #7c8582;
    font-size: 13px;
    line-height: 1.6;
}


/* ============================================================
   BUTTON
============================================================ */

.admin-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 8px;
    background: #10201e;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.admin-primary-button:hover {
    opacity: .9;
}

.admin-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid #dfe2df;
    border-radius: 8px;
    background: #fff;
    color: #56605d;
    font-size: 12px;
    font-weight: 700;
}


/* ============================================================
   PANEL
============================================================ */

.admin-panel {
    overflow: hidden;
    border: 1px solid #e4e6e3;
    border-radius: 12px;
    background: #fff;
}

.admin-panel__head {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 25px;
    border-bottom: 1px solid #eceeeb;
}

.admin-panel__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}


/* ============================================================
   FORM
============================================================ */

.admin-form {
    padding: 35px;
}

.admin-form-group {
    margin-bottom: 28px;
}

.admin-form-label {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
}

.admin-required {
    color: #c85e5e;
}

.admin-form-control {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #dfe2df;
    border-radius: 7px;
    background: #fff;
    color: #17201e;
    outline: none;
    font-size: 13px;
}

.admin-form-control:focus {
    border-color: #10201e;
}

.admin-form-help {
    margin: 8px 0 0;
    color: #929896;
    font-size: 11px;
    line-height: 1.5;
}

.admin-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.admin-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 35px;
    padding-top: 28px;
    border-top: 1px solid #eceeeb;
}


/* ============================================================
   IMAGE
============================================================ */

.admin-current-image {
    margin-bottom: 15px;
}

.admin-current-image img,
.admin-image-preview img {
    width: 100%;
    max-height: 450px;
    object-fit: contain;
    border-radius: 8px;
    background: #f5f6f4;
}

.admin-image-input {
    width: 100%;
    padding: 14px;
    border: 1px dashed #ccd1ce;
    border-radius: 7px;
    background: #fafbfa;
}

.admin-image-preview {
    display: none;
    margin-top: 15px;
}


/* ============================================================
   CHECKBOX
============================================================ */

.admin-checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    cursor: pointer;
    font-size: 13px;
}

.admin-checkbox input {
    width: 17px;
    height: 17px;
}


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

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 950px;
    border-collapse: collapse;
}

.admin-table th {
    padding: 14px 18px;
    border-bottom: 1px solid #e7e9e6;
    background: #fafbfa;
    color: #8b9290;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.admin-table td {
    padding: 15px 18px;
    border-bottom: 1px solid #eff0ee;
    font-size: 12px;
    vertical-align: middle;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-table tbody tr:hover {
    background: #fafbfa;
}

.admin-table-thumb {
    width: 80px;
    height: 54px;
    overflow: hidden;
    border-radius: 6px;
    background: #eef0ee;
}

.admin-table-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-table-title {
    font-weight: 700;
}

.admin-table-tags {
    max-width: 200px;
    overflow: hidden;
    color: #858d8a;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ============================================================
   BADGE
============================================================ */

.admin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 25px;
    padding: 0 9px;
    border-radius: 50px;
    font-size: 9px;
    font-weight: 700;
}

.admin-badge--visible {
    background: #e8f5ed;
    color: #348057;
}

.admin-badge--hidden {
    background: #f0f1f0;
    color: #7e8582;
}


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

.admin-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-actions form {
    margin: 0;
}

.admin-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 31px;
    padding: 0 11px;
    border: 1px solid #dfe2df;
    border-radius: 6px;
    background: #fff;
    color: #626a68;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
}

.admin-action-button:hover {
    border-color: #10201e;
    color: #10201e;
}

.admin-action-button--delete {
    color: #b25757;
}

.admin-action-button--delete:hover {
    border-color: #b25757;
    color: #b25757;
}


/* ============================================================
   EMPTY
============================================================ */

.admin-empty {
    padding: 80px 20px;
    color: #969d9a;
    text-align: center;
    font-size: 12px;
}


/* ============================================================
   MOBILE
============================================================ */

.admin-mobile-header {
    display: none;
}


@media (max-width: 1100px) {

    .admin-layout {
        grid-template-columns: 210px minmax(0, 1fr);
    }

    .admin-sidebar {
        padding-right: 16px;
        padding-left: 16px;
    }

    .admin-content {
        width: calc(100% - 50px);
    }

}


@media (max-width: 767px) {

    .admin-layout {
        display: block;
    }

    .admin-sidebar {
        display: none;
    }

    .admin-mobile-header {
        position: sticky;
        top: 0;
        z-index: 50;
        height: 62px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        background: #10201e;
        color: #fff;
    }

    .admin-mobile-header__brand {
        font-size: 13px;
        font-weight: 700;
        letter-spacing: .15em;
    }

    .admin-mobile-header__menu {
        display: flex;
        align-items: center;
        gap: 13px;
    }

    .admin-mobile-header__menu a {
        color: rgba(255, 255, 255, .7);
        font-size: 9px;
    }

    .admin-topbar {
        display: none;
    }

    .admin-content {
        width: calc(100% - 36px);
        padding: 35px 0 60px;
    }

    .admin-page-head {
        align-items: stretch;
        flex-direction: column;
        gap: 20px;
    }

    .admin-primary-button {
        width: 100%;
    }

    .admin-form {
        padding: 25px 20px;
    }

    .admin-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .admin-form-actions {
        flex-direction: column-reverse;
    }

    .admin-form-actions > * {
        width: 100%;
    }

}