:root {
    --bg: #fdf6f3;
    --surface: #ffffff;
    --text: #1c1815;
    --muted: #7a6e6a;
    --border: #f2e0da;
    --primary: #b25856;
    --primary-hover: #8e4442;
    --primary-soft: #fcede8;
    --danger: #b3261e;
    --danger-soft: #fbe9e7;
    --radius: 10px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif;
    font-size: 15px;
    color: var(--text);
}

* { box-sizing: border-box; }

body { margin: 0; background: var(--bg); }

h1 { font-size: 1.6rem; margin: 0 0 1.25rem; }
h1:focus { outline: none; }
h2 { font-size: 1.1rem; margin: 0 0 1rem; }
h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 .4rem; }
a { color: var(--primary); }

.muted { color: var(--muted); }
.small { font-size: .85em; }
.danger { color: var(--danger); font-weight: 600; }

/* Layout */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar {
    background: #1c1815; color: #faebe6; display: flex; flex-direction: column;
    padding: 1.25rem 1rem; position: sticky; top: 0; height: 100vh;
}
.brand { font-weight: 700; font-size: 1.25rem; margin-bottom: 1.5rem; padding: 0 .5rem; }
.brand span { font-weight: 400; opacity: .7; }
.sidebar nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.sidebar nav a {
    color: inherit; text-decoration: none; padding: .55rem .75rem; border-radius: 8px; opacity: .85;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .08); opacity: 1; }
.sidebar nav a.active { background: rgba(255, 255, 255, .14); opacity: 1; font-weight: 600; }
.user { border-top: 1px solid rgba(255, 255, 255, .15); padding: 1rem .5rem 0; font-size: .9rem; }
.user-role { opacity: .65; font-size: .8rem; }
.user .btn-link { color: #f4bdb1; padding: 0; margin-top: .5rem; }
.content { padding: 2rem; min-width: 0; }

.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-header h1 { margin: 0; }

/* Cards and stats */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; overflow-x: auto; }
.card-header { display: flex; justify-content: space-between; align-items: baseline; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.stat-label { color: var(--muted); font-size: .85rem; }
.stat-value { font-size: 1.7rem; font-weight: 700; margin-top: .25rem; font-variant-numeric: tabular-nums; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: start; font-size: .8rem; color: var(--muted); font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--border); }
td { padding: .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.actions { text-align: end; white-space: nowrap; }
.actions .btn + .btn { margin-inline-start: .35rem; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #fdf6f3; }
tr.details > td { background: #fdf6f3; }
tr.inactive td { color: var(--muted); }
tr.total td { font-weight: 700; }
.order-details { display: grid; grid-template-columns: 1fr 1.4fr; gap: 2rem; padding: .5rem; }
.order-details p { margin: 0 0 1rem; line-height: 1.5; }
.order-details td { border: none; padding: .25rem .4rem; }
.shein-preview { display: block; max-width: 260px; width: 100%; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 1rem; }
.thumb { width: 52px; }
.thumb img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }

.notifications { list-style: none; margin: 0; padding: 0; }
.notifications li { padding: .6rem .25rem; border-bottom: 1px solid var(--border); }
.notifications li:last-child { border-bottom: none; }
.notifications li.unread { background: var(--primary-soft); border-radius: 6px; padding-inline-start: .6rem; }

/* Badges */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.status-pending { background: #fff3d6; color: #8a5a00; }
.status-confirmed { background: #e3efff; color: #1d4f91; }
.status-preparing { background: #ece6ff; color: #4b2f9c; }
.status-outfordelivery { background: #dff4f7; color: #11606b; }
.status-delivered { background: #e2f5e7; color: #1e6b34; }
.status-cancelled { background: #eeeeee; color: #5c5c5c; }
.status-rejected { background: #ffe4e0; color: #9c2b1d; }
.status-ordered { background: #e3efff; color: #1d4f91; }
.status-awaitingapproval { background: #fde8f3; color: #8a2f6b; }

/* Forms */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
label.checkbox { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); font-weight: 500; }
input, select, textarea {
    font: inherit; color: var(--text); font-weight: 400; padding: .5rem .65rem;
    border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: .5rem; margin-top: 1.25rem; }
.toolbar { display: flex; gap: 1rem; align-items: flex-end; margin-bottom: 1rem; flex-wrap: wrap; }

.btn {
    font: inherit; font-size: .88rem; font-weight: 600; padding: .45rem .9rem; border-radius: 8px;
    border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer;
}
.btn:hover { background: #f3f0f5; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); border-color: #f0c9c5; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-link { background: none; border: none; text-decoration: underline; font-weight: 500; }
.btn-block { width: 100%; padding: .65rem; margin-top: .5rem; }

.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; display: flex; gap: 1rem; justify-content: space-between; }
.alert-error { background: var(--danger-soft); color: var(--danger); }

/* Login */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: 100%; max-width: 380px; }
.login-card form { display: flex; flex-direction: column; gap: 1rem; }
.login-card h1 { margin-bottom: .25rem; }
.login-card h1 .muted { font-weight: 400; }

/* Validation (from template) */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; font-weight: 400; }

.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "An error has occurred."; }

@media (max-width: 800px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .content { padding: 1rem; }
    .form-grid, .order-details { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
}

/* Photos of SHEIN items staff removed (no express shipping) */
.removed-items { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.removed-item { display: flex; flex-direction: column; gap: 6px; align-items: center; width: 140px; text-decoration: none; color: inherit; }
.removed-item img { width: 140px; height: 140px; object-fit: cover; border-radius: 8px; border: 1px solid #e5e5e5; background: #fafafa; }
.removed-item input { width: 100%; }
