/* Kitten Cake CMS - Modern Admin Styling */
:root {
    --primary: #ff6b81;
    --primary-hover: #ff4757;
    --primary-light: #fff0f3;
    --secondary: #ffa502;
    --accent: #2ed573;
    --danger: #ff4757;
    --warning: #eccc68;
    --dark: #2f3542;
    --gray-bg: #f8f9fa;
    --gray-border: #e9ecef;
    --text-muted: #747d8c;
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 14px 35px rgba(255, 107, 129, 0.15);
}

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

body {
    font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--gray-bg);
    color: var(--dark);
    display: flex;
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.5;
}

/* Sidebar */
.cms-sidebar {
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--gray-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--gray-border);
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.brand-text h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

.brand-text span {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
}

.sidebar-menu {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    list-style: none;
}

.menu-category-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #a4b0be;
    letter-spacing: 0.5px;
    padding: 12px 14px 6px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    color: #57606f;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
    position: relative;
}

.sidebar-menu li a i {
    font-size: 17px;
    width: 22px;
    text-align: center;
    color: #8395a7;
    transition: color 0.2s ease;
}

.sidebar-menu li a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-menu li a:hover i {
    color: var(--primary);
}

.sidebar-menu li a.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.3);
}

.sidebar-menu li a.active i {
    color: #ffffff;
}

.menu-badge {
    margin-left: auto;
    background: #ff4757;
    color: white;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-meta .name {
    font-size: 13px;
    font-weight: 700;
}

.user-meta .role {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-icon-logout {
    background: none;
    border: none;
    color: #a4b0be;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
    padding: 6px;
    border-radius: 8px;
}

.btn-icon-logout:hover {
    color: var(--danger);
    background: #ffe3e3;
}

/* Main Area */
.cms-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.cms-header {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--gray-border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--dark);
}

.page-title h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.page-title p {
    font-size: 13px;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.25s ease;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 107, 129, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 129, 0.35);
}

.btn-outline {
    background: #ffffff;
    border: 1.5px solid var(--gray-border);
    color: var(--dark);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-success {
    background: #2ed573;
    color: white;
}

.btn-success:hover {
    background: #26af5f;
}

.btn-danger {
    background: #ff4757;
    color: white;
}

.btn-danger:hover {
    background: #e84118;
}

/* Content Container */
.cms-content {
    padding: 30px 32px;
    flex: 1;
}

/* Tab Panels */
.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

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

/* Dashboard Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    border: 1px solid var(--gray-border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: 0.25s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-icon.pink { background: #fff0f3; color: #ff6b81; }
.stat-icon.orange { background: #fff4e6; color: #ffa502; }
.stat-icon.green { background: #e6fcf5; color: #20c997; }
.stat-icon.blue { background: #e7f5ff; color: #339af0; }

/* Panels & Cards */
.cms-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 26px;
    overflow: hidden;
}

.cms-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cms-card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.cms-card-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.cms-card-body {
    padding: 24px;
}

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

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

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    font-size: 13px;
    font-weight: 700;
    color: #2f3542;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-group label .helper {
    font-size: 11px;
    font-weight: 500;
    color: #a4b0be;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--gray-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    background: #fafafa;
    color: var(--dark);
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 107, 129, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

/* Image Upload Component */
.image-uploader-box {
    display: flex;
    gap: 20px;
    align-items: center;
    background: #fafbfc;
    border: 2px dashed #dfe4ea;
    border-radius: var(--radius-md);
    padding: 16px;
    position: relative;
    transition: 0.2s;
}

.image-uploader-box:hover {
    border-color: var(--primary);
    background: #fffafa;
}

.img-preview-wrap {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #f1f2f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--gray-border);
}

.img-preview-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uploader-controls {
    flex: 1;
}

.uploader-controls .btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #ffffff;
    border: 1px solid #ced6e0;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.uploader-controls .btn-upload:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.uploader-controls input[type="file"] {
    display: none;
}

.uploader-hint {
    font-size: 12px;
    color: #a4b0be;
    margin-top: 6px;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ced6e0;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.cms-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.cms-table th {
    background: #fafbfc;
    padding: 13px 18px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-border);
}

.cms-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-border);
    font-size: 14px;
    vertical-align: middle;
}

.cms-table tr:hover {
    background: #fafbfc;
}

.item-thumb-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--gray-border);
}

.item-title-text h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 2px;
}

.item-title-text span {
    font-size: 12px;
    color: var(--text-muted);
}

.price-tag {
    font-weight: 700;
    color: var(--primary);
    font-size: 15px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.badge-active { background: #e6fcf5; color: #0ca678; }
.badge-inactive { background: #f1f3f5; color: #868e96; }
.badge-hot { background: #ffe3e3; color: #e03131; }

.action-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--gray-border);
    background: white;
    color: #57606f;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
}

.btn-action:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-action.delete:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: #ffe3e3;
}

/* Gallery Grid */
.gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.gallery-card {
    background: white;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: 0.2s;
}

.gallery-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.gallery-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.gallery-card-info {
    padding: 12px;
}

.gallery-card-info input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--gray-border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
}

.gallery-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 71, 87, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.gallery-delete-btn:hover {
    background: #ff4757;
    transform: scale(1.1);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #a4b0be;
    cursor: pointer;
    transition: 0.2s;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: #2f3542;
    color: white;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: toastSlide 0.3s ease, toastFadeOut 0.3s ease 3.7s forwards;
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

@keyframes toastSlide {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastFadeOut {
    to { opacity: 0; transform: translateY(10px); }
}

/* Responsive */
@media (max-width: 992px) {
    .cms-sidebar {
        transform: translateX(-100%);
    }
    .cms-sidebar.open {
        transform: translateX(0);
    }
    .cms-main {
        margin-left: 0;
    }
    .mobile-toggle {
        display: block;
    }
    .form-grid, .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Flavor & Variant Image Manager in Menu Modal */
.flavor-manager-card {
    background: #fff8f9;
    border: 1.5px solid #ffd1d8;
    border-radius: 14px;
    padding: 16px 18px;
    margin-top: 6px;
    margin-bottom: 6px;
}
.flavor-row-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #ffd8e0;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(255, 107, 129, 0.05);
    transition: all 0.2s ease;
}
.flavor-row-item:hover {
    border-color: #ff6b81;
    box-shadow: 0 4px 12px rgba(255, 107, 129, 0.12);
}
.flavor-row-thumb-wrap {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}
.flavor-row-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    border: 1.5px solid #ffccd5;
    background: #fff;
    display: block;
}
.flavor-thumb-upload-btn {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ff4757;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    border: 1.5px solid #fff;
    transition: transform 0.2s;
}
.flavor-thumb-upload-btn:hover {
    transform: scale(1.15);
    background: #e84118;
}
.flavor-field-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.flavor-field-group label {
    font-size: 11px;
    font-weight: 700;
    color: #747d8c;
    margin: 0;
}
.flavor-name-input {
    font-weight: 700 !important;
    color: #2f3542 !important;
}
.flavor-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.menu-quick-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.quick-thumb-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #ffd1d8;
    border-radius: 8px;
    padding: 3px 8px 3px 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #57606f;
    transition: all 0.2s ease;
}
.quick-thumb-chip:hover {
    border-color: #ff4757;
    color: #ff4757;
    background: #fff0f3;
}
.quick-thumb-chip img {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: cover;
}
.admin-flavor-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff0f3;
    border: 1px solid #ffd1d8;
    border-radius: 12px;
    padding: 2px 8px 2px 3px;
    font-size: 11px;
    font-weight: 600;
    color: #ff4757;
}
.admin-flavor-chip img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

