:root {
    --brand-primary: #7B1FA2;
    --brand-primary-dark: #4A148C;
    --brand-primary-soft: rgba(123, 31, 162, 0.1);
    --brand-accent: #FF6D00;
    --brand-accent-soft: rgba(255, 109, 0, 0.12);
    --sidebar-bg: #141026;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: linear-gradient(135deg, #7B1FA2 0%, #9C27B0 100%);
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: #C7C3DA;
    --sidebar-width: 264px;
    --sidebar-collapsed-width: 78px;
    --header-height: 68px;
    --canvas-bg: #F5F6FA;
    --surface: #FFFFFF;
    --border: #E5E7F0;
    --text-main: #181826;
    --text-muted: #646982;
    --success: #16A34A;
    --success-soft: #DCFCE7;
    --warning: #D97706;
    --warning-soft: #FEF3C7;
    --danger: #DC2626;
    --danger-soft: #FEE2E2;
    --info: #2563EB;
    --info-soft: #DBEAFE;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(20, 16, 38, 0.05);
    --shadow-md: 0 6px 20px rgba(20, 16, 38, 0.06);
    --shadow-lg: 0 16px 40px rgba(20, 16, 38, 0.12);
    --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-sans);
    background-color: var(--canvas-bg);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

/* ===========================
   App Shell (Sidebar + Main)
   =========================== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: width 0.22s ease, transform 0.24s ease;
    border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    height: var(--header-height);
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: 0.5px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.38);
}

.brand-text {
    overflow: hidden;
    white-space: nowrap;
}

.brand-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #fff;
}

.brand-subtitle {
    font-size: 11px;
    color: #9A94B8;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-group {
    margin-bottom: 20px;
}

.nav-group-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #7D779C;
    padding: 0 12px 8px;
    white-space: nowrap;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid transparent;
    color: var(--sidebar-text);
    font-weight: 600;
    margin-bottom: 3px;
    transition: all 0.22s ease-in-out;
    white-space: nowrap;
}

.nav-link svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
    border-left: 3px solid #9C27B0;
}

.nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left: 3px solid #CE93D8;
    box-shadow: 0 6px 14px rgba(123, 31, 162, 0.35);
}

.nav-link:hover svg,
.nav-link.active svg {
    opacity: 1;
    color: #fff;
}

.nav-badge {
    margin-left: auto;
    background: var(--brand-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
}

/* Sidebar Nav Submenu Accordion */
.nav-dropdown-btn {
    width: 100%;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-weight: 600;
    margin-bottom: 3px;
    transition: all 0.22s ease-in-out;
    white-space: nowrap;
    box-sizing: border-box;
}

.nav-dropdown-btn svg:not(.dropdown-chevron) {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-dropdown-btn .dropdown-chevron {
    margin-left: auto;
    width: 16px;
    height: 16px;
    transform-origin: center;
    transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.16s ease;
    opacity: 0.7;
    flex-shrink: 0;
}

.nav-item-dropdown.open .nav-dropdown-btn .dropdown-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

.nav-dropdown-btn.active-parent {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid #9C27B0;
}

.nav-dropdown-btn:hover {
    color: #fff;
    background: var(--sidebar-hover);
    border-left: 3px solid #9C27B0;
}

.nav-dropdown-btn.active-parent svg:not(.dropdown-chevron),
.nav-dropdown-btn:hover svg:not(.dropdown-chevron) {
    opacity: 1;
    color: #fff;
}

/* Smooth Accordion Height Animation via CSS Grid (Zero vertical snap or jitter) */
.nav-submenu-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item-dropdown.open .nav-submenu-wrapper {
    grid-template-rows: 1fr;
}

.nav-submenu-content {
    overflow: hidden;
    min-height: 0;
}

/* Sayvik-style Tree Connector Submenu (Original Purple Palette) */
.nav-submenu {
    position: relative;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 4px 0;
    margin: 4px 4px 6px 4px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.nav-submenu::before {
    content: '';
    position: absolute;
    left: 26px;
    top: 0;
    bottom: 16px;
    width: 2px;
    background: rgba(216, 180, 254, 0.78);
    border-radius: 1px;
    z-index: 1;
}

.nav-item-dropdown.open .nav-submenu {
    opacity: 1;
    transform: translateY(0);
}

.nav-sublink {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 46px;
    font-size: 13px;
    font-weight: 500;
    color: var(--sidebar-text);
    border-radius: 6px;
    margin: 2px 6px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-sublink::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 2px;
    background: rgba(216, 180, 254, 0.78);
    border-radius: 1px;
    transition: all 0.2s ease;
    z-index: 2;
}

.nav-sublink:hover {
    background: var(--sidebar-hover);
    color: #fff;
    padding-left: 48px;
}

.nav-sublink.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 700;
    padding-left: 48px;
    box-shadow: 0 4px 10px rgba(123, 31, 162, 0.35);
}

.nav-sublink:hover::before,
.nav-sublink.active::before {
    background-color: #ffffff;
    box-shadow: 0 0 8px rgba(233, 213, 255, 0.95);
    width: 16px;
}

.sublink-dot {
    display: none;
}

/* Blinking Notification Dot for Sidebar Menus */
.nav-blink-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #F59E0B;
    margin-left: auto;
    margin-right: 6px;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.75);
    animation: navDotPulse 1.5s infinite;
}

