/* =================================================================
   Portal AeN - Global V2 Design System
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    /* Core palette */
    --v2-navy: #0a0f1c;
    --v2-navy-mid: #131b2e;
    --v2-navy-light: #1a1040;
    --v2-purple: #7c3aed;
    --v2-indigo: #6366f1;
    --v2-blue: #3b82f6;

    /* Semantic Colors */
    --v2-success: #10b981;
    --v2-warning: #f59e0b;
    --v2-danger: #ef4444;
    --v2-info: #3b82f6;

    /* Surfaces */
    --v2-surface: #f8fafc;
    --v2-card-bg: #ffffff;
    --v2-border: #e2e8f0;
    --v2-text: #1e293b;
    --v2-text-muted: #64748b;
    --v2-frost: rgba(255, 255, 255, 0.08);

    /* Radius */
    --v2-radius: 14px;
    --v2-radius-sm: 8px;
    --v2-radius-pill: 999px;

    /* Shadows */
    --v2-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --v2-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --v2-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);

    /* Transitions */
    --v2-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets for V2 elements */
.v2-theme {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    color: var(--v2-text);
    background-color: var(--v2-surface);
}

.v2-theme * {
    font-family: inherit;
}

/* -----------------------------------------------------------------
   REUSABLE UTILITIES
   ----------------------------------------------------------------- */

/* Modern Cards */
.v2-card {
    background: var(--v2-card-bg);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    box-shadow: var(--v2-shadow-sm);
    transition: transform 0.2s var(--v2-ease), box-shadow 0.2s var(--v2-ease);
    padding: 1.5rem;
}

.v2-card--hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--v2-shadow);
}

/* Glassmorphism / Frost effects */
.v2-glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.v2-glass-dark {
    background: rgba(10, 15, 28, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* V2 Badges */
.v2-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--v2-radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.v2-badge--success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--v2-success);
}

.v2-badge--warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--v2-warning);
}

.v2-badge--danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--v2-danger);
}

.v2-badge--info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--v2-info);
}

.v2-badge--neutral {
    background: rgba(148, 163, 184, 0.1);
    color: var(--v2-text-muted);
}

/* V2 Buttons */
.v2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--v2-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s var(--v2-ease);
    border: 1px solid transparent;
}

.v2-btn-primary {
    background: var(--v2-indigo);
    color: #fff;
    border: none;
}

.v2-btn-primary:hover {
    background: var(--v2-purple);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.v2-btn-outline {
    background: transparent;
    border: 1px solid var(--v2-border);
    color: var(--v2-text);
}

.v2-btn-outline:hover {
    background: var(--v2-surface);
    border-color: var(--v2-indigo);
    color: var(--v2-indigo);
}

/* Dynamic Gradients */
.v2-grad-main {
    background: linear-gradient(135deg, var(--v2-navy) 0%, var(--v2-navy-mid) 40%, var(--v2-navy-light) 100%);
}

.v2-grad-purple {
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
}

/* Animations from V2 */
@keyframes v2-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.v2-animate-fade-up {
    animation: v2-fade-up 0.5s var(--v2-ease) both;
}

/* -----------------------------------------------------------------
   AUTH PAGES (LOGIN / REGISTER)
   ----------------------------------------------------------------- */
.v2-auth-screen {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: #fff;
}

.v2-auth-visual {
    flex: 1;
    background: linear-gradient(135deg, var(--v2-navy) 0%, var(--v2-navy-mid) 40%, var(--v2-navy-light) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.v2-auth-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.v2-auth-visual__content {
    position: relative;
    z-index: 2;
    max-width: 480px;
    text-align: center;
}

.v2-auth-visual__logo {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--v2-indigo);
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.4));
}

.v2-auth-visual__title {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.v2-auth-visual__text {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

.v2-auth-form-container {
    width: 100%;
    max-width: 550px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    background: #fff;
    position: relative;
    z-index: 10;
}

.v2-auth-form-box {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.v2-auth-form-header {
    margin-bottom: 2.5rem;
}

.v2-auth-form-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--v2-navy);
    margin-bottom: 0.5rem;
}

.v2-auth-form-subtitle {
    color: var(--v2-text-muted);
    font-size: 0.95rem;
}

.v2-auth-form-box .form-control {
    padding: 0.75rem 1rem;
    border-radius: var(--v2-radius-sm);
    border: 1px solid var(--v2-border);
    background: #fcfdfe;
    font-size: 0.95rem;
    transition: all 0.2s var(--v2-ease);
}

.v2-auth-form-box .form-control:focus {
    background: #fff;
    border-color: var(--v2-indigo);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.v2-auth-form-box .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--v2-text);
    margin-bottom: 0.5rem;
}

@media (max-width: 991px) {
    .v2-auth-visual {
        display: none;
    }

    .v2-auth-form-container {
        max-width: 100%;
        padding: 2rem;
    }
}

/* -----------------------------------------------------------------
   SUPPLIER HUB & DASHBOARD ELEMENTS
   ----------------------------------------------------------------- */

