* {
    box-sizing: border-box;
}

:root {
    --black: #111;
    --white: #fff;
    --background: #f8f8f8;
    --muted: #777;
    --border: #e5e5e5;
    --radius: 14px;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--black);
    font-family: Arial, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input, textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.muted {
    color: var(--muted);
}

.small-text {
    font-size: 12px;
}

.logo {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    background: var(--black);
    color: white;
    border-radius: 12px;
    font-size: 24px;
    font-weight: 800;
}

.logo-small {
    width: 35px;
    height: 35px;
    border-radius: 9px;
    font-size: 18px;
}

/* BUTTON */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    transition: background .2s, transform .2s;
}

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

.btn:active {
    transform: scale(.98);
}

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

.btn-black:hover {
    background: #333;
}

.btn-outline {
    color: var(--black);
    background: white;
    border-color: #dcdcdc;
}

.btn-outline:hover {
    background: #f3f3f3;
}

.btn-small {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 12px;
}

.full-width {
    width: 100%;
}

/* LOGIN */

.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 20px;
    background: #f7f7f7;
}

.login-card {
    width: 100%;
    max-width: 390px;
    padding: 34px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    animation: fadeUp .3s ease;
}

.login-card h1 {
    margin: 24px 0 8px;
    font-size: 30px;
    letter-spacing: -1px;
}

.login-card > .muted {
    margin: 0 0 26px;
    font-size: 13px;
    line-height: 1.6;
}

label {
    display: block;
    margin: 16px 0 8px;
    font-size: 13px;
    font-weight: 700;
}

input, textarea {
    display: block;
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #dedede;
    border-radius: 9px;
    outline: none;
    color: var(--black);
    background: white;
    transition: border-color .2s;
}

input:focus, textarea:focus {
    border-color: #555;
}

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

.demo-info {
    margin-top: 23px;
    padding-top: 17px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.error-message {
    min-height: 15px;
    margin: 8px 0 0;
    color: #b42318;
    font-size: 12px;
}

/* NAVBAR */

.navbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-height: 68px;
    padding: 12px 5%;
    background: white;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--black);
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.welcome-user {
    margin-right: 6px;
    color: #666;
    font-size: 12px;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    font-size: 19px;
}

.icon-btn:hover {
    background: #f3f3f3;
}

/* CONTENT */

.container {
    width: min(1160px, 100%);
    margin: 0 auto;
    padding: 45px 25px 25px;
}

.heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 9px;
    color: #888;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.8px;
}

.heading h1 {
    margin: 0;
    font-size: 36px;
    letter-spacing: -1.4px;
}

.heading .muted {
    margin: 9px 0 0;
    font-size: 13px;
}

.counter {
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.counter b {
    color: var(--black);
    font-size: 15px;
}

/* MENU GRID */

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

.menu-card {
    overflow: hidden;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    transition: transform .2s, border-color .2s;
    animation: fadeUp .3s ease;
}

.menu-card:hover {
    transform: translateY(-3px);
    border-color: #c8c8c8;
}

.menu-image,
.menu-image-placeholder {
    display: block;
    width: 100%;
    height: 185px;
    object-fit: cover;
    background: #eee;
}

.menu-image-placeholder {
    display: grid;
    place-items: center;
    color: #888;
    font-size: 12px;
}

.menu-card-content {
    padding: 18px;
}

.menu-card-content h3 {
    margin: 0 0 9px;
    font-size: 17px;
    overflow-wrap: anywhere;
}

.menu-card-content p {
    min-height: 38px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.menu-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 17px;
    padding-top: 13px;
    border-top: 1px solid #eee;
}

.menu-open-link {
    color: var(--black);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.menu-open-link:hover {
    text-decoration: underline;
}

.menu-actions, .user-row-actions {
    display: flex;
    gap: 5px;
}

.mini-btn {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    font-size: 14px;
}

.mini-btn:hover {
    background: #f1f1f1;
}

.mini-btn.delete:hover {
    color: #b42318;
    background: #fff2f0;
    border-color: #efc6c2;
}

/* ADD MENU CARD */

.add-menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 345px;
    padding: 20px;
    border: 2px dashed #c9c9c9;
    border-radius: var(--radius);
    background: transparent;
    color: var(--black);
    text-align: center;
    transition: background .2s, border-color .2s;
}

.add-menu-card:hover {
    border-color: var(--black);
    background: white;
}

.add-menu-icon {
    display: grid;
    place-items: center;
    width: 55px;
    height: 55px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: white;
    font-size: 29px;
}

.add-menu-card strong {
    font-size: 15px;
}

.add-menu-card > span:last-child {
    margin-top: 8px;
    color: var(--muted);
    font-size: 11px;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 35px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    color: var(--muted);
    text-align: center;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: #999;
    font-size: 11px;
}

/* MODALS */

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal-front {
    z-index: 120;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    animation: fadeIn .2s ease;
}

.modal-card {
    position: relative;
    z-index: 1;
    overflow-y: auto;
    width: min(470px, 100%);
    max-height: calc(100dvh - 40px);
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: white;
    animation: modalUp .22s ease;
}

.modal-wide {
    width: min(620px, 100%);
}

.modal-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.modal-heading h2,
.confirm-card h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -.5px;
}