@keyframes navDotPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.8);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 7px rgba(245, 158, 11, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

.nav-sublink.active .sublink-dot {
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-user-meta {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: #A6A0C4;
    text-transform: capitalize;
}

.sidebar-logout-btn {
    background: transparent;
    border: 0;
    color: #C7C3DA;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: grid;
    place-items: center;
}

.sidebar-logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FF8A65;
}

/* Collapsed sidebar on desktop */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-group-label,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-badge,
body.sidebar-collapsed .sidebar-user-meta {
    display: none;
}

body.sidebar-collapsed .sidebar-brand,
body.sidebar-collapsed .nav-link,
body.sidebar-collapsed .sidebar-user-card {
    justify-content: center;
}

body.sidebar-collapsed .sidebar-brand .brand-full {
    display: none !important;
}

body.sidebar-collapsed .sidebar-brand .brand-mini {
    display: grid !important;
}

body.sidebar-collapsed .sidebar-user-card {
    flex-direction: column;
    gap: 8px;
}

body.sidebar-collapsed .main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.22s ease;
}

/* ===========================
   Header
   =========================== */
.top-header {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--text-main);
    transition: border-color 0.15s ease, background-color 0.15s ease;
    flex-shrink: 0;
}

.icon-btn:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
}

.mobile-menu-btn {
    display: none;
}

.header-title-wrap {
    min-width: 0;
}

.header-breadcrumb {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-page-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.header-search {
    position: relative;
    width: 240px;
}

.header-search input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--canvas-bg);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.header-search input:focus {
    border-color: var(--brand-primary);
    background: #fff;
}

.header-search svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.status-pill-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--success-soft);
    color: var(--success);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

/* User Dropdown */
.user-menu-wrap {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 5px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.user-menu-trigger:hover {
    border-color: var(--brand-primary);
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 18px;
}

.user-trigger-info {
    text-align: left;
    line-height: 1.25;
}

.user-trigger-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.user-trigger-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 230px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    display: none;
    z-index: 60;
}

.user-dropdown.open {
    display: block;
}

.dropdown-header {
    padding: 8px 10px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.dropdown-header-email {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--canvas-bg);
}

.dropdown-item.danger {
    color: var(--danger);
}

.dropdown-item.danger:hover {
    background: var(--danger-soft);
}

/* ===========================
   Main Content & Footer
   =========================== */
.main-content {
    flex: 1;
    padding: 24px;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

.app-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 14px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-links a:hover {
    color: var(--brand-primary);
}

/* ===========================
   Cards, Stats, Grids
   =========================== */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 22px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

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

.grid-main-aside {
    display: grid;
    grid-template-columns: 1.65fr 1fr;
    gap: 20px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
}

.card-body {
    padding: 20px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    margin-top: 6px;
    letter-spacing: -0.5px;
}

.stat-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.stat-icon.purple { background: var(--brand-primary-soft); color: var(--brand-primary); }
.stat-icon.orange { background: var(--brand-accent-soft); color: var(--brand-accent); }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.blue { background: var(--info-soft); color: var(--info); }

/* ===========================
   Tables & Badges
   =========================== */
.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: #F9FAFD;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #FAFBFD;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: capitalize;
    white-space: nowrap;
}

.badge-purple { background: var(--brand-primary-soft); color: var(--brand-primary); }
.badge-orange { background: var(--brand-accent-soft); color: var(--brand-accent); }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-amber { background: var(--warning-soft); color: var(--warning); }
.badge-red { background: var(--danger-soft); color: var(--danger); }
.badge-blue { background: var(--info-soft); color: var(--info); }
.badge-gray { background: #EEF0F6; color: #52586D; }

/* ===========================
   Buttons & Forms
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-sm {
    padding: 6px 11px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-primary {
    background: #0F172A;
    border: 1px solid #0F172A;
    color: #FFFFFF;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.btn-primary:hover {
    background: #1E293B;
    border-color: #1E293B;
    color: #FFFFFF;
    transform: translateY(-1px);
}

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

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

.btn-outline:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

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

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

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: #FCFDFF;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea.form-control {
    height: auto;
    padding: 10px 12px;
    min-height: 90px;
    resize: vertical;
}

.form-control:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

.field-error {
    color: var(--danger);
    font-size: 12px;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
}

.alert-success { background: var(--success-soft); color: #14532D; border: 1px solid #BBF7D0; }
.alert-error { background: var(--danger-soft); color: #7F1D1D; border: 1px solid #FECACA; }

.alert-close {
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    opacity: 0.7;
}

/* Pagination */
.pagination-bar {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-main);
}

.page-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.page-btn.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.page-btn.disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* ===========================
   Auth Pages (Enterprise Clean & Aesthetic)
   =========================== */
.auth-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 16px;
    background: radial-gradient(120% 120% at 50% 10%, #1E1B4B 0%, #0F172A 50%, #020617 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #0F172A;
    position: relative;
    overflow-x: hidden;
    box-sizing: border-box;
}

.auth-backdrop-glow {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 650px;
    height: 420px;
    background: radial-gradient(ellipse at center, rgba(124, 58, 237, 0.22), rgba(37, 99, 235, 0.12), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

@keyframes authFadeUp {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: authFadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card {
    width: 100%;
    background: #FFFFFF;
    border-radius: 22px;
    padding: 36px 34px 28px;
    box-shadow: 0 25px 60px -15px rgba(2, 6, 23, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.12);
    box-sizing: border-box;
    border: 1px solid rgba(226, 232, 240, 0.85);
}

.auth-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 22px;
}

.auth-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.16s ease;
}

.auth-brand-badge:hover {
    transform: translateY(-1px);
}

.auth-brand-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%);
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 800;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.5px;
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.35);
}

