:root {
    --color-main: #111111;
    --gradient-primary: linear-gradient(135deg, #1f1f1f 0%, #000000 100%);
    --gradient-accent: linear-gradient(135deg, #4b5563 0%, #111827 100%);
    --gradient-soft: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(241, 245, 249, 0.9));
    --sidebar-bg: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
    --page-bg: radial-gradient(circle at top, rgba(17, 17, 17, 0.1), transparent 55%),
               radial-gradient(circle at 20% 80%, rgba(17, 17, 17, 0.06), transparent 55%),
               #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(226, 232, 240, 0.7);
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --surface: #ffffff;
    --surface-light: #f8fafc;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --shadow-soft: 0 14px 32px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 18px 44px rgba(17, 17, 17, 0.18);
    --transition: all 0.18s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
}

body {
    font-family: 'Inter', 'Poppins', 'Segoe UI', sans-serif;
    background: var(--page-bg);
    color: var(--text-primary);
    display: flex;
}

a {
    color: inherit;
}

.layout {
    width: 100%;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    color: var(--text-primary);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(148, 163, 184, 0.25);
    position: sticky;
    top: 0;
    height: 100vh;
    gap: 18px;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.sidebar .brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    padding: 4px;
    box-shadow: var(--shadow-soft);
    background: #ffffff;
}

.sidebar .brand-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 18px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link .icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: rgba(17, 17, 17, 0.06);
    display: grid;
    place-items: center;
    font-size: 13px;
}

.nav-link .icon i {
    color: var(--text-secondary);
}

.sidebar .brand-icon img,
.nav-link .icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-main);
    background: rgba(17, 17, 17, 0.1);
}

.sidebar .logout-btn .nav-link {
    background: rgba(248, 113, 113, 0.15);
    color: #b91c1c;
}

.sidebar .logout-btn .nav-link:hover {
    background: rgba(248, 113, 113, 0.25);
    color: #7f1d1d;
}

.main-content {
    flex: 1;
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.page-header-actions {
    margin-top: 12px;
}

@media (min-width: 768px) {
    .page-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .page-header-actions {
        margin-top: 0;
    }
}

.page-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 14px;
    max-width: 560px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
    align-items: stretch;
}

.stat-card {
    padding: 18px;
    border-radius: var(--border-radius-lg);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-card h3,
.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.stat-card .value,
.stat-metric {
    font-size: 22px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: var(--text-primary);
    word-break: break-word;
    max-width: 100%;
}

.panel {
    background: var(--glass-bg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.panel-header h2,
.panel-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 600;
}

.panel-header p {
    color: var(--text-muted);
    font-size: 13px;
}

.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-secondary);
    font-size: 13px;
}

.table thead {
    background: rgba(226, 232, 240, 0.6);
}

.table th,
.table td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    text-align: left;
}

.table tbody tr:hover {
    background: rgba(241, 245, 249, 0.6);
}

.table-product {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-product-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    background: rgba(226, 232, 240, 0.6);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.table-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.table-product-thumb.placeholder {
    color: rgba(100, 116, 139, 0.8);
    font-size: 18px;
}

.table-product-title {
    font-weight: 600;
    color: var(--text-primary);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge.success { background: rgba(34, 197, 94, 0.15); color: #15803d; }
.badge.warning { background: rgba(250, 204, 21, 0.18); color: #a16207; }
.badge.danger { background: rgba(248, 113, 113, 0.18); color: #b91c1c; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    color: var(--text-secondary);
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff !important;
    box-shadow: 0 10px 20px rgba(17, 17, 17, 0.22);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(17, 17, 17, 0.3);
}

.btn-outline {
    background: #fff;
    color: var(--text-secondary);
    border: 1px solid rgba(17, 17, 17, 0.25);
}

.btn-outline:hover {
    background: rgba(17, 17, 17, 0.06);
    color: var(--color-main);
}

.btn-danger {
    background: var(--gradient-accent);
    color: #fff !important;
    box-shadow: 0 10px 20px rgba(249, 115, 22, 0.22);
}

.form-grid {
    display: grid;
    gap: 14px;
}

.address-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: var(--border-radius-md);
    background: var(--surface-light);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.address-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.address-label {
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.address-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    gap: 14px;
}

.form-row.two {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
}

.checkbox-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-secondary);
    font-weight: 500;
}

.checkbox-field input[type="checkbox"] {
    width: auto;
}

.help-text {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(203, 213, 225, 0.9);
    background: #fff;
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 13px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(17, 17, 17, 0.55);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.12);
}

textarea {
    min-height: 100px;
}

.alert {
    padding: 12px 14px;
    border-radius: var(--border-radius-md);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.alert-success {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.25);
    color: #166534;
}

.alert-error {
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.25);
    color: #b91c1c;
}

.alert-info {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
    color: #1d4ed8;
}

