/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #0096ff;
    --primary-light: rgba(0, 150, 255, 0.08);
    --bg-main: #f5f8fc;
    --text-color: #3b4c68;
    --text-muted: #8a9bb5;
    --border-color: #e8eff7;
    --white: #ffffff;
    --font-sans: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    color: var(--text-color);
    background-color: var(--bg-main);
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   1. AUTHENTICATION PAGES (Login / Grid Background)
   ========================================================================== */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f1f7fd;
    background-image: 
        linear-gradient(rgba(0, 150, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 150, 255, 0.035) 1px, transparent 1px);
    background-size: 32px 32px;
    background-position: center center;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

.auth-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 100, 255, 0.06), 0 5px 15px rgba(0, 0, 0, 0.02);
    padding: 40px;
    border: 1px solid var(--border-color);
}

.auth-logo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.xeloro-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #1a2f4c;
    text-decoration: none;
}

.logo-icon {
    position: relative;
    width: 26px;
    height: 26px;
    border: 4px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon::after {
    content: '';
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.auth-title {
    font-size: 16px;
    color: #4a5a70;
    font-weight: 700;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

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

.form-control {
    width: 100%;
    height: 44px;
    background-color: #fafcfe;
    border: 1px solid #d9e3f0;
    border-radius: 6px;
    padding: 0 16px;
    font-size: 14px;
    color: #1a2f4c;
    font-family: var(--font-sans);
    transition: all 0.2s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 150, 255, 0.15);
    background-color: var(--white);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 25px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
}

.checkbox-input {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid #d9e3f0;
    cursor: pointer;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-primary {
    width: 100%;
    height: 44px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 6px;
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background-color: #0084e6;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 25px 0;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e6eef7;
    z-index: 1;
}

.auth-divider span {
    position: relative;
    z-index: 2;
    background-color: var(--white);
    padding: 0 15px;
    font-size: 12px;
    font-weight: 600;
    color: #a0aec0;
}

.auth-footer-text {
    text-align: center;
    font-size: 13px;
    color: #64748b;
    margin-top: 10px;
}

.auth-footer-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

.auth-footer-text a:hover {
    text-decoration: underline;
}

/* Alert Styling */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-danger {
    background-color: #fff1f2;
    border: 1px solid #ffe4e6;
    color: #e11d48;
}

/* ==========================================================================
   2. DASHBOARD LAYOUT & SIDEBAR
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar styling */
.sidebar {
    width: 250px;
    background-color: var(--white);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 25px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 15px;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1.2px;
    margin: 20px 0 10px 10px;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu-item {
    margin-bottom: 5px;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    color: #5d6f88;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
}

.sidebar-menu-link:hover {
    color: var(--primary-color);
    background-color: #fafcfe;
}

.sidebar-menu-link.active {
    color: var(--primary-color);
    background-color: var(--primary-light);
    font-weight: 600;
}

.menu-link-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-link-left i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.menu-badge {
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
}

.menu-badge.badge-pink {
    background-color: #ffe4e6;
    color: #e11d48;
}

.menu-badge.badge-orange {
    background-color: #fef3c7;
    color: #d97706;
}

.menu-arrow {
    font-size: 10px;
    opacity: 0.6;
}

/* Main Content wrapper */
.main-wrapper {
    margin-left: 250px;
    width: calc(100% - 250px);
    display: flex;
    flex-direction: column;
}

/* Header Navbar */
.header {
    height: 70px;
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    border: none;
    background-color: #f5f8fc;
    color: #5d6f88;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: #eef3fb;
    color: var(--primary-color);
}

.create-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #f5f8fc;
    border: 1px solid #e2edf9;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #4a5a70;
    cursor: pointer;
}

.create-dropdown:hover {
    background-color: #eef3fb;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #f5f8fc;
    border-radius: 6px;
    padding: 0 12px;
    width: 240px;
    height: 38px;
}

.search-bar input {
    border: none;
    background: transparent;
    padding-left: 8px;
    font-size: 13px;
    color: var(--text-color);
    width: 100%;
}

.search-bar input:focus {
    outline: none;
}

.search-bar i {
    color: var(--text-muted);
    font-size: 14px;
}

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

.flag-icon {
    width: 20px;
    border-radius: 2px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 5px;
    border-radius: 6px;
}

.user-profile:hover {
    background-color: #f5f8fc;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #1a2f4c;
}

/* Page content wrapper */
.content-body {
    padding: 30px;
    background-color: var(--bg-main);
    flex-grow: 1;
}

/* Breadcrumbs & Title */
.page-title-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a2f4c;
}

.breadcrumb-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-muted);
}

.breadcrumb-container a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb-container a:hover {
    color: var(--primary-color);
}

.breadcrumb-sep {
    font-size: 8px;
    opacity: 0.5;
}

/* ==========================================================================
   3. STAT CARDS ROW
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.01);
    position: relative;
    overflow: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--accent-color, var(--primary-color));
}

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

.stat-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.stat-badge-cyan {
    background-color: #ecfdf5;
    color: #059669;
}

.stat-badge-blue {
    background-color: #eff6ff;
    color: #2563eb;
}

.stat-badge-pink {
    background-color: #fff1f2;
    color: #e11d48;
}

.stat-badge-purple {
    background-color: #f5f3ff;
    color: #7c3aed;
}

.stat-card-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #1a2f4c;
}

.stat-trend {
    font-size: 12.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up {
    color: #10b981;
}

.trend-down {
    color: #f43f5e;
}

/* ==========================================================================
   4. CHARTS SECTION
   ========================================================================== */
.charts-grid {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: 20px;
    margin-bottom: 25px;
}

.chart-card {
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.01);
    padding: 20px;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #f5f8fc;
    padding-bottom: 15px;
}

.chart-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a2f4c;
}

.chart-dots-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
}

.chart-dots-btn:hover {
    color: var(--text-color);
}

.chart-canvas-container {
    position: relative;
    width: 100%;
}

/* ==========================================================================
   5. TABLES SECTION
   ========================================================================== */
.tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.table-card {
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.01);
    padding: 20px;
}

.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #f5f8fc;
    padding-bottom: 15px;
}

.table-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a2f4c;
}

.table-card-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.table-card-link:hover {
    text-decoration: underline;
}

.custom-table-responsive {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.5px;
}

.custom-table td {
    padding: 14px 8px;
    border-bottom: 1px solid #f6fafc;
    font-size: 13px;
    color: #4a5a70;
    vertical-align: middle;
}

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

.product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-avatar {
    width: 34px;
    height: 34px;
    background-color: var(--bg-main);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 14px;
}

.product-name {
    font-weight: 600;
    color: #1a2f4c;
    font-size: 13px;
}

.badge {
    padding: 3px 8px;
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 4px;
    display: inline-block;
}

.badge-success {
    background-color: #ecfdf5;
    color: #10b981;
}

.badge-warning {
    background-color: #fffbeb;
    color: #f59e0b;
}

.badge-danger {
    background-color: #fff1f2;
    color: #f43f5e;
}

.company-logo-txt {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f0f7ff;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.seller-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seller-name {
    font-weight: 600;
    color: #1a2f4c;
}

.seller-ceo {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Responsive Grid Adjustments */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .tables-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
