/* ===== ADMIN LAYOUT ===== */
.admin-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: calc(100vh - var(--nav-height));
}

.admin-sidebar {
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
    overflow-y: auto;
}

.admin-sidebar__section {
    font-size: 10px;
    font-weight: var(--fw-semibold);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.3);
    padding: 16px 20px 6px;
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 20px;
    font-size: 13px;
    font-weight: var(--fw-medium);
    color: rgba(255,255,255,.55);
    transition: background .15s, color .15s;
    text-decoration: none;
}

.admin-sidebar a:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
}

.admin-sidebar a.active {
    background: rgba(128,0,32,.5);
    color: #fff;
}

.admin-sidebar a svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.admin-sidebar__spacer {
    flex: 1;
}

.admin-sidebar__back {
    border-top: 1px solid rgba(255,255,255,.1);
}

/* ===== ADMIN MAIN ===== */
.admin-main {
    background: var(--color-bg);
    padding: 36px 40px var(--section-gap);
    overflow: auto;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.admin-header h1 {
    font-size: 28px;
    font-weight: var(--fw-bold);
}

/* ===== STATS ===== */
.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.admin-stat-card {
    background: var(--color-card-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: 22px 24px;
}

.admin-stat-card__val {
    font-size: 30px;
    font-weight: var(--fw-bold);
    line-height: 1;
    margin-bottom: 6px;
}

.admin-stat-card__val--accent {
    color: var(--color-accent);
}

.admin-stat-card__lbl {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* ===== ADMIN CARD ===== */
.admin-card {
    background: var(--color-card-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.admin-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.admin-card__title {
    font-size: 16px;
    font-weight: var(--fw-bold);
}

/* ===== ADMIN TABLE ===== */
.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th {
    text-align: left;
    font-size: 11px;
    font-weight: var(--fw-semibold);
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding: 10px 14px;
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
    background: var(--color-bg);
}

.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--color-bg); }

.admin-table__actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: var(--fw-semibold);
    white-space: nowrap;
}

.badge-pending    { background: #fff3cd; color: #856404; }
.badge-confirmed  { background: #cff4fc; color: #055160; }
.badge-shipped    { background: #d1ecf1; color: #0c5460; }
.badge-delivered  { background: #d4edda; color: #155724; }
.badge-cancelled  { background: #f8d7da; color: #721c24; }
.badge-returned   { background: #e2e3e5; color: #383d41; }
.badge-active     { background: #d4edda; color: #155724; }
.badge-inactive   { background: #e2e3e5; color: #383d41; }

/* ===== ADMIN FORM ===== */
.admin-form-card {
    background: var(--color-card-bg);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: 32px;
    max-width: 720px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

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

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

.admin-search {
    display: flex;
    gap: 8px;
    align-items: center;
}

.admin-search .form-control {
    width: 260px;
}

.admin-filter-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ===== DETAIL ===== */
.admin-detail-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}

.admin-detail-meta p {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.admin-detail-meta strong {
    font-size: 14px;
    font-weight: var(--fw-semibold);
    color: var(--color-text);
}

/* ===== FLASH ===== */
.admin-flash {
    background: #d4edda;
    color: #155724;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    margin-bottom: 20px;
}

/* ===== BRAND/CATEGORY TABLES in admin ===== */
.brand-card--detailed {
    align-items: flex-start;
}

.brand-card__description {
    color: var(--color-text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.brand-card__footer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
}

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

.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 1280px) {
    .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
    .admin-main { padding: 24px 20px; }
    .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-grid-2,
    .admin-detail-layout,
    .brands-grid { grid-template-columns: 1fr; }
}