.auth-brand-meta {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.auth-brand-name {
    font-size: 19px;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.4px;
    line-height: 1.15;
}

.auth-brand-tagline {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748B;
    margin-top: 2px;
}

.auth-title-block {
    text-align: center;
    margin-bottom: 22px;
}

.auth-heading {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: #0F172A;
    margin: 0;
}

.auth-subheading {
    font-size: 13px;
    color: #64748B;
    margin-top: 6px;
    line-height: 1.5;
}

.auth-form {
    display: flex;
    flex-direction: column;
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-leading-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: #94A3B8;
    pointer-events: none;
    transition: color 0.15s ease;
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px 11px 38px;
    border-radius: 10px;
    border: 1.5px solid #E2E8F0;
    background: #F8FAFC;
    font-size: 14px;
    color: #0F172A;
    transition: all 0.16s ease;
    outline: none;
    font-family: inherit;
}

.auth-input.has-trailing {
    padding-right: 42px;
}

.auth-input:focus {
    border-color: #4338CA;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.12);
}

.auth-input.is-invalid {
    border-color: #EF4444;
    background: #FEF2F2;
}

.input-icon-wrap:focus-within .input-leading-icon {
    color: #4338CA;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: #94A3B8;
    display: grid;
    place-items: center;
    transition: color 0.15s ease;
    padding: 0;
}

.password-toggle:hover {
    color: #4338CA;
}

.field-error {
    display: block;
    font-size: 12px;
    color: #DC2626;
    margin-top: 5px;
    font-weight: 500;
}

.auth-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0 20px;
    font-size: 13px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #64748B;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    accent-color: #4338CA;
    cursor: pointer;
}

.auth-link {
    color: #4338CA;
    font-weight: 600;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.15s ease;
}

.auth-link:hover {
    color: #312E81;
    text-decoration: underline;
}

.auth-submit-btn {
    width: 100%;
    height: 44px;
    border-radius: 11px;
    font-size: 14.5px;
    font-weight: 700;
    background: linear-gradient(135deg, #4338CA 0%, #6366F1 100%);
    color: #FFFFFF;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.32);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
    letter-spacing: 0.2px;
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.4);
    filter: brightness(1.05);
}

.auth-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.auth-submit-btn svg {
    transition: transform 0.16s ease;
}

.auth-submit-btn:hover svg {
    transform: translateX(3px);
}

.auth-card-footer {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #F1F5F9;
}

.auth-security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11.5px;
    color: #64748B;
    font-weight: 500;
}

.auth-security-badge svg {
    color: #10B981;
}

.auth-page-copy {
    margin-top: 18px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px 22px;
        border-radius: 18px;
    }
    .auth-brand-name {
        font-size: 18px;
    }
    .auth-heading {
        font-size: 20px;
    }
}

/* Mobile backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 12, 30, 0.55);
    z-index: 45;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-main-aside { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .main-wrapper,
    body.sidebar-collapsed .main-wrapper {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: grid;
    }

    .desktop-collapse-btn {
        display: none;
    }

    .header-search {
        display: none;
    }


}

@media (max-width: 640px) {
    .grid-4, .grid-2, .form-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 16px;
    }

    .status-pill-live,
    .user-trigger-info {
        display: none;
    }
}

/* ===========================
   Profile Sub-Toolbar & Photo Uploader (Compact & Sleek)
   =========================== */
.profile-sub-toolbar {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.profile-toolbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.profile-toolbar-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-title-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-toolbar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.3px;
    margin: 0;
    line-height: 1.25;
}

.profile-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #EEF2FF;
    color: #4338CA;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.profile-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #ECFDF5;
    color: #059669;
    font-size: 10.5px;
    font-weight: 600;
}

.toolbar-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.profile-toolbar-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.35;
}

.profile-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-toolbar-tabs {
    display: flex;
    gap: 18px;
    border-top: 1px solid #F1F5F9;
    padding: 2px 0 0;
    overflow-x: auto;
}

.profile-tab-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748B;
    text-decoration: none;
    padding: 6px 2px 8px;
    position: relative;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.profile-tab-link:hover,
.profile-tab-link.active {
    color: #4338CA;
}

.profile-tab-link.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #4338CA;
    border-radius: 2px;
}

/* Photo Upload & Preview */
.profile-avatar-upload-row {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.profile-avatar-frame-wrap {
    position: relative;
    width: 104px;
    height: 104px;
    border-radius: 50%;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.18);
    flex-shrink: 0;
    cursor: pointer;
}

.profile-avatar-preview-img {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #FFFFFF;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    display: block;
}

.profile-dummy-avatar-box {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #FFFFFF;
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.2);
    background: #EEF2FF;
}

.dummy-avatar-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.dummy-avatar-initials {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: #0F172A;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 999px;
    letter-spacing: 0.5px;
    border: 1.5px solid #FFFFFF;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.avatar-remove-btn {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #EF4444;
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45);
    transition: transform 0.15s ease, background 0.15s ease;
    z-index: 10;
    padding: 0;
}

.avatar-remove-btn:hover {
    background: #DC2626;
    transform: scale(1.1);
}

