/**
 * RodRadar Customer Portal - Modern E-commerce Style
 * Version 2.0 - Brand Color #DD5041
 */

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

/* ========================================
   CSS Variables - Brand Color #DD5041
======================================== */
:root {
    /* Brand Colors - Based on #DD5041 */
    --primary: #DD5041;
    --primary-dark: #c43d2f;
    --primary-light: #e8675a;
    --primary-lighter: #fdf2f1;
    --secondary: #64748b;
    --accent: #DD5041;
    
    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Sidebar - Dark with brand accent */
    --sidebar-bg: #1a1a2e;
    --sidebar-hover: #2d2d44;
    --sidebar-active: #DD5041;
    --sidebar-text: #a0a0b8;
    --sidebar-width: 260px;
    
    /* Layout */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition: all 0.2s ease;
}

/* ========================================
   Base
======================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--gray-100);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--gray-900);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ========================================
   Sidebar
======================================== */
.sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--gray-600); border-radius: 3px; }

.sidebar-logo {
    padding: 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    background: rgba(0,0,0,0.2);
}

.sidebar-logo a {
    display: block;
}

.sidebar-logo img { 
    max-width: 220px;
    width: 100%;
    height: auto;
}

.sidebar-logo .logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.5px;
}

.sidebar-logo .logo-text span { color: var(--primary); }

.sidebar-nav { 
    padding: 16px 0;
    flex: 1;
}

.nav-section-title {
    padding: 12px 20px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--sidebar-text);
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    margin: 2px 0;
}

.nav-link i { width: 20px; margin-right: 12px; font-size: 1.1rem; opacity: 0.7; }
.nav-link:hover { background: var(--sidebar-hover); color: var(--white); }
.nav-link:hover i { opacity: 1; }

.nav-link.active {
    background: linear-gradient(90deg, var(--sidebar-active) 0%, rgba(221,80,65,0.1) 100%);
    color: var(--white);
    border-left-color: var(--primary);
}

.nav-link.active i { opacity: 1; color: var(--white); }
.nav-link .badge { margin-left: auto; font-size: 11px; padding: 2px 8px; }

.sidebar-user {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.2);
}

