/**
 * Prime Account - Theme to match Inventory (Prime Bazar)
 * Same colors, gradients, and layout as invest.primebazar.com
 */

:root {
    --primary: #6366F1;
    --primary-dark: #4F46E5;
    --secondary: #8B5CF6;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --light: #F3F4F6;
    --dark: #1F2937;
    --white: #FFFFFF;
    --text-light: #6B7280;

    --gradient-primary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--dark);
    background: var(--light);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ========== LOGIN PAGE ========== */
body.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
}

.login-header { text-align: center; margin-bottom: 30px; }

.login-header .logo {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--white);
    font-size: 36px;
}

.login-header h1 { font-size: 28px; font-weight: 700; color: var(--dark); margin-bottom: 5px; }
.login-header p { color: var(--text-light); font-size: 14px; }

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 8px;
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    transition: var(--transition);
    background: var(--white);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.invalid-feedback { color: var(--danger); font-size: 12px; margin-top: 5px; }

.btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-block { width: 100%; }

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-danger { background: #FEE2E2; color: #991B1B; }
.alert-success { background: #D1FAE5; color: #065F46; }
.alert-info { background: #DBEAFE; color: #1E40AF; }

/* ========== DASHBOARD LAYOUT ========== */
body.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background: #F9FAFB;
}

.sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid #E5E7EB;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
    flex-shrink: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #E5E7EB;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.sidebar-menu { padding: 20px 0; display: flex; flex-direction: column; min-height: calc(100vh - 80px); }

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
}

.menu-item:hover {
    background: #F3F4F6;
    color: var(--primary);
}

.menu-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
}

.menu-item i { font-size: 18px; width: 20px; text-align: center; }

.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--white);
    border-bottom: 1px solid #E5E7EB;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-right { display: flex; align-items: center; gap: 15px; }

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition);
}

.user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
}

.user-name { font-size: 14px; font-weight: 600; color: var(--dark); }
.user-role { font-size: 12px; color: var(--text-light); }

.content { padding: 30px; flex: 1; }

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 25px;
}

/* Stats — max 4 cards per row */
.content .stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value { font-size: 28px; font-weight: 700; color: var(--dark); }

.stat-card.primary .stat-value { color: var(--primary); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.danger .stat-value { color: var(--danger); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.info .stat-value { color: var(--info); }

/* Cards */
.card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.card-title { font-size: 18px; font-weight: 600; color: var(--dark); }

.card-body { padding: 24px; }

/* Tables */
.table-responsive { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

table thead { background: #F9FAFB; }

table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table td {
    padding: 16px;
    border-top: 1px solid #E5E7EB;
    font-size: 14px;
}

table tbody tr:hover { background: #F9FAFB; }

/* Forms in content */
.content .form-group { margin-bottom: 16px; }
.content .form-control { padding: 10px 14px; border-radius: 8px; border: 1px solid #D1D5DB; }
.content .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }
.form-text { display: block; margin-top: 6px; font-size: 12px; color: var(--text-light); }

/* Footer */
.app-footer {
    text-align: center;
    padding: 16px;
    font-size: 13px;
    color: var(--text-light);
    border-top: 1px solid #E5E7EB;
    background: var(--white);
}

.hidden { display: none !important; }

/* Pagination */
.pagination-wrap {
    margin-top: 24px;
    padding: 20px 0;
    border-top: 1px solid #E5E7EB;
}
.pagination-summary {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: var(--text-light);
}
.pagination-summary strong { color: var(--dark); }
.pagination-summary-sep { margin: 0 6px; color: #D1D5DB; }
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.pagination-numbers {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid #E5E7EB;
    background: var(--white);
    color: var(--dark);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    box-sizing: border-box;
}
.pagination-btn:hover:not(.pagination-btn--disabled):not(.pagination-btn--current) {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
}
.pagination-btn--prev,
.pagination-btn--next {
    min-width: auto;
    padding: 0 18px;
}
.pagination-btn--current {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    cursor: default;
    pointer-events: none;
}
.pagination-btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination-ellipsis {
    padding: 0 6px;
    color: var(--text-light);
    font-size: 15px;
    line-height: 44px;
}

/* Tablet: 2 cards per row */
@media (max-width: 1024px) {
    .content .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Mobile: 1 card per row */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .content .stats-grid { grid-template-columns: 1fr !important; }
    .content { padding: 15px; }
    .page-title { font-size: 22px; }
}
