/* industrial-dark.css - V3 CARBON EDITION - FULL RECONSTRUCTION */

:root {
    --bg-dark: #0d0d0f;
    --sidebar-bg: #141416;
    --card-bg: #1a1a1c;
    --accent-orange: #ff8c00;
    --accent-orange-dim: rgba(255, 140, 0, 0.1);
    --accent-blue: #00d2ff;
    --accent-red: #ff3b30;
    --text-main: #ffffff;
    --text-muted: #a0aab8;
    --border-color: #262628;
    --sidebar-width: 260px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow-x: hidden;
}

/* --- Layout Structure --- */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    z-index: 1000;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem 3rem;
    color: var(--text-main);
}

.topbar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
    margin-left: var(--sidebar-width);
    border-bottom: 1px solid var(--border-color);
    background: rgba(13, 13, 15, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 900;
}

/* --- Sidebar Menu --- */
.sidebar-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--accent-orange);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 3rem;
    text-decoration: none;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item-custom {
    text-decoration: none;
    color: var(--text-muted);
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-item-custom i {
    width: 20px;
    text-align: center;
}

.nav-item-custom:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.nav-item-custom.active {
    background: var(--accent-orange);
    color: #000;
    box-shadow: 0 4px 15px var(--accent-orange-dim);
}

/* --- Topbar Components --- */
.search-container {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 15px;
    width: 400px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-container input {
    background: transparent;
    border: none;
    color: #fff;
    width: 100%;
    outline: none;
    font-size: 0.9rem;
}

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

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 700;
    font-size: 0.9rem;
    display: block;
}

.user-role {
    font-size: 0.7rem;
    color: var(--accent-orange);
    text-transform: uppercase;
    font-weight: 800;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 800;
}

/* --- Dashboard HUD Cards --- */
.hud-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 3rem;
}

.hud-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hud-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.hud-value {
    font-size: 1.5rem;
    font-weight: 800;
}

/* --- Flow Lanes Premium --- */
.lane-header {
    background: rgba(255, 140, 0, 0.03);
    padding: 10px 15px;
    border-radius: 8px;
    border-bottom: 2px solid var(--accent-orange);
    font-size: 0.65rem;
    font-weight: 800;
    margin-bottom: 20px;
    display: inline-block;
}

.lane-content {
    background: transparent;
    border: none;
    padding: 0;
    min-height: 300px;
}

.repair-card {
    background: #1e1e21;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 12px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

.repair-card::after {
    content: "";
    position: absolute;
    left: -1px; top: 20%; bottom: 20%;
    width: 3px;
    background: var(--accent-blue);
    border-radius: 3px;
}

.repair-card.urgent::after {
    background: var(--accent-red);
}

.repair-card .vin {
    font-size: 0.6rem;
    color: #555;
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.repair-card .vehicle-model {
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 5px;
}

.repair-card .status-note {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Stock Alerts */
.stock-alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    margin-bottom: 10px;
}

.stock-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 140, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-orange);
}

/* Mini Gauges for Header Cards */
.mini-gauge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #222;
    border-top-color: var(--accent-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 800;
}

