body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f1ea;
    color: #1f2937;
}

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

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

body.modal-open {
    overflow: hidden;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(13, 148, 136, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(217, 119, 6, 0.15), transparent 24%),
        #f4f1ea;
}

.login-card {
    width: min(100%, 430px);
    padding: 32px;
    border-radius: 24px;
    background: #fffdf8;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

.brand-eyebrow,
.topbar-label {
    margin: 0 0 8px;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #0f766e;
}

.brand-title,
.login-card h1,
.admin-topbar h2,
.panel-card h3 {
    margin: 0;
}

.login-copy {
    color: #6b7280;
    margin: 10px 0 0;
}

.login-form,
.product-form {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.login-form label,
.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
}

.login-form input,
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 1rem;
    background: #ffffff;
}

textarea {
    resize: vertical;
}

.login-form button,
.admin-nav a,
.button-primary,
.button-secondary,
.button-danger,
.button-link,
.button-icon {
    transition: 0.2s ease;
}

.login-form button,
.form-actions button,
.button-primary,
.button-secondary,
.button-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.login-form button,
.form-actions button,
.button-primary {
    color: #ffffff;
    background: linear-gradient(135deg, #0f766e, #115e59);
}

.button-secondary {
    color: #1f2937;
    background: #e5e7eb;
}

.button-danger {
    color: #ffffff;
    background: #b91c1c;
}

.button-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: #0f766e;
    font-weight: 700;
    cursor: pointer;
}

.button-icon {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #e5e7eb;
    color: #1f2937;
    font-weight: 700;
    cursor: pointer;
}

.button-small {
    padding: 10px 12px;
    font-size: 0.85rem;
}

.login-form button:hover,
.form-actions button:hover,
.button-primary:hover,
.button-secondary:hover,
.button-danger:hover,
.button-link:hover,
.button-icon:hover {
    transform: translateY(-1px);
}

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-top: 18px;
    font-size: 0.95rem;
}

.alert p {
    margin: 0;
}

