@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-red: #cc0000;      /* Honda Red */
    --primary-red-hover: #990000;
    --dark-bg: #111111;
    --dark-hover: rgba(255,255,255,0.05);
    --light-bg: #f7f7f7;
    --card-bg: #ffffff;
    --text-main: #222222;
    --text-muted: #666666;
    --border-color: #dddddd;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #cc0000;
    --radius: 12px;
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.08);
    --shadow: 0 8px 24px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
    --sidebar-width: 250px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body { background-color: var(--light-bg); color: var(--text-main); }

/* === LOGIN PAGE === */
.login-container {
    height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--light-bg) 0%, #e2e8f0 100%);
}
.login-card {
    background: var(--card-bg); padding: 2.5rem; border-radius: var(--radius);
    box-shadow: var(--shadow); width: 100%; max-width: 400px; text-align: center;
    border-left: 4px solid var(--primary-red);
}
.login-card h2 { color: var(--primary-red); margin-bottom: 0.5rem; }
.login-card p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.9rem; }

/* === LAYOUT === */
.app-container { display: flex; height: 100vh; overflow: hidden; }

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-width); background-color: var(--dark-bg); color: white;
    display: flex; flex-direction: column; transition: var(--transition); z-index: 100;
}
.sidebar-header { padding: 1.5rem; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-header img { transform: scale(1.2); margin-bottom: 15px !important; }
.sidebar-header h2 { color: var(--primary-red); font-weight: 700; letter-spacing: 0.5px; }
.sidebar-header span { font-size: 0.8rem; color: #94a3b8; }

.nav-links { list-style: none; flex: 1; overflow-y: auto; padding: 1rem 0; }
.nav-links li a {
    display: flex; align-items: center; padding: 1rem 1.5rem; color: #cbd5e1;
    text-decoration: none; transition: var(--transition); font-weight: 500;
}
.nav-links li a:hover {
    background-color: var(--dark-hover); color: white;
}
.nav-links li a.active {
    background-color: rgba(204,0,0,0.1); color: white; border-left: 3px solid var(--primary-red);
}
.nav-links li a i { margin-right: 12px; font-size: 1.1rem; width: 20px; text-align: center; }

.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,0.1); }
.logout-btn {
    width: 100%; padding: 0.75rem; background: transparent; color: #cbd5e1;
    border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; cursor: pointer;
    transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.logout-btn:hover { background: rgba(204, 0, 0, 0.2); color: #ff4d4d; border-color: #ff4d4d; }

/* MAIN CONTENT */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; background-color: var(--light-bg); }
.top-header {
    background: linear-gradient(to right, var(--primary-red), var(--primary-red-hover)) !important;
    height: 60px; display: flex; align-items: center;
    justify-content: space-between; padding: 0 2rem; box-shadow: 0 2px 8px rgba(204,0,0,0.2); z-index: 10;
}
.mobile-toggle { display: none; background: none !important; border: none; font-size: 1.5rem; color: white !important; cursor: pointer; }
.user-info { display: flex; align-items: center; gap: 10px; color: white !important; font-weight: 500; }
.user-info i, .user-info span { color: white !important; opacity: 0.9; }

.page-content { flex: 1; padding: 24px; overflow-y: auto; position: relative; }
.page-content::before {
    content: "\f0dc"; /* ri-motorbike-fill */
    font-family: 'remixicon';
    position: fixed;
    right: -2%;
    bottom: -5%;
    font-size: 45vw;
    color: #000;
    opacity: 0.02;
    z-index: 0;
    pointer-events: none;
    line-height: 1;
}

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; position: relative; z-index: 1; }
.page-header h1 { font-size: 1.5rem; color: var(--text-main); font-weight: 700; }