/* --- Bottom Charts --- */
.bottom-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* Buttons */
.btn-new-entry {
    background: var(--accent-orange);
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 15px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.text-orange { color: var(--accent-orange) !important; }
.text-info { color: var(--accent-blue) !important; }
.text-success { color: #27ae60 !important; }

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.lane {
    animation: slideInRight 0.5s ease backwards;
}

.lane:nth-child(2) { animation-delay: 0.1s; }
.lane:nth-child(3) { animation-delay: 0.2s; }
.lane:nth-child(4) { animation-delay: 0.3s; }
.lane:nth-child(5) { animation-delay: 0.4s; }

/* Custom Scrollbar for Lanes */
.lanes-container::-webkit-scrollbar {
    height: 6px;
}
.lanes-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

/* --- Yii2 GridView & DetailView Global Refinement --- */
.grid-view {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-top: 1rem;
    color: var(--text-main);
}

.grid-view .summary {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.grid-view table {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    margin-bottom: 0 !important;
}

.grid-view .empty {
    color: var(--text-muted);
    text-align: center;
    padding: 3rem !important;
    background: rgba(255,255,255,0.02) !important;
}

.grid-view thead th {
    background: rgba(255,140,0,0.02) !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--accent-orange) !important;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    padding: 15px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.grid-view thead th a {
    color: var(--accent-orange) !important;
    text-decoration: none;
}

.grid-view tbody tr {
    background: transparent !important;
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.grid-view td {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    color: var(--text-main) !important;
    padding: 16px 15px !important;
    font-size: 0.85rem;
    vertical-align: middle;
}

.grid-view td a {
    color: var(--accent-blue) !important;
    text-decoration: none;
    font-weight: 500;
}

.grid-view td a:hover {
    text-decoration: underline;
}

.grid-view tbody tr:hover td {
    color: var(--accent-orange) !important;
}

.grid-view .action-column a, .grid-view [class^="yii\grid\ActionColumn"] a {
    color: var(--text-muted) !important;
    margin: 0 8px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.grid-view .action-column a:hover, .grid-view [class^="yii\grid\ActionColumn"] a:hover {
    color: var(--accent-orange) !important;
    transform: scale(1.2);
}

.grid-view .filters td {
    background: rgba(0,0,0,0.3) !important;
    padding: 8px !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.grid-view .filters input, .grid-view .filters select {
    background: #0d0d0f !important;
    border: 1px solid var(--border-color) !important;
    color: #fff !important;
    font-size: 0.75rem;
    border-radius: 6px;
    padding: 5px 10px;
}

/* DetailView */
.detail-view {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px;
    overflow: hidden;
    margin-top: 1rem;
}

.detail-view th {
    background: rgba(255,140,0,0.05) !important;
    color: var(--accent-orange) !important;
    width: 25%;
    padding: 15px 20px !important;
    border-right: 1px solid var(--border-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
    font-family: 'Space Grotesk', sans-serif;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.detail-view td {
    background: transparent !important;
    color: var(--text-main) !important;
    padding: 15px 20px !important;
    border-bottom: 1px solid var(--border-color) !important;
    font-size: 0.85rem;
}

.detail-view tr:last-child th, .detail-view tr:last-child td {
    border-bottom: none !important;
}

/* Pagination */
.pagination {
    margin-top: 2rem;
    display: flex;
    gap: 6px;
    justify-content: center;
}

.page-item .page-link {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 8px !important;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.page-item.active .page-link {
    background: var(--accent-orange) !important;
    border-color: var(--accent-orange) !important;
    color: #000 !important;
}

.page-item.disabled .page-link {
    background: rgba(255,255,255,0.02);
    border-color: var(--border-color);
    color: #444;
}

.page-link:hover:not(.active) {
    background: var(--accent-orange-dim);
    border-color: var(--accent-orange);
    color: #fff;
}

/* Breadcrumbs Premium */
.breadcrumb {
    background: rgba(255,255,255,0.02);
    padding: 10px 20px;
    border-radius: 10px;
    margin-bottom: 2rem;
    display: inline-flex;
}

.breadcrumb-item a {
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75rem;
}

.breadcrumb-item.active {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
}

/* Global Button Refinement */
.btn {
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 10px 20px;
    transition: all 0.3s;
}

.btn-success {
    background: var(--accent-orange) !important;
    border: none !important;
    color: #000 !important;
    box-shadow: 0 4px 12px var(--accent-orange-dim);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--accent-orange-dim);
}

.btn-primary {
    background: var(--accent-blue) !important;
    border: none !important;
    color: #000 !important;
}

.btn-danger {
    background: var(--accent-red) !important;
    border: none !important;
    color: #fff !important;
}

/* Form Styles */
.form-control, .form-select {
    background-color: #0d0d0f !important;
    border: 1px solid var(--border-color) !important;
    color: #fff !important;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-orange) !important;
    box-shadow: 0 0 0 3px var(--accent-orange-dim) !important;
}

.form-group label {
    margin-bottom: 8px;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.5px;
}

.help-block-error {
    color: var(--accent-red);
    font-size: 0.7rem;
    margin-top: 5px;
    font-weight: 600;
}

/* Section Headers in Forms */
h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 800;
    color: var(--accent-orange);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-bottom: 25px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

h4::before {
    content: "";
    width: 4px;
    height: 18px;
    background: var(--accent-orange);
    border-radius: 2px;
}

hr {
    border-color: var(--border-color);
    opacity: 1;
    margin: 2rem 0;
}

/* Checkbox List Styling */
.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-main);
}

.checkbox-list input[type="checkbox"] {
    width: 20px;
    height: 20px;
    appearance: none;
    background: #0d0d0f;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    position: relative;
    cursor: pointer;
}

.checkbox-list input[type="checkbox"]:checked {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
}

.checkbox-list input[type="checkbox"]:checked::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #000;
    font-size: 10px;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

/* ListBox Styling */
select[multiple], select[size], select.form-control[multiple] {
    background-color: #0d0d0f !important;
    border: 1px solid var(--border-color) !important;
    color: #fff !important;
    height: auto !important;
    padding: 10px !important;
}

select[multiple]::-webkit-scrollbar {
    width: 6px;
}
select[multiple]::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

select[multiple] option {
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.2s;
}

select[multiple] option:selected, select[multiple] option:checked {
    background: var(--accent-orange) linear-gradient(0deg, var(--accent-orange) 0%, var(--accent-orange) 100%) !important;
    color: #000 !important;
}

/* Container for Forms */
.user-form, .company-form, .branch-form, .customer-form, .estimate-form, .vehicle-form {
    max-width: 1000px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* --- Hamburger Button --- */
.hamburger-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1rem;
    flex-shrink: 0;
}
.hamburger-btn:hover { background: var(--accent-orange-dim); color: var(--accent-orange); }

/* --- Sidebar Overlay (mobile) --- */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* --- Cards Dark Bootstrap --- */
.card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    color: var(--text-main) !important;
}
.card-header {
    background: rgba(255,140,0,0.03) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

/* --- Responsive Tables --- */
.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.grid-view { overflow-x: auto; }

/* ===================================================
   RESPONSIVE BREAKPOINTS
   =================================================== */

/* --- Large (≥1200px): full layout --- */
@media (min-width: 1200px) {
    .sidebar { transform: translateX(0) !important; }
    .sidebar-overlay { display: none !important; }
}

/* --- Below 1200px: sidebar hides off-screen by default --- */
@media (max-width: 1199.98px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
        transition: transform 0.3s ease;
        z-index: 1050;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content  { margin-left: 0 !important; padding: 1.5rem 1rem; }
    .topbar        { margin-left: 0 !important; padding: 0 1rem; }
}

/* --- Below 768px: tighter layout --- */
@media (max-width: 767.98px) {
    .main-content { padding: 1rem; }
    .topbar { height: 60px; }
    .hud-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 1.5rem; }
    .bottom-grid { grid-template-columns: 1fr; }
    .search-container { width: 100%; }
    .user-info { display: none; }
    .user-form, .company-form, .branch-form, .customer-form, .estimate-form, .vehicle-form {
        padding: 1.25rem;
        border-radius: 14px;
    }
    /* Detail view: stack th/td vertically */
    .detail-view table, .detail-view tr, .detail-view th, .detail-view td { display: block; width: 100%; }
    .detail-view th { border-right: none !important; border-bottom: none !important; padding-bottom: 4px !important; }
    .detail-view td { padding-top: 4px !important; margin-bottom: 8px; }
    /* Breadcrumb */
    .breadcrumb { padding: 8px 12px; font-size: 0.7rem; }
}

/* --- Below 576px --- */
@media (max-width: 575.98px) {
    .hud-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .hud-card { padding: 14px; }
    .hud-value { font-size: 1.2rem; }
    .btn { padding: 8px 14px; font-size: 0.7rem; }
    h1, h2 { font-size: 1.2rem; }
    .grid-view { padding: 12px; }
}