/* Ratings & reviews */
.product-rating-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.rating-stars {
    display: inline-flex;
    gap: 4px;
}

.rating-stars img {
    width: 20px;
    height: 20px;
    display: block;
}

.product-rating-summary .rating-stars img {
    width: 18px;
    height: 18px;
}

.rating-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    color: #475569;
}

.rating-details .rating-score {
    font-weight: 600;
    font-size: 16px;
    color: #0f172a;
}

.rating-details .out-of {
    font-size: 12px;
    margin-left: 2px;
    color: #64748b;
}

.rating-count {
    font-size: 12px;
    color: #64748b;
}

.panel-reviews {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-summary {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid rgba(203, 213, 225, 0.6);
    border-radius: var(--border-radius-md);
    background: rgba(241, 245, 249, 0.5);
    flex-wrap: wrap;
}

.review-summary .rating-stars img {
    width: 22px;
    height: 22px;
}

.review-summary-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
}

.review-summary-meta strong {
    font-size: 24px;
    line-height: 1.1;
    color: #0f172a;
}

.review-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border: 1px solid rgba(203, 213, 225, 0.6);
    border-radius: var(--border-radius-md);
    background: rgba(248, 250, 252, 0.65);
}

.review-form-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.review-form-row .picker-label {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
}

.rating-picker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.rating-picker-btn {
    background: transparent;
    border: none;
    padding: 6px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.rating-picker-btn img {
    width: 28px;
    height: 28px;
    display: block;
    object-fit: contain;
    pointer-events: none;
}

.rating-picker-btn:hover,
.rating-picker-btn:focus-visible {
    transform: translateY(-2px) scale(1.06);
    background: rgba(59, 130, 246, 0.12);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.rating-picker-btn.selected {
    background: rgba(59, 130, 246, 0.16);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.18);
}

.rating-picker-btn.selected img {
    filter: drop-shadow(0 4px 10px rgba(37, 99, 235, 0.45));
}

.review-comment-label {
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
}

.review-form textarea {
    width: 100%;
}

.review-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.review-form-error {
    color: #b91c1c;
    font-size: 13px;
    min-height: 18px;
}

.review-hint {
    font-size: 13px;
    color: #475569;
}

.review-hint a {
    color: #1d4ed8;
    text-decoration: underline;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-item {
    border: 1px solid rgba(203, 213, 225, 0.6);
    border-radius: var(--border-radius-md);
    padding: 18px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.review-author {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #0f172a;
}

.review-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
}

.review-meta time {
    font-size: 12px;
    color: #64748b;
    letter-spacing: 0.01em;
}

.review-body {
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
}

.empty-state.small {
    padding: 18px;
    font-size: 14px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.product-card .rating-stars img {
    width: 16px;
    height: 16px;
}

.product-rating-value {
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
}

.product-rating-count {
    font-size: 12px;
    color: #64748b;
}
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.inline-form input[type="text"],
.inline-form select {
    width: auto;
    min-width: 100px;
    font-size: 12px;
}

.inline-form button {
    padding: 7px 12px;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.product-card {
    padding: 18px;
    border-radius: var(--border-radius-lg);
    background: var(--surface);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.product-card h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
}

.product-card .price-tag {
    font-size: 20px;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    color: transparent;
}

.product-card .product-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--surface-light);
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(226, 232, 240, 0.7);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card .product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-size: 13px;
}

.product-card .card-description {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
    flex: 1;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.card-actions form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.card-actions input[type="number"],
.product-card input[type="number"] {
    max-width: 70px;
    text-align: center;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 12px;
}

.table td .btn,
.table td .inline-form button {
    font-size: 12px;
}

footer.app-footer {
    margin-top: auto;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding-top: 30px;
}

.auth-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: var(--page-bg);
}

.auth-card {
    width: min(360px, 100%);
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 18px;
}

.auth-card h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 600;
}

.auth-card p {
    color: var(--text-muted);
    font-size: 13px;
}

.auth-card button {
    width: 100%;
}

.empty-state {
    padding: 28px;
    text-align: center;
    color: var(--text-muted);
    border-radius: var(--border-radius-lg);
    border: 1px dashed rgba(148, 163, 184, 0.4);
    background: rgba(248, 250, 252, 0.9);
    font-size: 13px;
}

.order-summary {
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    padding: 18px;
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.order-summary h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    margin-bottom: 12px;
}

.order-summary ul {
    list-style: none;
    display: grid;
    gap: 10px;
}

.order-summary li {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
}

.order-summary li strong {
    color: var(--text-primary);
}

.order-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.order-item-thumb {
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    background: rgba(226, 232, 240, 0.6);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.order-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-item-thumb.placeholder {
    color: rgba(100, 116, 139, 0.8);
    font-size: 16px;
}

.order-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-item-title {
    font-weight: 600;
    color: var(--text-primary);
}

.order-item-qty {
    font-size: 12px;
    color: var(--text-muted);
}

.order-summary-total {
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    padding-top: 12px;
    margin-top: 6px;
}

.order-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.order-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.order-card-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    margin-bottom: 4px;
}

.order-card-header p {
    font-size: 12px;
    color: var(--text-muted);
}

.order-status-badge .badge {
    font-size: 12px;
}

.order-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    padding: 14px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(248, 250, 252, 0.75);
}

