/* =========================================================
   MOVEX NIGERIA DASHBOARD SHARED CSS
   Clean corporate lemon-green dashboard shell
   Mobile friendly left sidebar layout
   ========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

:root {
    --bg-main: #f9fff2;
    --bg-soft: #f5ffe8;
    --bg-card: #ffffff;
    --bg-sidebar: linear-gradient(180deg, #f3ffd9 0%, #efffd0 100%);
    --text-dark: #2f3a2f;
    --text-mid: #667085;
    --border: #e4edcf;
    --accent: #d4f15a;
    --accent-strong: #b8de28;
    --accent-deep: #7a9e00;
    --gold-soft: #ffe97a;
    --white: #ffffff;
    --shadow: rgba(80, 102, 32, 0.10);
    --overlay: rgba(43, 52, 30, 0.35);
    --danger-soft: #fff0f0;
    --success-soft: #eefceb;
    --info-soft: #eef7ff;
}

body {
    background: linear-gradient(135deg, #fbfff4, #f7ffe8, #f3ffe1);
    color: var(--text-dark);
    min-height: 100vh;
}

/* Main dashboard wrapper */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    opacity: 0;
    visibility: hidden;
    transition: 0.25s ease;
    z-index: 90;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    box-shadow: 6px 0 24px var(--shadow);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
}

.sidebar.show {
    transform: translateX(0);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 6px 12px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 14px;
    background: #ffffff;
    padding: 6px;
    box-shadow: 0 8px 18px rgba(122, 158, 0, 0.12);
}

.brand-text h1 {
    font-size: 20px;
    color: var(--text-dark);
    line-height: 1.2;
}

.brand-text p {
    font-size: 12px;
    color: var(--text-mid);
    margin-top: 3px;
}

.env-badge {
    display: inline-block;
    margin-top: 6px;
    background: var(--gold-soft);
    color: #5d5b10;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
}

/* User/admin summary block */
.sidebar-profile {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 8px 18px rgba(122, 158, 0, 0.07);
}

.sidebar-profile-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dff78d, #f7ffcf);
    border: 1px solid #dbe8ab;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #556b00;
    flex-shrink: 0;
}

.profile-meta h2 {
    font-size: 15px;
    color: var(--text-dark);
}

.profile-meta p {
    font-size: 12px;
    color: var(--text-mid);
    margin-top: 2px;
}

.role-badge {
    display: inline-block;
    margin-top: 10px;
    background: #ecf9c0;
    color: #627d00;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
}

/* Menu group */
.menu-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-group-title {
    font-size: 12px;
    font-weight: 700;
    color: #7a8b58;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 0 8px;
    margin-top: 4px;
}

.menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-dark);
    padding: 12px 14px;
    border-radius: 14px;
    transition: 0.22s ease;
    border: 1px solid transparent;
    background: transparent;
}

.menu-item a:hover {
    background: rgba(255, 255, 255, 0.72);
    border-color: var(--border);
}

.menu-item.active a {
    background: linear-gradient(135deg, #ebfac0, #f8ffd9);
    border-color: #d8e7ab;
    box-shadow: 0 10px 20px rgba(122, 158, 0, 0.10);
    font-weight: 700;
}

.menu-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e5eebf;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6f8800;
    flex-shrink: 0;
    font-size: 14px;
}

.menu-text {
    flex: 1;
    min-width: 0;
}

.menu-text strong {
    display: block;
    font-size: 14px;
    color: var(--text-dark);
}

.menu-text span {
    display: block;
    font-size: 12px;
    color: var(--text-mid);
    margin-top: 2px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* Main area */
.dashboard-main {
    width: 100%;
    min-width: 0;
    padding-left: 0;
}

body.sidebar-collapsed .sidebar {
    width: 96px;
}

body.sidebar-collapsed .menu-text,
body.sidebar-collapsed .menu-group-title,
body.sidebar-collapsed .brand-text p,
body.sidebar-collapsed .brand-text .env-badge,
body.sidebar-collapsed .sidebar-profile {
    display: none;
}

body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
}

