:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #3b82f6;
    --header-height: 56px;
    --body-bg: #f1f5f9;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--body-bg);
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1040;
}

.sidebar-brand {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand a {
    text-decoration: none;
    color: #fff;
}

.brand-text {
    font-size: 1.4rem;
    font-weight: 700;
    display: block;
    letter-spacing: -0.02em;
}

.brand-sub {
    font-size: 0.72rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-nav {
    padding: 0.5rem 0;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: 0.55rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
    text-decoration: none;
}

.sidebar-nav .nav-link:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.05);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(59,130,246,0.12);
    border-left-color: var(--sidebar-active);
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 1.4rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-section {
    padding: 1.1rem 1.25rem 0.35rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #475569;
    font-weight: 600;
    list-style: none;
}

/* ===== Content area ===== */
.admin-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--body-bg);
    display: flex;
    flex-direction: column;
}

.admin-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.sidebar-toggle {
    font-size: 1.25rem;
    color: #334155;
    padding: 0.25rem 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-weight: 500;
    color: #475569;
    font-size: 0.9rem;
}

.admin-main {
    padding: 1.5rem;
    flex: 1;
}

/* ===== Sidebar collapse ===== */
.sidebar-collapsed .admin-sidebar {
    transform: translateX(-100%);
}

.sidebar-collapsed .admin-content {
    margin-left: 0;
}

/* ===== Dashboard stats ===== */
.stat-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    flex-shrink: 0;
}

.stat-info h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-info p {
    margin: 0;
    color: #64748b;
    font-size: 0.82rem;
}

/* ===== Content card ===== */
.content-card {
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.content-card h5 {
    font-weight: 600;
    color: #334155;
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* ===== Status badges ===== */
.badge-raw { background-color: #f59e0b; color: #fff; }
.badge-deduplicated { background-color: #0ea5e9; color: #fff; }
.badge-processing { background-color: #3b82f6; color: #fff; }
.badge-approved { background-color: #10b981; color: #fff; }
.badge-rejected { background-color: #ef4444; color: #fff; }
.badge-deleted { background-color: #6b7280; color: #fff; }

/* ===== Tables ===== */
.table th {
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
    white-space: nowrap;
    border-bottom-width: 2px;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* ===== Image preview in tables ===== */
.thumb-preview {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    background: #f1f5f9;
}

/* ===== Action buttons row ===== */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* ===== GridView tweaks ===== */
.grid-view .filters input,
.grid-view .filters select {
    font-size: 0.85rem;
}

.grid-view .summary {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

/* ===== Guest/login layout ===== */
.guest-body {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    min-height: 100vh;
}

.guest-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.guest-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
}

.guest-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.guest-logo h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.guest-logo p {
    color: #64748b;
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
}

/* ===== Breadcrumbs ===== */
.breadcrumb-wrapper {
    padding: 0;
    margin-bottom: 0.75rem;
    background: transparent;
    list-style: none;
    display: flex;
    gap: 0.35rem;
    font-size: 0.85rem;
}

/* ===== Responsive ===== */
@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-content {
        margin-left: 0;
    }
    .sidebar-collapsed .admin-sidebar {
        transform: translateX(0);
    }
    .sidebar-collapsed .admin-content {
        margin-left: 0;
    }
}

/* ===== Form page layout ===== */
.form-page .form-group {
    margin-bottom: 1rem;
}

.form-page .help-block {
    font-size: 0.82rem;
    color: #dc3545;
}

/* ===== Detail view ===== */
.detail-view th {
    width: 200px;
    font-weight: 600;
    background: #f8fafc;
}