.v2-hub-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--v2-navy);
    letter-spacing: -0.5px;
}

.v2-info-card {
    background: #fff;
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s var(--v2-ease);
    text-decoration: none !important;
    color: inherit;
    height: 100%;
}

.v2-info-card:hover {
    border-color: var(--v2-indigo);
    box-shadow: var(--v2-shadow);
    transform: translateY(-2px);
}

.v2-info-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--v2-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--v2-indigo);
    flex-shrink: 0;
}

.v2-info-card__content h6 {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
}

.v2-info-card__content p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--v2-text-muted);
}

/* -----------------------------------------------------------------
   WIZARD & STEPPERS
   ----------------------------------------------------------------- */

.v2-stepper {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 3rem;
    padding: 0 2rem;
}

.v2-stepper::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 4rem;
    right: 4rem;
    height: 2px;
    background: var(--v2-border);
    z-index: 0;
}

.v2-step {
    position: relative;
    z-index: 1;
    background: #fff;
    padding: 0 1rem;
    text-align: center;
    flex: 1;
}

.v2-step__icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--v2-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-weight: 700;
    color: var(--v2-text-muted);
    transition: all 0.3s var(--v2-ease);
}

.v2-step.active .v2-step__icon {
    border-color: var(--v2-indigo);
    background: var(--v2-indigo);
    color: #fff;
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.15);
}

.v2-step.completed .v2-step__icon {
    border-color: var(--v2-success);
    background: var(--v2-success);
    color: #fff;
}

.v2-step__label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--v2-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.v2-step.active .v2-step__label {
    color: var(--v2-indigo);
}

/* -----------------------------------------------------------------
   MODERN TABLES
   ----------------------------------------------------------------- */

.v2-table-card {
    border-radius: var(--v2-radius);
    overflow: hidden;
    border: 1px solid var(--v2-border);
    box-shadow: var(--v2-shadow-sm);
    background: #fff;
}

.v2-table thead th {
    background: #fcfdfe;
    border-bottom: 1px solid var(--v2-border);
    color: var(--v2-text-muted);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.25rem;
}

.v2-table tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.v2-table tr:last-child td {
    border-bottom: none;
}

.v2-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Supplier Hub Special Action Cards */
.v2-action-card {
    background: #fff;
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    padding: 2rem;
    text-align: center;
    height: 100%;
    transition: all 0.3s var(--v2-ease);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none !important;
}

.v2-action-card:hover {
    border-color: var(--v2-indigo);
    box-shadow: var(--v2-shadow-lg);
    transform: translateY(-5px);
}

.v2-action-card__icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--v2-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.5rem;
    color: var(--v2-indigo);
    transition: all 0.3s var(--v2-ease);
}

.v2-action-card:hover .v2-action-card__icon {
    background: var(--v2-indigo);
    color: #fff;
    transform: scale(1.1);
}

.v2-action-card__title {
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--v2-navy);
}

.v2-action-card__text {
    font-size: 0.85rem;
    color: var(--v2-text-muted);
    line-height: 1.5;
}

/* -----------------------------------------------------------------
   ADMIN SIDEBAR & LAYOUT
   ----------------------------------------------------------------- */

.v2-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: #fff;
    border-right: 1px solid var(--v2-border);
    z-index: 1040;
    overflow-y: auto;
    transition: all 0.3s var(--v2-ease);
    display: flex;
    flex-direction: column;
}

.v2-sidebar-brand {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--v2-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--v2-navy);
    font-weight: 800;
    text-decoration: none !important;
}

.v2-sidebar-brand i {
    font-size: 1.5rem;
    color: var(--v2-indigo);
}

.v2-sidebar-nav {
    flex-grow: 1;
    padding: 1rem;
}

.v2-sidebar-header {
    padding: 1.5rem 1rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--v2-text-muted);
    letter-spacing: 1px;
}

.v2-sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--v2-text-main);
    text-decoration: none !important;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 2px;
    transition: all 0.2s;
}

.v2-sidebar-link i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 0.75rem;
    color: var(--v2-text-muted);
    transition: all 0.2s;
}

.v2-sidebar-link:hover {
    background: var(--v2-surface);
}

.v2-sidebar-link.active {
    background: var(--v2-indigo-tint);
    color: var(--v2-indigo) !important;
}

.v2-sidebar-link.active i {
    color: var(--v2-indigo);
}

/* Retractable Sidebar Variants */
.v2-sidebar.collapsed {
    width: 80px;
}

.v2-sidebar.collapsed .v2-sidebar-brand span,
.v2-sidebar.collapsed .v2-sidebar-header,
.v2-sidebar.collapsed .v2-sidebar-link span,
.v2-sidebar.collapsed .v2-sidebar-footer span {
    display: none;
}

.v2-sidebar.collapsed .v2-sidebar-brand {
    padding: 1.5rem 0;
    justify-content: center;
}

.v2-sidebar.collapsed .v2-sidebar-link {
    justify-content: center;
    padding: 0.75rem 0;
}

.v2-sidebar.collapsed .v2-sidebar-link i {
    margin-right: 0;
    font-size: 1.4rem;
}