/* Header */
.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(251, 255, 244, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.menu-toggle {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-dark);
    box-shadow: 0 8px 18px rgba(122, 158, 0, 0.05);
}

.page-heading h1 {
    font-size: 20px;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-heading p {
    font-size: 13px;
    color: var(--text-mid);
    margin-top: 3px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-chip,
.header-button {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-dark);
    box-shadow: 0 8px 18px rgba(122, 158, 0, 0.05);
}

.header-button {
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
}

/* Main content wrapper */
.dashboard-content {
    padding: 18px 16px 28px;
}

.content-stack {
    display: grid;
    gap: 18px;
}

/* Welcome banner */
.hero-card {
    background: linear-gradient(135deg, #f7ffd7, #fffde8 58%, #f0ffd3);
    border: 1px solid #e0ecb8;
    border-radius: 22px;
    padding: 20px 18px;
    box-shadow: 0 14px 28px rgba(122, 158, 0, 0.08);
}

.hero-card h2 {
    font-size: 22px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.hero-card p {
    color: #5f6e50;
    font-size: 14px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.btn-primary,
.btn-secondary {
    text-decoration: none;
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #d8f25f, #f3ff9c);
    color: #4f6100;
    box-shadow: 0 10px 20px rgba(122, 158, 0, 0.14);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-dark);
    border-color: var(--border);
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 20px rgba(122, 158, 0, 0.05);
}

.stat-card .stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-mid);
}

.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f7ffe4;
    border: 1px solid #e2edbe;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #789300;
    font-size: 16px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
}

.movex-table-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.movex-table-pagination .pagination-status {
    font-size: 13px;
    color: var(--text-mid);
}

.movex-table-pagination .pagination-btn {
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text-dark);
    border-radius: 10px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.movex-table-pagination .pagination-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.global-toast-area {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 2500;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 24px));
}

.movex-toast {
    position: relative;
    border: 1px solid #dbe8c4;
    border-radius: 12px;
    background: #f6ffe6;
    color: #2f3a2f;
    padding: 12px 36px 12px 12px;
    box-shadow: 0 8px 18px rgba(43, 52, 30, 0.12);
}

.movex-toast strong {
    display: block;
    margin-bottom: 4px;
}

.movex-toast--success,
.movex-msg--success {
    background: #178a3e;
    border-color: #178a3e;
    color: #ffffff;
}

.movex-toast--error,
.movex-msg--error {
    background: #bf1d1d;
    border-color: #bf1d1d;
    color: #ffffff;
}

.movex-toast--warning,
.movex-msg--warning {
    background: #f3c622;
    border-color: #f3c622;
    color: #3a2f00;
}

.movex-toast--info,
.movex-msg--info {
    background: #eaf3ff;
    border-color: #bfd6f8;
    color: #214f83;
}

.movex-toast-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.movex-msg {
    border-width: 1px;
    border-style: solid;
}

/* Strict user sidebar consolidation update */
.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e5eebf;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 8px 18px rgba(122, 158, 0, 0.12);
    flex-shrink: 0;
}

.sidebar-collapse-btn {
    margin-left: auto;
    border: 1px solid var(--border);
    background: #ffffff;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    color: var(--text-dark);
    font-weight: 900;
}

body.sidebar-collapsed .sidebar-collapse-btn {
    transform: rotate(180deg);
}

@media (min-width: 1100px) {
    .sidebar {
        transform: none;
    }

    .dashboard-main {
        padding-left: 280px;
        transition: padding-left 0.22s ease;
    }

    body.sidebar-collapsed .dashboard-main {
        padding-left: 96px;
    }

    body.sidebar-collapsed .sidebar {
        transform: none;
    }

    .sidebar-overlay {
        display: none;
    }
}

@media (max-width: 1099px) {
    .dashboard-main {
        padding-left: 0;
    }

    body.sidebar-collapsed .sidebar {
        width: 280px;
    }

    body.sidebar-collapsed .menu-text,
    body.sidebar-collapsed .menu-group-title,
    body.sidebar-collapsed .brand-text p,
    body.sidebar-collapsed .brand-text .env-badge,
    body.sidebar-collapsed .sidebar-profile {
        display: block;
    }
}