.modal-heading .eyebrow {
    margin-bottom: 7px;
}

.modal-heading .muted {
    margin: 7px 0 0;
    font-size: 12px;
    line-height: 1.6;
}

.close-btn {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    font-size: 23px;
}

.close-btn:hover {
    background: #f2f2f2;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 24px;
}

/* UPLOAD IMAGE */

.upload-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 155px;
    margin-top: 9px;
    padding: 20px;
    border: 2px dashed #ccc;
    border-radius: 12px;
    background: #fafafa;
    cursor: pointer;
    text-align: center;
    transition: background .2s, border-color .2s;
}

.upload-box:hover {
    border-color: #333;
    background: #f4f4f4;
}

.upload-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    font-size: 23px;
    font-weight: 400;
}

.upload-box strong {
    font-size: 13px;
}

.upload-box > span:nth-child(3) {
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
}

.upload-action {
    margin-top: 3px;
    padding: 8px 13px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 11px;
    font-weight: 700;
}

.preview-container {
    overflow: hidden;
    margin-top: 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: white;
}

.preview-container img {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    background: #f4f4f4;
}

.preview-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
}

.preview-info > div {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.preview-info strong {
    overflow-wrap: anywhere;
    font-size: 12px;
}

.preview-info span {
    color: var(--muted);
    font-size: 10px;
}

.remove-image-btn {
    flex: 0 0 auto;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: white;
    color: #b42318;
    font-size: 11px;
}

.remove-image-btn:hover {
    background: #fff2f0;
}

/* USER MANAGEMENT */

.user-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
}

.user-toolbar .muted {
    font-size: 12px;
}

.user-list {
    display: grid;
    gap: 9px;
}

.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.user-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 39px;
    height: 39px;
    border-radius: 10px;
    background: var(--black);
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.user-info-text {
    min-width: 0;
}

.user-info-text strong,
.user-info-text span {
    display: block;
    overflow-wrap: anywhere;
}

.user-info-text strong {
    font-size: 12px;
}

.user-info-text span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