/* === COMPONENTS (CARDS) === */
.card, .network-card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); border-left: 4px solid var(--primary-red) !important;
    transition: var(--transition); position: relative; overflow: hidden; z-index: 1;
}
.card:hover, .network-card:hover { transform: translateY(-4px) !important; box-shadow: var(--shadow) !important; }
.card::after, .network-card::after, .stat-card::after {
    content: "\f0dc"; /* ri-motorbike-fill */
    font-family: 'remixicon'; position: absolute; right: 10px; bottom: -15px;
    font-size: 80px; opacity: 0.03; color: #000; z-index: -1; pointer-events: none;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; position: relative; z-index: 1; }
.stat-card {
    background: var(--card-bg); padding: 1.5rem; border-radius: var(--radius);
    box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 15px;
    border-left: 4px solid var(--primary-red); transition: var(--transition);
    position: relative; overflow: hidden; z-index: 1;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.stat-icon { font-size: 2rem; color: var(--primary-red); opacity: 0.9; background: rgba(204,0,0,0.08); padding: 10px; border-radius: 8px; }
.stat-details h3 { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; font-weight: 600; }
.stat-details p { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }

/* === TABLES === */
.table-container {
    background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    overflow: hidden; margin-bottom: 2rem; position: relative; z-index: 1;
    border-left: 4px solid var(--primary-red); transition: var(--transition);
}
.table-container:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.table-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; background: #fff; }
.table-header h3 { color: var(--primary-red); font-weight: 700; }
.table-actions { display: flex; gap: 10px; }
.table-responsive { overflow-x: auto; width: 100%; max-height: 60vh; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; min-width: 600px; background: #fff; }
thead { background: #fafafa; position: sticky; top: 0; z-index: 5; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
th, td { padding: 12px 1.5rem; text-align: left; border-bottom: 1px solid var(--border-color); }
th { font-weight: 600; color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; }
td { color: var(--text-main); font-size: 0.95rem; }
tbody tr:nth-child(even) { background: #fcfcfc; }
tbody tr:hover { background: #f5f5f5; }

.badge { padding: 4px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.badge.showroom { background: #e0f2fe; color: #0284c7; }
.badge.network { background: #fef3c7; color: #d97706; }

/* === BUTTONS === */
.btn {
    padding: 0.5rem 1rem; border: none; border-radius: 8px; cursor: pointer;
    font-weight: 500; font-size: 0.9rem; transition: var(--transition);
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-primary { background-color: var(--primary-red); color: white; }
.btn-primary:hover { background-color: var(--primary-red-hover); box-shadow: 0 4px 8px rgba(204,0,0,0.2); }
.btn-secondary { background-color: #3b82f6; color: white; border: none; }
.btn-secondary:hover { background-color: #2563eb; color: white; box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2); }
.btn-danger { background-color: var(--primary-red); color: white; }
.btn-danger:hover { background-color: var(--primary-red-hover); }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8rem; }

/* === FORMS & INPUTS === */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-size: 0.9rem; font-weight: 500; color: var(--text-main); }
input, select, .form-control {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border-color);
    border-radius: 8px; outline: none; font-size: 0.95rem; transition: var(--transition); background: #fff;
}
input:focus, select:focus, .form-control:focus {
    border-color: var(--primary-red); box-shadow: 0 0 0 3px rgba(204, 0, 0, 0.1);
}

/* === MODALS === */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; pointer-events: none; transition: var(--transition); }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal { background: var(--card-bg); width: 90%; max-width: 500px; border-radius: var(--radius); box-shadow: var(--shadow); transform: translateY(-20px); transition: var(--transition); max-height: 90vh; display: flex; flex-direction: column; border-left: 4px solid var(--primary-red); }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 1.25rem; color: var(--primary-red); }
.close-modal { background: none !important; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); padding: 0; margin: 0; }
.close-modal:hover { color: var(--danger); box-shadow: none; background: transparent; }
.modal-body { padding: 1.5rem; overflow-y: auto; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 10px; background: #f8fafc; border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }

/* === FILTERS === */
.filters {
    display: flex; gap: 15px; margin-bottom: 1.5rem; align-items: center;
    background: var(--card-bg); padding: 1rem 1.5rem; border-radius: var(--radius);
    box-shadow: var(--shadow-sm); flex-wrap: wrap; border-left: 4px solid var(--primary-red);
    transition: var(--transition); position: relative; z-index: 1;
}
.filters:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

/* === ALERTS === */
.alert { padding: 1rem; border-radius: 8px; margin-bottom: 1rem; display: none; }
.alert-error { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); display: none; }
.alert-success { background: #dcfce3; color: #166534; display: none; border-left: 4px solid var(--success); }
#loginError.show { display: block; }
.show-alert { display: block; }

@media (max-width: 768px) {
    .sidebar { position: fixed; left: -var(--sidebar-width); height: 100vh; }
    .sidebar.open { left: 0; }
    .mobile-toggle { display: block; }
    .top-header { padding: 0 1rem; }
    .page-content { padding: 1rem; }
    .filters { flex-direction: column; align-items: stretch; }
    .modal { margin: 10px; max-height: 95vh; }
}

/* === CURRENCY INPUT === */
.input-with-prefix { position: relative; display: flex; align-items: center; }
.input-with-prefix .prefix { position: absolute; left: 12px; color: var(--text-muted); font-weight: 600; pointer-events: none; }
.input-with-prefix .form-control { padding-left: 28px; }