.alert p + p {
    margin-top: 6px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 18px;
    padding: 28px;
    color: #f9fafb;
    background: linear-gradient(180deg, #111827, #1f2937);
}

.admin-nav {
    display: grid;
    gap: 10px;
    margin-top: 0;
}

.admin-nav a {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.admin-content {
    padding: 28px;
}

.admin-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.admin-user {
    min-width: 180px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.admin-user span,
.stat-card strong {
    display: block;
    font-weight: 700;
}

.admin-user small,
.stat-card span,
.empty-state,
.form-group small,
.table-muted,
.detail-label {
    color: #6b7280;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card,
.panel-card,
.detail-card {
    background: #fffdf8;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.stat-card strong {
    margin-top: 12px;
    font-size: 2rem;
}

.panel-card + .panel-card {
    margin-top: 20px;
}

.panel-card-header,
.label-row,
.modal-header,
.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

th {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-active {
    background: #ccfbf1;
    color: #115e59;
}

.status-inactive {
    background: #e5e7eb;
    color: #374151;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-confirmed {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-preparing {
    background: #ede9fe;
    color: #6d28d9;
}

.status-shipping {
    background: #cffafe;
    color: #155e75;
}

.status-delivered {
    background: #dcfce7;
    color: #166534;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-group {
    display: grid;
    gap: 8px;
}

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

.checkbox-group {
    align-items: end;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.checkbox-label input {
    width: auto;
    margin: 0;
}

.form-actions {
    margin-top: 8px;
}

.current-image {
    margin-top: 8px;
}

.current-image p {
    margin: 0 0 10px;
    font-weight: 600;
}

.current-image img,
.table-image {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 16px;
    background: #e5e7eb;
}

.table-image-small {
    width: 72px;
    height: 72px;
}

.table-image-placeholder {
    display: grid;
    place-items: center;
    color: #6b7280;
    font-size: 0.8rem;
}

.store-logo-preview {
    object-fit: contain !important;
    padding: 8px;
    background: #ffffff;
}

.actions-inline,
.inline-detail,
.order-item-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.actions-inline form {
    margin: 0;
}

.products-list-shell {
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.products-table {
    min-width: 940px;
    table-layout: fixed;
}

.products-table-head {
    overflow: hidden;
    border-bottom: 1px solid #e5e7eb;
    background: #fffdf8;
}

.products-table-head th {
    background: #fffdf8;
}

.products-table-body-wrap {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: auto;
}

.products-col-image {
    width: 112px;
}

.products-col-name {
    width: 24%;
}

.products-col-category {
    width: 18%;
}

.products-col-price {
    width: 12%;
}

.products-col-stock {
    width: 10%;
}

.products-col-status {
    width: 14%;
}

.products-col-actions {
    width: 22%;
}

.catalog-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.catalog-header-copy {
    min-width: 0;
}

.catalog-header-search {
    flex: 1 1 320px;
    display: flex;
    justify-content: center;
    min-width: min(100%, 280px);
}

.catalog-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-left: auto;
    flex-wrap: wrap;
}

.catalog-search-input-wrap {
    position: relative;
    width: min(100%, 360px);
}

.catalog-search-input-wrap::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid #94a3b8;
    border-radius: 999px;
    transform: translateY(-60%);
    pointer-events: none;
}

.catalog-search-input-wrap::after {
    content: '';
    position: absolute;
    left: 29px;
    top: calc(50% + 4px);
    width: 8px;
    height: 2px;
    background: #94a3b8;
    transform: rotate(45deg);
    border-radius: 999px;
    pointer-events: none;
}

.catalog-search-input {
    width: 100%;
    min-height: 42px;
    padding: 10px 14px 10px 44px;
    border: 1px solid #d6dbe4;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #111827;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.catalog-search-input:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
    background: #ffffff;
}

.empty-state-inline {
    margin-top: 16px;
}

.admin-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.admin-grid-two {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.detail-card,
.detail-list > div {
    display: grid;
    gap: 8px;
}

.detail-list {
    display: grid;
    gap: 16px;
}

.timeline {
    display: grid;
    gap: 18px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 14px;
    align-items: start;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    margin-top: 6px;
    border-radius: 999px;
    background: #0f766e;
    box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.14);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(17, 24, 39, 0.5);
    z-index: 1000;
}

.modal-backdrop[hidden] {
    display: none !important;
}

.modal-card {
    width: min(100%, 620px);
    padding: 24px;
    border-radius: 24px;
    background: #fffdf8;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.2);
}

.modal-feedback {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 0.95rem;
}

.modal-feedback-success {
    background: #dcfce7;
    color: #166534;
}

.modal-feedback-error {
    background: #fee2e2;
    color: #991b1b;
}

.attribute-list,
.gallery-grid {
    display: grid;
    gap: 12px;
}

.attribute-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.attribute-row input {
    margin: 0;
}

.gallery-section {
    display: grid;
    gap: 14px;
    margin-top: 6px;
}

.gallery-title {
    margin: 0;
    font-weight: 700;
}

.gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(132px, 148px));
    justify-content: start;
}

.gallery-card {
    display: grid;
    gap: 12px;
    width: 148px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.gallery-card-primary {
    border-color: rgba(15, 118, 110, 0.35);
    box-shadow: 0 14px 30px rgba(15, 118, 110, 0.12);
}

.gallery-card img {
    width: 100%;
    height: 108px;
    object-fit: cover;
    border-radius: 16px;
    background: #e5e7eb;
}

.gallery-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.gallery-color-link {
    display: grid;
    gap: 6px;
    min-width: 150px;
    color: #4b5563;
    font-size: 0.82rem;
}

.gallery-color-link span {
    font-weight: 600;
}

.gallery-color-link select {
    width: 100%;
    min-height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 8px 10px;
    background: #ffffff;
}

.color-variant-list {
    display: grid;
    gap: 12px;
}

.color-variant-row {
    display: grid;
    grid-template-columns: minmax(200px, 1.1fr) minmax(200px, 1fr) 108px auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #f8fafc;
}

.color-variant-field {
    display: grid;
    gap: 8px;
}

.color-variant-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #4b5563;
}

.color-variant-preview,
.color-variant-preview-placeholder {
    width: 100%;
    height: 88px;
    border-radius: 14px;
    overflow: hidden;
    background: #e5e7eb;
}

.color-variant-preview {
    display: grid;
    place-items: center;
}

.color-variant-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.color-variant-preview-placeholder {
    display: grid;
    place-items: center;
    color: #6b7280;
    font-size: 0.82rem;
}

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

    .admin-sidebar {
        gap: 20px;
    }

    .admin-topbar,
    .panel-card-header,
    .form-grid,
    .admin-grid-two,
    .detail-grid,
    .label-row,
    .modal-header,
    .modal-actions {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .form-grid,
    .admin-grid-two,
    .detail-grid {
        display: grid;
    }

    .catalog-header-bar {
        align-items: stretch;
    }

    .catalog-header-search {
        order: 3;
        width: 100%;
        justify-content: stretch;
    }

    .catalog-header-actions {
        margin-left: 0;
        justify-content: space-between;
    }

    .catalog-search-input-wrap {
        width: 100%;
    }

    .products-table-body-wrap {
        max-height: 52vh;
    }

    .attribute-row {
        grid-template-columns: 1fr;
    }

    .color-variant-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .gallery-card {
        width: auto;
    }
}
