:root {
    --primary: #bc8500;
    --primary-hover: #a67400;
    --danger: #c0392b;
    --bg: #f8f8fa;
    --surface: #ffffff;
    --border: #e0e0e6;
    --text: #1f2430;
    --muted: #6b7280;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
}

#app {
    height: 100%;
}

.boot-splash, .auth-message {
    padding: 2rem;
    color: var(--muted);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: #14213d;
    color: #fff;
    padding: 1rem;
}

.sidebar-brand {
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
    background: var(--primary);
    color: #181000;
}

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.user-name {
    font-weight: 600;
}

.dev-badge {
    background: var(--border);
    color: var(--muted);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.8rem;
}

.content {
    padding: 1.5rem;
}

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

h1 {
    font-size: 1.4rem;
    margin: 0 0 1rem;
}

.page-header h1 {
    margin: 0;
}

.muted {
    color: var(--muted);
}

.btn {
    display: inline-block;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #181000;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.banner {
    border-radius: 6px;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
}

.banner-success {
    background: #e7f6e7;
    border: 1px solid #b7e0b7;
}

.banner-error {
    background: #fdecea;
    border: 1px solid #f5c6c0;
}

.search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-bar input {
    flex: 1;
    max-width: 380px;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.data-table th, .data-table td {
    text-align: left;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.thumb {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bg);
}

.row-actions {
    display: flex;
    gap: 0.4rem;
    white-space: nowrap;
}

.form-field {
    margin-bottom: 1rem;
    max-width: 560px;
}

.form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.form-field input, .form-field textarea {
    width: 100%;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.validation-message {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    background: var(--surface);
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.dialog {
    background: var(--surface);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    max-width: 420px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fdecea;
    border-top: 1px solid #f5c6c0;
    padding: 0.6rem 1.25rem;
    z-index: 100;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
}

/* Product image upload list (ADR-0034) */
.image-upload-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.image-upload-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.image-upload-name {
    flex: 1;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-upload-main {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
}