.order-meta .meta-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.order-meta .meta-value {
    font-weight: 600;
    color: var(--text-primary);
}

.order-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px dashed rgba(148, 163, 184, 0.4);
    border-bottom: 1px dashed rgba(148, 163, 184, 0.4);
}

.progress-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.progress-step .step-icon {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.25);
    color: inherit;
    font-size: 11px;
}

.progress-step.completed {
    background: rgba(34, 197, 94, 0.16);
    color: #166534;
}

.progress-step.completed .step-icon {
    background: rgba(34, 197, 94, 0.22);
}

.progress-step.current {
    background: rgba(59, 130, 246, 0.16);
    color: #1d4ed8;
}

.progress-step.current .step-icon {
    background: rgba(59, 130, 246, 0.22);
}

.progress-step.inactive {
    opacity: 0.55;
}

.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    border-radius: var(--border-radius-md);
    background: rgba(248, 250, 252, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.order-item {
    text-decoration: none;
}

.order-item-pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 11px;
}

.order-item-pricing span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.order-note {
    padding: 12px 14px;
    border-radius: var(--border-radius-md);
    background: rgba(248, 113, 113, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #b91c1c;
    font-size: 12px;
}

.media-carousel {
    position: relative;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: var(--surface);
    padding: 14px;
    overflow: hidden;
}

.media-carousel.large {
    background: transparent;
    border: none;
    padding: 0;
}

.media-carousel-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 4px;
}

.media-carousel-track::-webkit-scrollbar {
    height: 6px;
}

.media-carousel-track::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 999px;
}

.media-item {
    flex: 0 0 200px;
    scroll-snap-align: center;
    position: relative;
}

.media-item.large {
    flex: 0 0 80%;
    max-width: 600px;
}

.media-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-soft);
    background: #fff;
}

.media-item.large img {
    height: 320px;
    object-fit: contain;
    background: #fff;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(17, 17, 17, 0.55);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 20px;
    transition: var(--transition);
}

.carousel-btn[data-direction="-1"] {
    left: 10px;
}
.carousel-btn[data-direction="1"] {
    right: 10px;
}

.media-carousel.large .carousel-btn {
    background: rgba(17, 17, 17, 0.4);
}

.carousel-btn:hover {
    background: rgba(17, 17, 17, 0.75);
}

.media-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.primary-flag {
    position: absolute;
    top: 10px;
    left: 10px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.admin-product .card-actions form {
    width: auto;
}

.status-line {
    display: flex;
    gap: 8px;
    align-items: center;
}

.success-card {
    background: rgba(34, 197, 94, 0.14);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(34, 197, 94, 0.35);
    padding: 24px;
    display: grid;
    gap: 10px;
    font-size: 13px;
}

.success-card a {
    color: #166534;
    text-decoration: underline;
    font-weight: 600;
}

.preformatted {
    padding: 14px;
    background: rgba(248, 250, 252, 0.9);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(226, 232, 240, 0.9);
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

@media (max-width: 1024px) {
    .layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        padding: 16px 18px;
    }
    .sidebar nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    .sidebar .brand {
        margin-bottom: 0;
        margin-right: 18px;
    }
    .main-content {
        padding: 24px 18px 50px;
    }
}

@media (max-width: 640px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
    .panel {
        padding: 18px;
    }
    .sidebar nav {
        width: 100%;
        justify-content: space-between;
    }
    .sidebar .brand-name {
        font-size: 16px;
    }
}


.media-actions form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Stripe top-up panel */
.topup-form {
    display: grid;
    gap: 16px;
    margin-top: 8px;
}

.topup-form .form-group {
    display: grid;
    gap: 8px;
}

.topup-input {
    padding: 12px 14px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    transition: var(--transition);
}

.topup-input::placeholder {
    color: rgba(100, 116, 139, 0.7);
}

.topup-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: #ffffff;
}

.topup-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

#stripe-card-element {
    padding: 12px 14px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.95);
    transition: var(--transition);
}

#stripe-card-element.StripeElement--focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: #ffffff;
}

#stripe-card-element.StripeElement--invalid {
    border-color: #dc2626;
}

#stripe-card-errors {
    min-height: 20px;
}


.add-to-cart-toast {
    background-color: #4CAF50; /* Green background */
    color: white;
    text-align: center;
    border-radius: 5px;
    padding: 10px 20px;
    position: fixed;
    z-index: 1000;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.5s, bottom 0.5s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.add-to-cart-toast.show {
    opacity: 1;
    bottom: 50px;
}
