/* ----------------------------------------------------
   MotoStock Pro - Premium Styling Sheet
   Design System: Slate Dark Theme with Vibrant Accents
---------------------------------------------------- */

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

:root {
    /* Color Palette */
    --bg-main: #0b0f19;
    --bg-card: rgba(23, 32, 53, 0.65);
    --bg-card-hover: rgba(30, 41, 68, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(59, 130, 246, 0.4);
    
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.25);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.2);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.2);
    --purple: #8b5cf6;
    --purple-glow: rgba(139, 92, 246, 0.2);

    /* Text Colors */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;

    /* Fonts */
    --font-heading: 'Outfit', 'Sarabun', sans-serif;
    --font-body: 'Sarabun', 'Outfit', sans-serif;

    /* Transitions & Shadows */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    
    /* Layout properties */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Typography & Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* ----------------------------------------------------
   1. AUTHENTICATION / LOGIN SCREEN
---------------------------------------------------- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    transform: translateY(0);
    transition: var(--transition);
    animation: fadeIn 0.6s ease-out;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.login-logo svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.login-card h2 {
    font-size: 28px;
    margin-bottom: 8px;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.input-icon svg {
    width: 18px;
    height: 18px;
}

.form-control {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 15px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: rgba(15, 23, 42, 0.8);
}

.btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px var(--danger-glow);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
    display: none;
    animation: shake 0.4s ease;
}

/* Credentials Help Box */
.credentials-help {
    margin-top: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: left;
}

.credentials-help strong {
    color: var(--text-main);
}

.credentials-help ul {
    margin-top: 8px;
    padding-left: 16px;
}

.credentials-help li {
    margin-bottom: 4px;
}

