/* Truck Parts Inventory - Stylesheet */
* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0; background: #f4f6f9; color: #2c3e50; line-height: 1.5;
}

.site-header { background: #1e3a5f; color: white; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.header-inner { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; flex-wrap: wrap; gap: 1rem; }
.portal-link { color: white; text-decoration: none; font-size: 0.95rem; font-weight: 600; padding: 0.4rem 0.9rem; border: 1.5px solid rgba(255,255,255,0.55); border-radius: 4px; white-space: nowrap; }
.portal-link:hover { background: rgba(255,255,255,0.2); border-color: white; }
.site-title { margin: 0; font-size: 1.5rem; flex: 1; }
.site-title a { color: white; text-decoration: none; }
.main-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.main-nav a { color: #cfd8e3; text-decoration: none; padding: 0.4rem 0.8rem; border-radius: 4px; font-weight: 500; position: relative; }
.main-nav a:hover, .main-nav a.active { background: rgba(255,255,255,0.15); color: white; }
.nav-badge { background: #c62828; color: white; padding: 0.1rem 0.5rem; border-radius: 10px; font-size: 0.75rem; margin-left: 0.3rem; }

.container { max-width: 1400px; margin: 2rem auto; padding: 0 2rem; }
.site-footer { text-align: center; padding: 2rem; color: #7f8c9a; font-size: 0.9rem; }

.card { background: white; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); padding: 1.5rem; margin-bottom: 1.5rem; }
.card h2 { margin-top: 0; color: #1e3a5f; border-bottom: 2px solid #e1e8ed; padding-bottom: 0.5rem; font-size: 1.25rem; }
.card h3 { margin-top: 0; color: #1e3a5f; font-size: 1.05rem; }

table { width: 100%; border-collapse: collapse; background: white; }
th, td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid #e1e8ed; font-size: 0.92rem; }
th { background: #f8fafc; color: #1e3a5f; font-weight: 600; border-bottom: 2px solid #d1dde8; white-space: nowrap; }
tr:hover td { background: #f8fafc; }
table.compact th, table.compact td { padding: 0.4rem 0.6rem; font-size: 0.88rem; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.form-group { display: flex; flex-direction: column; }
.form-group label { font-size: 0.85rem; color: #5a6c7d; margin-bottom: 0.3rem; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
    padding: 0.5rem 0.7rem; border: 1px solid #cfd8e3; border-radius: 4px; font: inherit; font-size: 0.95rem; background: white;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: #4a90d9; box-shadow: 0 0 0 3px rgba(74,144,217,0.15);
}

.btn {
    display: inline-block; padding: 0.5rem 1rem; border: none; border-radius: 4px;
    font-size: 0.92rem; font-weight: 500; cursor: pointer; text-decoration: none;
}
.btn-primary { background: #1e3a5f; color: white; }
.btn-primary:hover { background: #2a4a6f; }
.btn-secondary { background: #cfd8e3; color: #1e3a5f; }
.btn-secondary:hover { background: #b8c5d3; }
.btn-success { background: #2e7d32; color: white; }
.btn-success:hover { background: #1b5e20; }
.btn-danger { background: #c62828; color: white; }
.btn-danger:hover { background: #8e0000; }
.btn-warning { background: #ef6c00; color: white; }
.btn-warning:hover { background: #b34700; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.82rem; }

.actions { margin-top: 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

.flash {
    padding: 0.8rem 1.2rem; border-radius: 4px; margin-bottom: 1rem; border-left: 4px solid;
}
.flash-success { background: #e8f5e9; border-color: #2e7d32; color: #1b5e20; }
.flash-error { background: #ffebee; border-color: #c62828; color: #8e0000; }
.flash-info { background: #e3f2fd; border-color: #1976d2; color: #0d47a1; }

.badge {
    display: inline-block; padding: 0.15rem 0.55rem; border-radius: 12px;
    font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-stock { background: #c8e6c9; color: #1b5e20; }
.badge-low { background: #ffe0b2; color: #b34700; }
.badge-out { background: #ffcdd2; color: #8e0000; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: white; padding: 1.25rem; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-left: 4px solid #1e3a5f; }
.stat-card .stat-num { font-size: 2rem; font-weight: 700; color: #1e3a5f; }
.stat-card .stat-label { font-size: 0.85rem; color: #7f8c9a; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card.green { border-left-color: #2e7d32; }
.stat-card.green .stat-num { color: #2e7d32; }
.stat-card.red { border-left-color: #c62828; }
.stat-card.red .stat-num { color: #c62828; }
.stat-card.orange { border-left-color: #ef6c00; }
.stat-card.orange .stat-num { color: #ef6c00; }

.search-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; align-items: end; }
.search-bar .form-group { flex: 1 1 200px; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.empty { padding: 2rem; text-align: center; color: #7f8c9a; font-style: italic; }

table form { display: inline; margin: 0; }

.qty-display { font-size: 1.4rem; font-weight: 700; padding: 0.3rem 0.8rem; border-radius: 4px; display: inline-block; }
.qty-display.ok { background: #c8e6c9; color: #1b5e20; }
.qty-display.low { background: #ffe0b2; color: #b34700; }
.qty-display.out { background: #ffcdd2; color: #8e0000; }

.fits-list { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.fits-list a {
    background: #4a6e94; color: white; padding: 0.2rem 0.55rem; border-radius: 4px;
    text-decoration: none; font-size: 0.82rem; font-weight: 600;
}
.fits-list a:hover { background: #1e3a5f; }

@media (max-width: 768px) {
    .header-inner { padding: 0.8rem 1rem; }
    .container { padding: 0 1rem; margin: 1rem auto; }
    .card { padding: 1rem; }
    .main-nav { gap: 0.5rem; width: 100%; }
    .main-nav a { padding: 0.3rem 0.6rem; font-size: 0.9rem; }
    th, td { padding: 0.4rem 0.5rem; }
}