.profile-avatar-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-avatar-action-btns {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-avatar-guidelines {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.profile-upload-filename {
    font-size: 11.5px;
    color: #4338CA;
    background: #EEF2FF;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 5px;
}

/* Layout Grid & Cards */
.profile-layout-grid {
    display: grid;
    grid-template-columns: 1.85fr 1fr;
    gap: 24px;
    align-items: start;
}

.profile-main-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card-header-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #EEF2FF;
    color: #4338CA;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.card-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
    margin-bottom: 0;
}

.required-star {
    color: #EF4444;
}

.form-readonly-badge-input {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 42px;
}

.readonly-note {
    font-size: 12px;
    color: var(--text-muted);
}

.profile-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Profile Summary Card */
.profile-side-stack {
    position: sticky;
    top: calc(var(--header-height) + 16px);
}

.profile-summary-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.profile-card-banner {
    height: 64px;
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    position: relative;
    margin-bottom: 44px;
}

.profile-card-avatar-outer {
    position: absolute;
    bottom: -36px;
    left: 20px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.profile-card-avatar-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #FFFFFF;
    display: block;
    background: #FFFFFF;
}

.profile-card-avatar-dummy {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #0F172A;
    color: #FFFFFF;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #FFFFFF;
}

.profile-status-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #10B981;
    border: 2.5px solid #FFFFFF;
}

.profile-summary-body {
    padding-top: 0;
}

.profile-summary-header {
    margin-bottom: 18px;
}

.profile-summary-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-heading);
    margin: 0;
}

.profile-summary-email {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
    margin-bottom: 8px;
}

.profile-summary-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-meta-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 13px;
}

.profile-meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px dashed #F1F5F9;
}

.meta-label {
    color: var(--text-muted);
    font-size: 12.5px;
}

.meta-val {
    font-weight: 600;
    color: var(--text-heading);
    font-size: 13px;
}

.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 960px) {
    .profile-layout-grid {
        grid-template-columns: 1fr;
    }

    .profile-toolbar-container {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-toolbar-actions {
        justify-content: space-between;
        width: 100%;
    }

    .profile-sub-toolbar {
        padding: 16px 20px 0;
    }
}

/* ===========================
   Enterprise Table with Borders & Hover
   =========================== */
.enterprise-table-card {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.table-wrap-bordered {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.enterprise-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    color: var(--text-main);
}

.enterprise-table thead th {
    background: #F8FAFC;
    color: #475569;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid #E2E8F0;
    border-right: 1px solid #E2E8F0;
    white-space: nowrap;
}

.enterprise-table thead th:last-child {
    border-right: none;
}

.enterprise-table tbody tr {
    transition: background-color 0.14s ease;
}

.enterprise-table tbody tr:hover td {
    background-color: #F8FAFC;
}

.enterprise-table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #E2E8F0;
    border-right: 1px solid #F1F5F9;
}

.enterprise-table tbody td:last-child {
    border-right: none;
}

.enterprise-table tbody tr:last-child td {
    border-bottom: 1px solid #E2E8F0;
}

/* User cell in table */
.user-cell-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-cell-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.user-cell-name {
    font-weight: 700;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-cell-sub {
    font-size: 11.5px;
    color: var(--text-muted);
}

.user-cell-phone {
    font-size: 11px;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
}

.dist-code-badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    color: #1E293B;
    font-size: 11.5px;
    font-weight: 700;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.4px;
}

.role-pill-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.stats-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
}

.stats-cell-primary {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-heading);
}

.stats-cell-secondary {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

.stock-cell-wrap {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
}

.stock-cell-num {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-heading);
}

.stock-cell-unit {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-weight: 600;
}

/* Action buttons (Pure Icon Only) */
.table-actions-group {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
}

.table-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #475569;
    text-decoration: none;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    padding: 0;
    flex-shrink: 0;
    position: relative;
}

.table-action-btn:hover {
    transform: translateY(-1.5px) scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.table-action-btn:active {
    transform: translateY(0) scale(0.96);
}

.table-action-btn svg {
    flex-shrink: 0;
    display: block;
}

.table-action-btn.action-edit {
    background: #EEF2FF;
    border-color: #E0E7FF;
    color: #4338CA;
}

.table-action-btn.action-edit:hover {
    border-color: #4338CA;
    background: #4338CA;
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(67, 56, 202, 0.28);
}

.table-action-btn.action-key {
    background: #FAF5FF;
    border-color: #F3E8FF;
    color: #7E22CE;
}

.table-action-btn.action-key:hover {
    background: #7E22CE;
    border-color: #7E22CE;
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(126, 34, 206, 0.28);
}

.table-action-btn.action-verify {
    border-color: #D1FAE5;
    background: #ECFDF5;
    color: #059669;
}

.table-action-btn.action-verify:hover {
    background: #059669;
    border-color: #059669;
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(5, 150, 105, 0.28);
}

.table-action-btn.action-unverify {
    border-color: #FEF3C7;
    background: #FFFBEB;
    color: #D97706;
}

.table-action-btn.action-unverify:hover {
    background: #D97706;
    border-color: #D97706;
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.28);
}

.table-action-btn.action-block {
    border-color: #FFEDD5;
    background: #FFF7ED;
    color: #EA580C;
}

.table-action-btn.action-block:hover {
    background: #EA580C;
    border-color: #EA580C;
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(234, 88, 12, 0.28);
}

.table-action-btn.action-allow {
    border-color: #DCFCE7;
    background: #F0FDF4;
    color: #16A34A;
}

.table-action-btn.action-allow:hover {
    background: #16A34A;
    border-color: #16A34A;
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.28);
}

.table-action-btn.action-delete {
    border-color: #FEE2E2;
    background: #FEF2F2;
    color: #DC2626;
}

.table-action-btn.action-delete:hover {
    background: #DC2626;
    border-color: #DC2626;
    color: #FFFFFF;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.28);
}

/* ===========================
   Expandable Filter Drawer with Smooth Transition
   =========================== */