/* ----------------------------------------------------
   2. APP LAYOUT
---------------------------------------------------- */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navigation Header */
.app-header {
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.brand-logo svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.role-badge {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.role-admin {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
}

.role-sell {
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.1);
}

.btn-logout {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Tabs Bar */
.tabs-navigation {
    background: rgba(15, 23, 42, 0.4);
    border-bottom: 1px solid var(--border-color);
}

.tabs-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 8px;
}

.tab-btn {
    padding: 16px 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn svg {
    width: 18px;
    height: 18px;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    box-shadow: 0 -2px 10px var(--primary);
}

/* Main Content Area */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px 64px 24px;
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ----------------------------------------------------
   3. OVERVIEW PAGE (หน้าภาพรวม)
---------------------------------------------------- */
.overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 20px;
}

.overview-title h2 {
    font-size: 26px;
    margin-bottom: 4px;
}

.overview-title p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Date Filter Panel */
.filter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.filter-group input[type="date"] {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.filter-group input[type="date"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.date-preset-btn {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.date-preset-btn:hover, .date-preset-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px var(--primary-glow);
}

/* KPI Summary Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.kpi-card.kpi-total::before { background: var(--purple); }
.kpi-card.kpi-ready::before { background: var(--success); }
.kpi-card.kpi-repair::before { background: var(--warning); }
.kpi-card.kpi-sold::before { background: var(--danger); }

.kpi-card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-total .kpi-icon { background: var(--purple-glow); color: var(--purple); }
.kpi-ready .kpi-icon { background: var(--success-glow); color: var(--success); }
.kpi-repair .kpi-icon { background: var(--warning-glow); color: var(--warning); }
.kpi-sold .kpi-icon { background: var(--danger-glow); color: var(--danger); }

.kpi-icon svg {
    width: 20px;
    height: 20px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 4px;
}

.kpi-footer {
    font-size: 12px;
    color: var(--text-muted);
}

/* Statistics Summary Cards (Monthly / Date-Filtered Metrics) */
.stats-section-title {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stats-card {
    background: rgba(17, 24, 39, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stats-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(17, 24, 39, 0.6);
}

.stats-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stats-card.stats-received .stats-icon-wrapper {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.stats-card.stats-repaired .stats-icon-wrapper {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.stats-card.stats-sales .stats-icon-wrapper {
    background: rgba(139, 92, 246, 0.1);
    color: var(--purple);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.stats-icon-wrapper svg {
    width: 28px;
    height: 28px;
}

.stats-info {
    flex: 1;
}

.stats-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stats-number {
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-heading);
}

/* Beautiful SVG Chart Styling */
.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 32px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.chart-title h3 {
    font-size: 18px;
}

.chart-legend {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.received { background: var(--primary); }
.legend-color.repaired { background: var(--success); }
.legend-color.sold { background: var(--purple); }

.chart-container {
    width: 100%;
    height: 300px;
    position: relative;
}

.bar-chart-custom {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 240px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.chart-y-axis-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.chart-grid-line {
    border-top: 1px dashed rgba(255, 255, 255, 0.04);
    width: 100%;
    position: relative;
}

.chart-grid-label {
    position: absolute;
    left: 0;
    top: -10px;
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-main);
    padding-right: 4px;
}

.chart-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(100% / 6);
    z-index: 2;
}

.chart-bars-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 200px;
    width: 100%;
    justify-content: center;
}

.chart-bar-single {
    width: 18px;
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    position: relative;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.chart-bar-single:hover::after {
    content: attr(data-value);
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-main);
    color: var(--text-dark);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    z-index: 10;
}

.chart-bar-single.bar-received {
    background: linear-gradient(180deg, var(--primary), rgba(59, 130, 246, 0.3));
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.chart-bar-single.bar-repaired {
    background: linear-gradient(180deg, var(--success), rgba(16, 185, 129, 0.3));
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.chart-bar-single.bar-sold {
    background: linear-gradient(180deg, var(--purple), rgba(139, 92, 246, 0.3));
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.chart-column-label {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
}

/* ----------------------------------------------------
   4. STOCK PAGES (หน้ารายการรถยนต์)
---------------------------------------------------- */
.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.search-filter-bar {
    display: flex;
    gap: 12px;
    flex: 1;
    max-width: 800px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 240px;
}

.search-input-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.search-control {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.select-control {
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.select-control:focus {
    border-color: var(--primary);
}

.btn-add-stock {
    padding: 10px 20px;
    font-size: 14px;
    background: linear-gradient(135deg, var(--success), #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-add-stock:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

/* Motorcycle Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.motorcycle-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.motorcycle-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

/* Card Media Header */
.card-media {
    height: 180px;
    position: relative;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.motorcycle-card:hover .card-img {
    transform: scale(1.05);
}

.placeholder-img {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.placeholder-img svg {
    width: 48px;
    height: 48px;
}

.card-status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card-status-ready { background: rgba(16, 185, 129, 0.25); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.card-status-repair { background: rgba(245, 158, 11, 0.25); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.card-status-sold { background: rgba(239, 68, 68, 0.25); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Card Content Details */
.card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-header-info {
    margin-bottom: 16px;
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.card-brand-model {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.card-color-tag {
    font-size: 12px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.card-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.card-plate-no {
    font-size: 13px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-muted);
}

.card-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
    text-transform: uppercase;
}

.detail-val {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    word-break: break-all;
}

/* Pricing block */
.card-prices {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
    background: rgba(15, 23, 42, 0.3);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.price-val {
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-heading);
}

.price-val.sell-price {
    color: var(--primary);
}

.price-val.cost-price {
    color: var(--warning);
}

.cost-badge {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Actions Row at bottom of card */
.card-actions {
    margin-top: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

.card-actions .btn {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-edit-card {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    flex: 1;
}

.btn-edit-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.status-change-wrapper {
    flex: 1;
    display: flex;
}

.status-select-action {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--primary);
    font-weight: 600;
}

.status-select-action:hover {
    background: rgba(59, 130, 246, 0.15);
}

/* No data empty view */
.empty-state {
    text-align: center;
    padding: 64px 32px;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-main);
    margin-bottom: 8px;
}

/* ----------------------------------------------------
   5. OVERLAYS / MODALS (หน้าต่างป็อปอัพ)
---------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 10, 19, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: #111827;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 20px;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
}

.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.btn-close-modal svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 24px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.modal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.modal-form-grid .form-group-full {
    grid-column: span 2;
}

/* Image Upload Area */
.image-upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    background: rgba(15, 23, 42, 0.4);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.image-upload-zone:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.03);
}

.image-upload-zone svg {
    width: 36px;
    height: 36px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.image-upload-zone span {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
}

.image-upload-zone .img-preview-wrapper {
    margin-top: 10px;
    display: none;
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    max-height: 160px;
}

.image-upload-zone img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: 160px;
}

.btn-remove-img {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(239, 68, 68, 0.85);
    border: none;
    color: white;
    padding: 4px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-img:hover {
    background: var(--danger);
}

.btn-remove-img svg {
    width: 14px;
    height: 14px;
    margin-bottom: 0;
}

.compression-status-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    display: none;
}

.modal-footer {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-footer .btn {
    width: auto;
    padding: 10px 20px;
    font-size: 14px;
}

/* ----------------------------------------------------
   6. ANIMATIONS
---------------------------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .modal-form-grid {
        grid-template-columns: 1fr;
    }
    .modal-form-grid .form-group-full {
        grid-column: span 1;
    }
    .overview-header {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-card {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        justify-content: space-between;
    }
    .nav-container {
        padding: 0 16px;
    }
    .tabs-container {
        padding: 0 16px;
        overflow-x: auto;
    }
    .tab-btn {
        padding: 12px 14px;
        font-size: 14px;
        white-space: nowrap;
    }
}