.sidebar-user .user-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    color: var(--white);
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user .user-info { flex: 1; margin-left: 12px; min-width: 0; }
.sidebar-user .user-name { 
    color: var(--white); 
    font-weight: 600; 
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user .user-role { color: var(--gray-400); font-size: 12px; }

/* ========================================
   Main Content
======================================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--gray-100);
    display: flex;
    flex-direction: column;
}

.page-header {
    background: var(--white);
    padding: 20px 32px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.page-title small {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 400;
    margin-left: 8px;
}

.page-content { 
    padding: 32px;
    flex: 1;
}

/* ========================================
   Cards
======================================== */
.card {
    background: var(--white);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 20px;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header i { color: var(--primary); margin-right: 8px; }
.card-body { padding: 20px; }
.card-footer { background: var(--gray-50); border-top: 1px solid var(--gray-200); padding: 16px 20px; }

/* Stats Cards */
.stats-card .card-body { padding: 24px; }

.stats-card .stats-icon {
    width: 56px; height: 56px;
    border-radius: var(--border-radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 16px;
}

.stats-card .stats-icon.primary { background: rgba(221,80,65,0.1); color: var(--primary); }
.stats-card .stats-icon.success { background: rgba(16,185,129,0.1); color: var(--success); }
.stats-card .stats-icon.warning { background: rgba(245,158,11,0.1); color: var(--warning); }
.stats-card .stats-icon.danger { background: rgba(239,68,68,0.1); color: var(--danger); }
.stats-card .stats-icon.info { background: rgba(6,182,212,0.1); color: var(--info); }

.stats-card .stats-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 4px;
}

.stats-card .stats-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* ========================================
   Buttons
======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn i { font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-secondary { background: var(--gray-600); color: var(--white); }
.btn-secondary:hover { background: var(--gray-700); color: var(--white); }

.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #059669; color: var(--white); }

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

.btn-warning { background: var(--warning); color: var(--gray-900); }

.btn-outline-primary { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: var(--white); }

.btn-outline-secondary { background: transparent; border: 1px solid var(--gray-300); color: var(--gray-600); }
.btn-outline-secondary:hover { background: var(--gray-100); border-color: var(--gray-400); color: var(--gray-700); }

.btn-outline-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: var(--white); }

/* ========================================
   Forms
======================================== */
.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
    font-size: 0.875rem;
}

.form-control, .form-select {
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    transition: var(--transition);
    background: var(--white);
    color: var(--gray-800);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(221,80,65,0.1);
    outline: none;
}

.form-control::placeholder { color: var(--gray-400); }
.form-control-sm { padding: 6px 10px; font-size: 13px; }
textarea.form-control { min-height: 100px; resize: vertical; }

.form-check-input {
    width: 18px; height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ========================================
   Tables
======================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 2px solid var(--gray-200);
    text-align: left;
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.table tbody tr { transition: var(--transition); }
.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr:last-child td { border-bottom: none; }

.table tfoot td {
    padding: 14px 16px;
    font-weight: 600;
    background: var(--gray-50);
}

.table-primary { background: rgba(221,80,65,0.05) !important; }
.table-light { background: var(--gray-50) !important; }

/* ========================================
   Badges
======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge.bg-primary { background: rgba(221,80,65,0.1) !important; color: var(--primary) !important; }
.badge.bg-secondary { background: rgba(100,116,139,0.1) !important; color: var(--secondary) !important; }
.badge.bg-success { background: rgba(16,185,129,0.1) !important; color: var(--success) !important; }
.badge.bg-danger { background: rgba(239,68,68,0.1) !important; color: var(--danger) !important; }
.badge.bg-warning { background: rgba(245,158,11,0.1) !important; color: #b45309 !important; }
.badge.bg-info { background: rgba(6,182,212,0.1) !important; color: var(--info) !important; }
.badge.bg-dark { background: rgba(15,23,42,0.1) !important; color: var(--gray-800) !important; }

/* ========================================
   Alerts
======================================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border: none;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert i { font-size: 1.25rem; flex-shrink: 0; margin-top: 2px; }
.alert-success { background: rgba(16,185,129,0.1); color: #065f46; }
.alert-danger { background: rgba(239,68,68,0.1); color: #991b1b; }
.alert-warning { background: rgba(245,158,11,0.1); color: #92400e; }
.alert-info { background: rgba(6,182,212,0.1); color: #0e7490; }

/* ========================================
   Dropdown
======================================== */
.dropdown-menu {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    min-width: 200px;
}

.dropdown-item {
    padding: 10px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.dropdown-item i { width: 18px; color: var(--gray-500); }
.dropdown-item:hover { background: var(--gray-100); color: var(--gray-900); }
.dropdown-divider { margin: 8px 0; border-color: var(--gray-200); }

/* ========================================
   Modal
======================================== */
.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 20px 24px;
}

.modal-title { font-weight: 600; color: var(--gray-900); }
.modal-body { padding: 24px; }
.modal-footer { border-top: 1px solid var(--gray-200); padding: 16px 24px; gap: 12px; }

/* ========================================
   Product Cards
======================================== */
.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-card .product-image {
    height: 180px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card .product-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.product-card .product-image i { font-size: 4rem; color: var(--gray-300); }

.product-card .product-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card .product-category {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 4px;
}

.product-card .product-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.product-card .product-sku { font-size: 12px; color: var(--gray-500); margin-bottom: 12px; }

.product-card .product-price {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.product-card .price-value { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.product-card .price-label { font-size: 11px; color: var(--gray-500); text-transform: uppercase; }

/* ========================================
   Document Header
======================================== */
.document-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 24px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.document-header .doc-number { font-size: 1.5rem; font-weight: 700; }

.document-header .doc-type {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.address-box {
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    height: 100%;
}

.address-box h6 {
    color: var(--gray-500);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.address-box h6 i { color: var(--primary); }

/* ========================================
   Login Page
======================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 20px;
}

.login-container { width: 100%; max-width: 420px; }

.login-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 40px 30px;
    text-align: center;
    color: var(--white);
}

.login-header .logo { 
    max-width: 250px;
    width: 100%;
    height: auto;
    margin-bottom: 16px; 
}

.login-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--white); margin: 0; }
.login-header p { margin: 8px 0 0; opacity: 0.9; font-size: 14px; }

.login-body { padding: 40px 30px; }
.login-body .form-group { margin-bottom: 20px; }
.login-body .btn-primary { width: 100%; padding: 14px; font-size: 16px; font-weight: 600; }

/* ========================================
   Utilities
======================================== */
.text-muted { color: var(--gray-500) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }

/* ========================================
   Responsive
======================================== */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .page-content { padding: 20px; }
}

@media (max-width: 576px) {
    .page-header {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .card-body { padding: 16px; }
}

/* ========================================
   Print
======================================== */
@media print {
    .sidebar, .page-header, .btn, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}