.filter-drawer {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 24px;
    background: #F8FAFC;
    border-bottom: 1px solid var(--border);
    transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.25s ease,
                padding 0.3s ease;
    box-sizing: border-box;
}

.filter-drawer.is-open {
    max-height: 240px;
    opacity: 1;
    padding: 14px 24px 16px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.filter-drawer-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-fields-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-input-wrap {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.filter-input-wrap .filter-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: #94A3B8;
    pointer-events: none;
}

.filter-input-wrap input {
    padding-left: 36px;
    height: 36px;
    font-size: 13px;
}

.filter-select {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    min-width: 160px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #FFFFFF;
}

.filter-chips-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11.5px;
    color: var(--text-muted);
}

.filter-chip {
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid #E2E8F0;
    background: #FFFFFF;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.14s ease;
}

.filter-chip:hover, .filter-chip.is-active {
    border-color: #4338CA;
    background: #EEF2FF;
    color: #4338CA;
    font-weight: 700;
}

.filter-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.filter-toggle-btn.is-active {
    border-color: #0F172A;
    background: #F1F5F9;
    color: #0F172A;
}

.filter-chevron {
    transition: transform 0.25s ease;
}

.filter-toggle-btn.is-active .filter-chevron {
    transform: rotate(180deg);
}

.filter-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0F172A;
}

/* ===========================
   Preload & Infinite Scroll Footer
   =========================== */
.table-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #FFFFFF;
    border-top: 1px solid #E2E8F0;
    flex-wrap: wrap;
    gap: 12px;
}

.table-footer-status {
    font-size: 12.5px;
    color: #64748B;
    font-weight: 500;
}

.table-footer-status strong {
    color: #0F172A;
}

.table-preload-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    height: 34px;
    padding: 0 14px;
}

.load-more-btn svg {
    transition: transform 0.15s ease;
}

.load-more-btn:hover svg {
    transform: translateY(2px);
}

.preload-spinner-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #4338CA;
    font-weight: 600;
}

.preload-spinner-ring {
    width: 16px;
    height: 16px;
    border: 2px solid #E0E7FF;
    border-top-color: #4338CA;
    border-radius: 50%;
    animation: spinRing 0.75s linear infinite;
}

@keyframes spinRing {
    to { transform: rotate(360deg); }
}

