/* ── Merchant Portal ───────────────────────────────────────────── */

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-skeleton {
    height: 88px;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f1f38;
    line-height: 1;
}
.stat-label {
    font-size: .8rem;
    color: #6b7280;
    margin-top: .25rem;
}
.mt-6 { margin-top: 1.5rem; }

/* Product form layout */
.form-layout-2col {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    align-items: start;
}
.form-main { min-width: 0; }
.form-sidebar { min-width: 0; }

/* Upload zone */
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s;
}
.upload-zone:hover { border-color: #dd3d31; }

/* Gallery */
.gallery-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.gallery-item {
    position: relative;
    width: 130px;
    height: 130px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-item-del {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,.6);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    padding: 0;
    display: none;
}
.gallery-item:hover .gallery-item-del { display: block; }

/* Table loading */
.table-loading {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
}

/* Dashboard two-panel layout */
.dash-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Dash list (orders + products) */
.dash-list { }
.dash-list-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background .15s;
}
.dash-list-row:last-child { border-bottom: none; }
.dash-list-row:hover { background: #f9fafb; }
.dash-list-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .125rem;
}
.dash-list-title {
    font-weight: 600;
    font-size: .875rem;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-list-sub {
    font-size: .75rem;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-list-right {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}
.dash-list-price {
    font-weight: 700;
    font-size: .875rem;
    color: #0f1f38;
    min-width: 60px;
    text-align: right;
}
.dash-list-date {
    font-size: .75rem;
    color: #9ca3af;
    min-width: 80px;
    text-align: right;
}
.dash-empty {
    padding: 2rem;
    text-align: center;
    color: #9ca3af;
    font-size: .9rem;
}
.dash-empty-products {
    padding: 2rem;
    text-align: center;
}
.dash-empty-products p { color: #9ca3af; margin-bottom: 1rem; }

/* Responsive */
@media (max-width: 1100px) {
    .dash-panels { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-layout-2col { grid-template-columns: 1fr; }
    .form-sidebar { order: -1; }
}
@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
    .dash-list-date { display: none; }
}

/* ── Message cards ───────────────────────────────────────────────── */
.msg-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: .75rem;
    transition: border-color .15s;
}
.msg-card:hover { border-color: #d1d5db; }
.msg-unread { border-left: 3px solid #dd3d31; }
.msg-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    gap: 1rem;
}
.msg-card-left {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}
.msg-card-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #374151;
    font-size: .75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.msg-unread .msg-card-avatar { background: #dd3d31; color: #fff; }
.msg-card-name { font-size: .875rem; font-weight: 600; color: #111827; }
.msg-card-email { font-size: .75rem; color: #6b7280; }
.msg-card-right {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}
.msg-card-product {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .75rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: .2rem .5rem;
    border-radius: 4px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.msg-card-date { font-size: .75rem; color: #9ca3af; white-space: nowrap; }
.msg-card-preview {
    padding: 0 1.25rem .75rem;
    font-size: .8125rem;
    color: #6b7280;
    line-height: 1.5;
    cursor: pointer;
}
.msg-card-body {
    border-top: 1px solid #f3f4f6;
    padding: 1.25rem;
}
.msg-card-content {
    font-size: .875rem;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 1rem;
}
.msg-card-meta {
    font-size: .8125rem;
    color: #6b7280;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.msg-card-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
@media (max-width: 768px) {
    .msg-card-header { flex-direction: column; align-items: flex-start; }
    .msg-card-right { flex-wrap: wrap; }
    .msg-card-product { max-width: 100%; }
}