.user-empty {
    padding: 25px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

/* CONFIRMATION */

.confirm-card {
    width: min(380px, 100%);
    text-align: center;
}

.confirm-symbol {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    margin: 0 auto 17px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f7f7f7;
    font-size: 21px;
    font-weight: 800;
}

.confirm-card p {
    margin: 12px 0;
    font-size: 12px;
    line-height: 1.7;
}

.confirm-card .modal-actions {
    justify-content: center;
}

.confirm-card .btn {
    flex: 1;
}

/* TOAST */

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 300;
    max-width: calc(100vw - 40px);
    padding: 13px 17px;
    border: 1px solid #333;
    border-radius: 9px;
    background: var(--black);
    color: white;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .2s, transform .2s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ANIMATION */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE */

@media (max-width: 900px) {
    .menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .login-card {
        padding: 26px 22px;
    }

    .navbar {
        padding: 11px 15px;
    }

    .brand {
        gap: 8px;
        font-size: 13px;
    }

    .nav-actions {
        gap: 6px;
    }

    .welcome-user {
        display: none;
    }

    .container {
        padding: 30px 15px 20px;
    }

    .heading {
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 22px;
    }

    .heading h1 {
        font-size: 30px;
    }

    .heading .muted {
        max-width: 220px;
        font-size: 12px;
        line-height: 1.6;
    }

    .counter {
        padding: 9px;
        font-size: 10px;
    }

    .menu-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .menu-image,
    .menu-image-placeholder {
        height: 175px;
    }

    .add-menu-card {
        min-height: 185px;
    }

    .footer {
        margin-top: 35px;
        font-size: 9px;
    }

    .modal {
        align-items: end;
        padding: 10px;
    }

    .modal-card {
        width: 100%;
        max-height: calc(100dvh - 20px);
        padding: 21px 17px;
        border-radius: 16px;
    }

    .modal-heading h2 {
        font-size: 20px;
    }

    .user-row {
        align-items: flex-start;
        padding: 10px;
    }

    .user-row-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .user-toolbar .btn {
        font-size: 10px;
        padding: 8px;
    }

    .preview-info {
        align-items: flex-start;
        flex-direction: column;
    }

    .modal-actions .btn {
        padding: 10px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}


/* CUSTOM URL / SLUG */

.slug-input {
    display: flex;
    align-items: center;
    border: 1px solid #dedede;
    border-radius: 9px;
    background: #fff;
    overflow: hidden;
}

.slug-input:focus-within {
    border-color: #555;
}

.slug-prefix {
    display: grid;
    place-items: center;
    align-self: stretch;
    padding: 0 13px;
    border-right: 1px solid #e5e5e5;
    background: #f7f7f7;
    color: #777;
    font-size: 14px;
}

.slug-input input {
    min-width: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
}

.field-hint {
    margin: 8px 0 0;
    color: #777;
    font-size: 11px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.field-hint strong {
    color: #111;
    font-weight: 700;
}

.html-upload-box {
    margin-top: 9px;
    background: #fafafa;
}

.html-upload-box:hover {
    background: #f3f3f3;
}

.html-icon {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .5px;
}

.html-file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 13px;
    border: 1px solid #e5e5e5;
    border-radius: 11px;
    background: #fff;
}

.html-file-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 1px solid #e5e5e5;
    border-radius: 9px;
    background: #f7f7f7;
    font-size: 10px;
    font-weight: 800;
}

.html-file-details {
    display: grid;
    flex: 1;
    gap: 5px;
    min-width: 0;
}

.html-file-details strong {
    overflow-wrap: anywhere;
    font-size: 12px;
}

.html-file-details span {
    color: #777;
    font-size: 10px;
}

.html-note {
    margin-top: 12px;
    padding: 11px 12px;
    border-left: 2px solid #111;
    background: #f7f7f7;
}

@media (max-width: 600px) {
    .slug-prefix {
        padding: 0 11px;
    }

    .html-file-info {
        gap: 9px;
        padding: 10px;
    }

    .html-file-details strong {
        font-size: 11px;
    }

    .html-file-info .remove-image-btn {
        padding: 7px;
    }
}
/* Tambahan untuk editor permission; desain utama tetap dipertahankan */
.permission-editor{margin-top:22px;padding-top:20px;border-top:1px solid var(--border)}
.permission-editor-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.permission-editor-heading h3{margin:0 0 8px;font-size:18px}
.permission-page-group{border:1px solid var(--border);border-radius:10px;padding:14px;margin:12px 0;background:#fff}
.permission-page-title{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}
.permission-page-title strong{font-size:13px}
.permission-page-title span{font-size:11px;color:var(--muted)}
.permission-checkboxes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.permission-checkbox{display:flex;align-items:center;gap:7px;margin:0;font-size:12px;font-weight:500}
.permission-checkbox input{width:15px;height:15px;margin:0;accent-color:#111}
.user-row-actions{display:flex;gap:6px;align-items:center}
.user-permission-btn{min-width:32px;min-height:32px;border:1px solid var(--border);border-radius:8px;background:#fff}
@media(max-width:600px){.permission-checkboxes{grid-template-columns:repeat(2,minmax(0,1fr))}.permission-page-title{align-items:flex-start;flex-direction:column}}