.table-all-loaded-msg {
    font-size: 12px;
    color: #94A3B8;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Row fade-in animation for dynamic appended rows */
@keyframes rowFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-table-row.just-loaded {
    animation: rowFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.empty-table-state {
    padding: 36px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.empty-table-title {
    font-size: 15px;
    font-weight: 700;
    color: #334155;
}

.empty-table-desc {
    font-size: 12.5px;
    color: #94A3B8;
    max-width: 320px;
}

/* ===========================
   KYC Documents Repeater & Cards
   =========================== */
.doc-item-card {
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px 18px;
    position: relative;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.doc-item-card:hover {
    border-color: #CBD5E1;
    background: #FFFFFF;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.doc-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px dashed #E2E8F0;
    margin-bottom: 4px;
}

.doc-item-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

/* ===========================
   Action Confirmation Modal Dialog (Smooth Spring & Fade Animations)
   =========================== */
.action-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.22s ease-out;
}

.action-modal-backdrop.is-active {
    opacity: 1;
}

.action-modal-backdrop.is-closing {
    opacity: 0 !important;
    pointer-events: none;
}

.action-modal-card {
    width: 100%;
    max-width: 500px;
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 25px 60px -12px rgba(2, 6, 23, 0.5), 0 0 0 1px rgba(226, 232, 240, 0.9);
    position: relative;
    overflow: hidden;
    transform: scale(0.92) translateY(18px);
    opacity: 0;
    transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease-out;
}

.action-modal-backdrop.is-active .action-modal-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.action-modal-backdrop.is-closing .action-modal-card {
    transform: scale(0.93) translateY(14px) !important;
    opacity: 0 !important;
    transition: transform 0.2s ease-in, opacity 0.18s ease-in !important;
}

.action-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #F1F5F9;
    border: 0;
    color: #64748B;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.15s ease;
    z-index: 10;
}

.action-modal-close:hover {
    background: #E2E8F0;
    color: #0F172A;
}

/* ==========================================================================
   Modal Password Generator & Custom Password Styles
   ========================================================================== */
.modal-password-section {
    margin: 14px 0 10px;
    border-top: 1px solid #F1F5F9;
    padding-top: 14px;
}

.modal-segmented-control {
    display: flex;
    background: #F1F5F9;
    padding: 3px;
    border-radius: 10px;
    gap: 3px;
    margin-bottom: 12px;
}

.segmented-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    transition: all 0.18s ease;
}

.segmented-tab:hover {
    color: #0F172A;
}

.segmented-tab.active {
    background: #FFFFFF;
    color: #0F172A;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.password-mode-panel {
    animation: panelFadeSlide 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes panelFadeSlide {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auto-password-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px 14px;
}

.auto-password-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.password-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.password-value-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.password-code-display {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    font-weight: 700;
    color: #0F172A;
    background: #FFFFFF;
    padding: 4px 10px;
    border-radius: 7px;
    border: 1px solid #CBD5E1;
    letter-spacing: 0.5px;
    display: inline-block;
    min-width: 130px;
    text-align: center;
}

.btn-pass-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 7px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    font-size: 11.5px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-pass-action:hover {
    background: #F1F5F9;
    border-color: #94A3B8;
    color: #0F172A;
}

.btn-pass-action svg {
    transition: transform 0.25s ease;
}

.auto-password-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 11.5px;
    color: #64748B;
    line-height: 1.4;
}

.auto-password-note svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.custom-password-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.custom-password-label {
    font-size: 12px;
    font-weight: 700;
    color: #1E293B;
}

.custom-password-helpers {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.custom-password-hint {
    font-size: 11px;
    color: #64748B;
}

.btn-suggest-pass {
    background: none;
    border: none;
    padding: 0;
    font-size: 11px;
    font-weight: 600;
    color: #0F172A;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.15s ease;
}

.btn-suggest-pass:hover {
    color: #2563EB;
}

.action-modal-body {
    padding: 26px 26px 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.action-modal-icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-modal-icon-wrap.icon-purple {
    background: #FAF5FF;
    color: #7E22CE;
    border: 1px solid #E9D5FF;
}

.action-modal-icon-wrap.icon-red {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FEE2E2;
}

.action-modal-icon-wrap.icon-amber {
    background: #FFFBEB;
    color: #D97706;
    border: 1px solid #FEF3C7;
}

.action-modal-icon-wrap.icon-orange {
    background: #FFF7ED;
    color: #EA580C;
    border: 1px solid #FFEDD5;
}

.action-modal-icon-wrap.icon-green {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #D1FAE5;
}

.action-modal-content {
    flex: 1;
    min-width: 0;
}

.action-modal-title {
    font-size: 17px;
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}

.action-modal-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 6px;
    background: #F1F5F9;
    font-size: 12px;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 10px;
}

.action-modal-desc {
    font-size: 13px;
    color: #64748B;
    line-height: 1.55;
    margin: 0 0 12px;
}

.action-modal-warning-box {
    padding: 10px 12px;
    border-radius: 8px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #92400E;
    font-size: 11.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.action-modal-footer {
    padding: 14px 24px;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.btn-warning {
    background: #D97706;
    color: #FFFFFF;
    border: 0;
}

.btn-warning:hover {
    background: #B45309;
    color: #FFFFFF;
}

/* ==========================================================================
   Modern Toast Notification System (Custom, Smooth Fade & Slide Animations)
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 440px;
    width: calc(100vw - 36px);
}

.toast-card {
    pointer-events: auto;
    position: relative;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(226, 232, 240, 0.95);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(40px) scale(0.96);
    animation: toastSlideFadeIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideFadeIn {
    0% {
        opacity: 0;
        transform: translateX(45px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.toast-card.toast-exiting {
    opacity: 0 !important;
    transform: translateX(35px) scale(0.93) !important;
    max-height: 0 !important;
    margin-bottom: -12px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-color: transparent !important;
    transition: all 0.26s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.toast-main {
    padding: 16px 16px 14px 18px;
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.toast-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.toast-error .toast-icon-wrap {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FEE2E2;
}

.toast-success .toast-icon-wrap {
    background: #F0FDF4;
    color: #16A34A;
    border: 1px solid #DCFCE7;
}

.toast-warning .toast-icon-wrap {
    background: #FFFBEB;
    color: #D97706;
    border: 1px solid #FEF3C7;
}

.toast-info .toast-icon-wrap {
    background: #EEF2FF;
    color: #4338CA;
    border: 1px solid #E0E7FF;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 4px;
    line-height: 1.35;
    letter-spacing: -0.2px;
}

.toast-desc {
    font-size: 12.5px;
    color: #475569;
    line-height: 1.45;
    margin: 0;
}

.toast-error-list {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.toast-error-item {
    font-size: 12px;
    color: #B91C1C;
    background: #FEF2F2;
    padding: 4px 9px;
    border-radius: 6px;
    border: 1px solid #FEE2E2;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    line-height: 1.4;
}

.toast-close-btn {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: transparent;
    border: 0;
    color: #94A3B8;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
    padding: 0;
    margin-top: -2px;
    margin-right: -4px;
}

.toast-close-btn:hover {
    background: #F1F5F9;
    color: #0F172A;
}

.toast-progress-track {
    height: 3px;
    background: rgba(226, 232, 240, 0.7);
    width: 100%;
    overflow: hidden;
}

.toast-progress-fill {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: toastProgressShrink linear forwards;
}

.toast-error .toast-progress-fill {
    background: #EF4444;
}

.toast-success .toast-progress-fill {
    background: #10B981;
}

.toast-warning .toast-progress-fill {
    background: #F59E0B;
}

.toast-info .toast-progress-fill {
    background: #4F46E5;
}

@keyframes toastProgressShrink {
    0% { transform: scaleX(1); }
    100% { transform: scaleX(0); }
}

.toast-card:hover .toast-progress-fill {
    animation-play-state: paused;
}

/* ==========================================================================
   Real-Time Form Field Validation & Shake Effects
   ========================================================================== */
.form-control.is-invalid,
.auth-input.is-invalid {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

.form-control.is-valid,
.auth-input.is-valid {
    border-color: #10B981 !important;
    background-color: #F0FDF4 !important;
}

.field-error {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: #DC2626;
    margin-top: 5px;
    font-weight: 600;
    line-height: 1.35;
    animation: fieldErrorFadeIn 0.2s ease-out;
}

@keyframes fieldErrorFadeIn {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.field-shake {
    animation: inputFieldShake 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes inputFieldShake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(3px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

/* ==========================================================================
   Clean & Simple Unified Form Styling (Normal, Minimal, Enterprise-Grade)
   ========================================================================== */
.clean-form-container {
    max-width: 860px;
    margin: 18px auto 40px;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.clean-form-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.clean-form-header {
    padding: 14px 20px;
    border-bottom: 1px solid #F1F5F9;
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.clean-form-header h2 {
    font-size: 14.5px;
    font-weight: 700;
    color: #0F172A;
    margin: 0;
    letter-spacing: -0.2px;
}

.clean-form-body {
    padding: 20px;
}

.clean-avatar-row {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.clean-avatar-frame {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid #E2E8F0;
    background: #F8FAFC;
    overflow: hidden;
}

.clean-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.clean-avatar-dummy {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F1F5F9;
    color: #475569;
    font-weight: 700;
    font-size: 18px;
}

.clean-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.clean-avatar-btn-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.clean-avatar-hint {
    font-size: 11.5px;
    color: #64748B;
    margin: 0;
}

.clean-doc-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.clean-doc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.clean-doc-badge {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    background: #E2E8F0;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.clean-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 6px 0 20px;
}

/* ==========================================================================
   Clean White Profile Preview Card (Minimal, Elegant, Live-Synced)
   ========================================================================== */
.profile-preview-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.preview-live-badge {
    font-size: 11px;
    font-weight: 700;
    color: #10B981;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.preview-live-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
}

.preview-card-body {
    padding: 24px 20px 20px;
}

.preview-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 18px;
    border-bottom: 1px solid #F1F5F9;
}

.preview-avatar-frame {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin-bottom: 12px;
}

.preview-avatar-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #E2E8F0;
    display: block;
    background: #F8FAFC;
}

.preview-avatar-dummy {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #0F172A;
    color: #FFFFFF;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #E2E8F0;
}

.preview-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2.5px solid #FFFFFF;
}

.preview-status-dot.status-active {
    background: #10B981;
}

.preview-status-dot.status-inactive {
    background: #94A3B8;
}

.preview-name {
    font-size: 16px;
    font-weight: 700;
    color: #0F172A;
    margin: 0;
    letter-spacing: -0.2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-email {
    font-size: 12.5px;
    color: #64748B;
    margin: 3px 0 10px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-badges-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.clean-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2.5px 8px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.clean-badge-role {
    background: #F1F5F9;
    color: #334155;
    border: 1px solid #E2E8F0;
}

.clean-badge-success {
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
}

.clean-badge-pending {
    background: #FFFBEB;
    color: #B45309;
    border: 1px solid #FDE68A;
}

.preview-meta-list {
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding: 16px 0;
}

.preview-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    gap: 12px;
}

.preview-meta-label {
    color: #64748B;
    font-weight: 500;
    flex-shrink: 0;
}

.preview-meta-value {
    color: #0F172A;
    font-weight: 600;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

.preview-actions {
    padding-top: 14px;
    border-top: 1px solid #F1F5F9;
}

/* ==========================================================================
   Distribution Location & Coverage Component Styling
   ========================================================================== */
.pincode-fetch-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pincode-fetch-btn {
    white-space: nowrap;
    height: 40px;
    padding: 0 14px;
    flex-shrink: 0;
    font-weight: 600;
}

.pincode-spinner {
    width: 13px;
    height: 13px;
    border: 2px solid #CBD5E1;
    border-top-color: #0F172A;
    border-radius: 50%;
    animation: spinPincode 0.75s linear infinite;
    display: inline-block;
    margin-right: 5px;
    vertical-align: middle;
}

@keyframes spinPincode {
    to { transform: rotate(360deg); }
}

.pincode-status-hint {
    font-size: 11.5px;
    margin-top: 5px;
    font-weight: 500;
}

.pincode-status-hint.success {
    color: #059669;
}

.pincode-status-hint.error {
    color: #DC2626;
}

.radius-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.radius-input-wrap .radius-with-unit {
    padding-right: 48px;
}

.radius-unit-tag {
    position: absolute;
    right: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #64748B;
    pointer-events: none;
    background: #F1F5F9;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.distribution-coverage-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-left: 4px solid #0F172A;
    border-radius: 10px;
    padding: 13px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 14px;
}

.coverage-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    color: #0F172A;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.coverage-card-details {
    flex: 1;
}

.coverage-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.coverage-meters-badge {
    font-size: 11px;
    font-weight: 600;
    color: #64748B;
    background: #E2E8F0;
    padding: 1px 6px;
    border-radius: 4px;
}

.coverage-card-text {
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
}

/* ==========================================================================
   Distribution Map & Fixed Location Card (Side Preview)
   ========================================================================== */
.profile-map-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.distributor-map-frame {
    height: 260px;
    width: 100%;
    background: #F1F5F9;
    position: relative;
    z-index: 1;
}

.map-circle-tooltip {
    background: #0F172A !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 3px 8px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25) !important;
    letter-spacing: 0.3px !important;
}

.map-circle-tooltip::before {
    border-top-color: #0F172A !important;
}

.map-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
    border-bottom: 1px solid #F1F5F9;
}

.map-coords-badge {
    font-size: 11.5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 600;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 4px;
}

.map-action-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-xs {
    height: 28px;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 6px;
}

.map-hint-text {
    font-size: 11.5px;
    color: #64748B;
    padding: 8px 14px 12px;
    line-height: 1.45;
}

/* ==========================================================================
   Shop & Landmark Place Search Autocomplete
   ========================================================================== */
.position-relative {
    position: relative;
}

.shop-search-spinner {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid #CBD5E1;
    border-top-color: #0F172A;
    border-radius: 50%;
    animation: spinPincode 0.75s linear infinite;
    pointer-events: none;
    z-index: 5;
}

.shop-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
    z-index: 1000;
    max-height: 240px;
    overflow-y: auto;
}

.shop-autocomplete-item {
    padding: 9px 12px;
    cursor: pointer;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: background 0.15s ease;
}

.shop-autocomplete-item:last-child {
    border-bottom: none;
}

.shop-autocomplete-item:hover,
.shop-autocomplete-item.active {
    background: #F8FAFC;
}

.shop-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.shop-item-name {
    font-size: 13px;
    font-weight: 700;
    color: #0F172A;
}

.shop-item-tag {
    font-size: 10px;
    font-weight: 600;
    color: #4338CA;
    background: #EEF2FF;
    padding: 1.5px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.shop-item-address {
    font-size: 11.5px;
    color: #64748B;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-search-bar-wrap {
    padding: 8px 12px;
    background: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
    position: relative;
    z-index: 100;
}

.map-search-field {
    height: 34px !important;
    font-size: 12px !important;
    padding: 6px 10px !important;
}

.map-location-status {
    padding: 7px 12px;
    margin: 8px 12px 0;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeInStatus 0.2s ease;
}

@keyframes fadeInStatus {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: translateY(0); }
}

.map-location-status.success {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1D4ED8;
}

.map-location-status.warning {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #B45309;
}

.map-location-status.error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
}

.map-location-status.info {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    color: #475569;
}

/* ==========================================================================
   Multi-Step Wizard for Distributor Onboarding
   ========================================================================== */
.wizard-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Stepper Header Bar */
.wizard-stepper-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 16px 24px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.wizard-stepper-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    gap: 12px;
}

.wizard-step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
}

.wizard-step-item:hover:not(.disabled) {
    background: #F8FAFC;
}

.wizard-step-node {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #F1F5F9;
    color: #64748B;
    border: 2px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.wizard-step-item.active .wizard-step-node {
    background: #EF4444;
    color: #FFFFFF;
    border-color: #EF4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}

.wizard-step-item.completed .wizard-step-node {
    background: #10B981;
    color: #FFFFFF;
    border-color: #10B981;
}

.wizard-step-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wizard-step-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748B;
}

.wizard-step-item.active .wizard-step-label {
    color: #EF4444;
}

.wizard-step-item.completed .wizard-step-label {
    color: #10B981;
}

.wizard-step-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wizard-step-divider {
    height: 2px;
    flex: 0.4;
    background: #E2E8F0;
    margin: 0 4px;
    transition: background 0.3s ease;
}

.wizard-step-divider.filled {
    background: #10B981;
}

/* Draft Banner */
.draft-alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 12px;
    padding: 12px 18px;
    color: #1E3A8A;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    animation: slideDownDraft 0.25s ease-out;
}

@keyframes slideDownDraft {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.draft-alert-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.draft-alert-icon {
    font-size: 20px;
}

.draft-alert-title {
    font-weight: 700;
    font-size: 13px;
    color: #1E40AF;
}

.draft-alert-sub {
    font-size: 12px;
    color: #3B82F6;
    margin-top: 1px;
}

.draft-alert-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.draft-save-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #059669;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    padding: 4px 10px;
    border-radius: 999px;
}

.dot-saved-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10B981;
}

/* Wizard Panels */
.wizard-panel {
    display: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.wizard-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Wizard Action Footer */
.wizard-footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    margin-top: 20px;
}

.wizard-footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

/* Range & Custom Coverage Controls */
.range-custom-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.range-preset-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-range-preset {
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #334155;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-range-preset:hover {
    border-color: #94A3B8;
    background: #F1F5F9;
}

.btn-range-preset.active {
    background: #EF4444;
    border-color: #EF4444;
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.range-slider-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.range-slider-input {
    flex: 1;
    accent-color: #EF4444;
    height: 6px;
    border-radius: 3px;
    cursor: pointer;
}

.range-live-badge {
    background: #1E1B4B;
    color: #FFFFFF;
    padding: 5px 14px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    white-space: nowrap;
}

/* Map Embedded in Step 2 */
.step-embedded-map {
    height: 380px;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid #CBD5E1;
}

/* Summary Review Card */
.review-summary-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.review-section-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #475569;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #F1F5F9;
}

.review-item-label {
    font-size: 11.5px;
    color: #64748B;
    margin-bottom: 2px;
}

.review-item-value {
    font-size: 13.5px;
    font-weight: 700;
    color: #0F172A;
}

@media (max-width: 768px) {
    .wizard-stepper-nav {
        flex-direction: column;
        align-items: stretch;
    }
    .wizard-step-divider {
        display: none;
    }
    .review-grid-2col {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Interactive Map Drawing Tools & Dotted Measurement Line
   ========================================================================== */
.btn-draw-tool {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #334155;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-draw-tool:hover {
    background: #F1F5F9;
    border-color: #94A3B8;
}

.btn-draw-tool.active {
    background: #1E1B4B;
    border-color: #1E1B4B;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(30, 27, 75, 0.25);
}

.btn-draw-tool.btn-tool-reset {
    background: #FEF2F2;
    border-color: #FCA5A5;
    color: #DC2626;
    margin-left: auto;
}

.btn-draw-tool.btn-tool-reset:hover {
    background: #FEE2E2;
    color: #B91C1C;
}

.dotted-line-distance-badge {
    background: #0F172A !important;
    color: #FFFFFF !important;
    border: 2px solid #EF4444 !important;
    border-radius: 999px !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    padding: 3px 10px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
}

.dotted-line-distance-badge::before {
    display: none !important;
}

/* Responsive Grid adjustment so right column never overflows */
.profile-layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1240px) {
    .profile-layout-grid {
        grid-template-columns: 1fr;
    }
}