.v2-sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--v2-border);
}

/* Top Header for Sidebar Layout */
.v2-top-header {
    position: fixed;
    top: 0;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--v2-border);
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    transition: all 0.3s var(--v2-ease);
}

.v2-sidebar-toggle {
    display: block;
    /* Shown on desktop too for collapse */
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--v2-navy);
    cursor: pointer;
    transition: transform 0.3s var(--v2-ease);
}

.sidebar-collapsed .v2-sidebar-toggle {
    transform: rotate(180deg);
}

/* Layout logic */
.v2-has-sidebar {
    padding-top: 70px;
}

.v2-has-sidebar .v2-main-wrapper {
    margin-left: 280px;
    padding: 2rem;
    transition: all 0.3s var(--v2-ease);
}

.v2-has-sidebar .v2-top-header {
    left: 280px;
}

/* Collapsed Layout State */
.sidebar-collapsed .v2-main-wrapper {
    margin-left: 80px;
}

.sidebar-collapsed .v2-top-header {
    left: 80px;
}

@media (max-width: 991.98px) {
    .v2-sidebar {
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    }

    .v2-sidebar.show {
        transform: translateX(0);
    }

    .v2-has-sidebar .v2-main-wrapper {
        margin-left: 0;
    }

    .v2-has-sidebar .v2-top-header {
        left: 0;
        width: 100%;
    }

    .v2-sidebar-toggle {
        display: block;
    }
}

/* -----------------------------------------------------------------
   METRIC CARDS
   ----------------------------------------------------------------- */

.v2-metric-card {
    background: #fff;
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    padding: 1.5rem;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--v2-ease);
}

.v2-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--v2-shadow);
}

.v2-metric-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.v2-metric-card__label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--v2-text-muted);
    letter-spacing: 0.5px;
}

.v2-metric-card__value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--v2-navy);
    line-height: 1;
}

.v2-metric-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--v2-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--v2-indigo);
}

.v2-metric-card--primary .v2-metric-card__icon {
    color: var(--v2-indigo);
    background: var(--v2-indigo-tint);
}

.v2-metric-card--success .v2-metric-card__icon {
    color: var(--v2-success);
    background: var(--v2-success-tint);
}

/* -----------------------------------------------------------------
   FILTERS & SEARCH
   ----------------------------------------------------------------- */

.v2-filter-list {
    display: flex;
    flex-direction: column;
}

.v2-filter-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--v2-text-main);
    transition: all 0.2s;
    text-align: left;
}

.v2-filter-btn:hover {
    background: var(--v2-surface);
}

.v2-filter-btn.active {
    background: var(--v2-indigo-tint);
    color: var(--v2-indigo);
}

.v2-search-input {
    position: relative;
    width: 100%;
}

.v2-search-input i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--v2-text-muted);
    font-size: 0.9rem;
}

.v2-search-input input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: 12px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.v2-search-input input:focus {
    background: #fff;
    border-color: var(--v2-indigo);
    outline: none;
    box-shadow: 0 0 0 4px var(--v2-indigo-tint);
}

.v2-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--v2-text-muted);
    letter-spacing: 0.5px;
}


.v2-metric-card--danger .v2-metric-card__icon {
    color: var(--v2-error);
    background: var(--v2-error-tint);
}

.v2-metric-card--warning .v2-metric-card__icon {
    color: var(--v2-warning);
    background: var(--v2-warning-tint);
}

.v2-metric-card__footer {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--v2-text-muted);
}

/* -----------------------------------------------------------------
   V2 TABS
   ----------------------------------------------------------------- */

.v2-tabs {
    gap: 1.5rem;
}

.v2-tab-link {
    background: transparent !important;
    border: none !important;
    padding: 1rem 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--v2-text-muted) !important;
    position: relative;
    transition: all 0.2s;
    border-bottom: 2px solid transparent !important;
}

.v2-tab-link:hover {
    color: var(--v2-text-main) !important;
}

.v2-tab-link.active {
    color: var(--v2-indigo) !important;
    border-bottom-color: var(--v2-indigo) !important;
}

/* -----------------------------------------------------------------
   DROPDOWNS & SELECTS
   ----------------------------------------------------------------- */

.v2-dropdown-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--v2-border);
    border-radius: 12px;
    box-shadow: var(--v2-shadow-lg);
    z-index: 1100;
    max-height: 250px;
    overflow-y: auto;
    margin-top: 5px;
}

.v2-dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.v2-dropdown-item:hover {
    background: var(--v2-surface);
}

.v2-select {
    padding: 0.6rem 1rem;
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.v2-select:focus {
    border-color: var(--v2-indigo);
    box-shadow: 0 0 0 4px var(--v2-indigo-tint);
    outline: none;
}

/* Process List Item */
.v2-process-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--v2-border);
    cursor: pointer;
    transition: all 0.2s;
}

.v2-process-item:hover {
    background: var(--v2-surface);
}

.v2-process-item.active {
    background: var(--v2-indigo-tint);
    border-left: 4px solid var(--v2-indigo);
}