/* FreightDeck Sidebar Layout - Add to existing styles.css */

/* ==================== GLOBAL POLISH ==================== */

/* Smoother transitions everywhere */
body.sidebar-layout * {
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

/* Better typography */
body.sidebar-layout {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Section headers - bolder */
body.sidebar-layout h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f5f5f5;
    margin-bottom: 16px;
}

body.sidebar-layout h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #e5e5e5;
}

body.sidebar-layout h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #d4d4d4;
}

/* ==================== INPUT POLISH ==================== */

/* All inputs in sidebar layout - ensure visible text */
body.sidebar-layout input,
body.sidebar-layout select,
body.sidebar-layout textarea {
    background: #2d2d2d !important;
    color: #f5f5f5 !important;
    border: 1px solid #444 !important;
}

body.sidebar-layout input[type="text"],
body.sidebar-layout input[type="number"],
body.sidebar-layout input[type="date"],
body.sidebar-layout input[type="email"] {
    background: #2d2d2d !important;
    color: #f5f5f5 !important;
}

/* Sharper focus states */
body.sidebar-layout input:focus,
body.sidebar-layout select:focus,
body.sidebar-layout textarea:focus {
    outline: none;
    border-color: #4a9eff !important;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    background: #333 !important;
}

/* Input hover state */
body.sidebar-layout input:hover,
body.sidebar-layout select:hover {
    border-color: #555 !important;
    background: #333 !important;
}

/* Placeholder styling */
body.sidebar-layout input::placeholder {
    color: #888 !important;
    opacity: 1;
}

/* Select dropdown options */
body.sidebar-layout select option {
    background: #2d2d2d;
    color: #f5f5f5;
}

/* ==================== BUTTON POLISH ==================== */

/* Primary button - lift on hover */
body.sidebar-layout .btn-primary {
    background: linear-gradient(135deg, #4a9eff 0%, #3b82f6 100%);
    border: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 4px rgba(74, 158, 255, 0.3);
}

body.sidebar-layout .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
    background: linear-gradient(135deg, #5aa8ff 0%, #4b8ef7 100%);
}

body.sidebar-layout .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(74, 158, 255, 0.3);
}

/* Secondary button */
body.sidebar-layout .btn-secondary {
    background: #2d2d2d;
    border: 1px solid #444;
    color: #a0a0a0;
    font-weight: 500;
}

body.sidebar-layout .btn-secondary:hover {
    background: #363636;
    border-color: #555;
    color: #f5f5f5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Large button */
body.sidebar-layout .btn-large {
    padding: 14px 24px;
    font-size: 1rem;
    border-radius: 10px;
}

/* Full width button */
body.sidebar-layout .btn-full {
    width: 100%;
}

/* Button loading state */
body.sidebar-layout .btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

body.sidebar-layout .btn.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* ==================== CARD/SECTION POLISH ==================== */

/* Form sections with depth */
body.sidebar-layout .form-section,
body.sidebar-layout section,
body.sidebar-layout .input-section,
body.sidebar-layout .output-section {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Card hover effect */
body.sidebar-layout .rates-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.sidebar-layout .rates-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ==================== NAV POLISH ==================== */

/* Sidebar Layout Override */
body.sidebar-layout {
    overflow: hidden;
}

body.sidebar-layout .container {
    max-width: none;
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
}

body.sidebar-layout .header-banner {
    display: none;
}

body.sidebar-layout .tabs {
    display: none;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: #161616;
    border-right: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 20px 18px;
    border-bottom: 1px solid #2a2a2a;
    background: linear-gradient(180deg, #1a1a1a 0%, #161616 100%);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #4a9eff 0%, #4a9eff 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.sidebar-logo-icon svg {
    width: 22px;
    height: 22px;
}

.sidebar-logo-text {
    font-weight: 800;
    font-size: 1.15rem;
    color: #f5f5f5;
    letter-spacing: -0.03em;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    color: #808080;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    border: 1px solid transparent;
    font-size: 0.875rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e5e5e5;
    transform: translateX(2px);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.15) 0%, rgba(74, 158, 255, 0.08) 100%);
    color: #4a9eff;
    border-color: rgba(74, 158, 255, 0.4);
    font-weight: 600;
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-item.active .nav-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(1.1);
}

.nav-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    width: 22px;
    text-align: center;
    transition: transform 0.2s ease;
    opacity: 0.8;
}

.nav-item:hover .nav-item-icon,
.nav-item.active .nav-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

a.nav-item { text-decoration: none; color: inherit; }
.nav-item-label {
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

.nav-item-badge {
    margin-left: auto;
    background: linear-gradient(135deg, #4a9eff 0%, #4a9eff 100%);
    color: white;
    font-size: 0.6rem;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(74, 158, 255, 0.3);
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid #2a2a2a;
    background: linear-gradient(180deg, #161616 0%, #141414 100%);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #222 0%, #1e1e1e 100%);
    border: 1px solid #2a2a2a;
    border-radius: 8px;
}

.sidebar-user-name {
    font-size: 0.8rem;
    color: #d4d4d4;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.sidebar-logout {
    background: transparent;
    border: 1px solid #333;
    color: #777;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.sidebar-logout:hover {
    background: #2d2d2d;
    border-color: #444;
    color: #f5f5f5;
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: #222;
    border: 1px solid #333;
    border-radius: 10px;
    color: #a0a0a0;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
    background: #2a2a2a;
    color: #f5f5f5;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #0f0f0f;
    overflow: hidden;
}

.main-header {
    height: 56px;
    background: linear-gradient(180deg, #1a1a1a 0%, #161616 100%);
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.main-header-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f5f5f5;
    letter-spacing: -0.02em;
}

.main-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 28px 40px;
}

/* Remove ALL max-width constraints for wider screens */
body.sidebar-layout .container,
body.sidebar-layout .main-scroll .container,
body.sidebar-layout .main-content .container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.sidebar-layout .tab-content,
body.sidebar-layout #ratecheck,
body.sidebar-layout #permits,
body.sidebar-layout #stateregs,
body.sidebar-layout #loadplanning {
    max-width: 100% !important;
    width: 100% !important;
}

/* Rate check layout - use full width with wider sidebar */
body.sidebar-layout .ratecheck-main-layout {
    max-width: 100% !important;
    width: 100% !important;
    grid-template-columns: 0.85fr 1fr !important;
    gap: 40px !important;
}

/* Permit layout - use full width */
body.sidebar-layout .permit-main-layout {
    max-width: 100% !important;
    width: 100% !important;
    grid-template-columns: 0.85fr 1fr !important;
    gap: 24px !important;
}

/* All sections should be full width */
body.sidebar-layout section {
    max-width: 100% !important;
}

/* Rate cards row - spread out more */
body.sidebar-layout .rates-row-layout {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 24px !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Tab content transitions */
.tab-content {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dark theme overrides for content */
body.sidebar-layout {
    background: #0f0f0f;
    color: #f5f5f5;
}

body.sidebar-layout .tab-content {
    background: transparent;
}

body.sidebar-layout section,
body.sidebar-layout .card,
body.sidebar-layout .input-section,
body.sidebar-layout .output-section,
body.sidebar-layout .lane-section {
    background: #1a1a1a;
    border-color: #333;
}

body.sidebar-layout input,
body.sidebar-layout select,
body.sidebar-layout textarea {
    background: #2d2d2d;
    border-color: #444;
    color: #f5f5f5;
}

body.sidebar-layout input:focus,
body.sidebar-layout select:focus {
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
}

body.sidebar-layout .btn-primary {
    background: #4a9eff;
}

body.sidebar-layout .btn-primary:hover {
    background: #3d8ce6;
}

body.sidebar-layout .btn-secondary {
    background: #2d2d2d;
    border-color: #444;
    color: #a0a0a0;
}

body.sidebar-layout h2, 
body.sidebar-layout h3, 
body.sidebar-layout h4 {
    color: #f5f5f5;
}

body.sidebar-layout .hint,
body.sidebar-layout .text-muted {
    color: #666;
}

body.sidebar-layout table th {
    background: #2d2d2d;
    color: #a0a0a0;
}

body.sidebar-layout table td {
    border-color: #333;
}

body.sidebar-layout .rate-card,
body.sidebar-layout .rates-card {
    background: #1a1a1a;
    border-color: #333;
}

/* Mobile responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
}

/* Scrollbar */
body.sidebar-layout ::-webkit-scrollbar {
    width: 8px;
}

body.sidebar-layout ::-webkit-scrollbar-track {
    background: #1a1a1a;
}

body.sidebar-layout ::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

body.sidebar-layout ::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* ==================== PERMIT ESTIMATOR LAYOUT ==================== */

/* Main two-column layout (same as Rate Check) */
.permit-main-layout {
    display: grid;
    grid-template-columns: 0.85fr 1fr;
    gap: 24px;
    min-height: 500px;
}

/* Map Panel - Right Side */
.permit-map-panel {
    position: relative;
}

.permit-map-panel .map-container {
    position: relative;
    height: 100%;
    min-height: 480px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
    background: #1a1a1a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Map empty state */
.permit-map-panel .map-container::before,
.ratecheck-map-panel .map-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 40%, rgba(74, 158, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
    z-index: 0;
    pointer-events: none;
}

.permit-map-panel .map-container.has-route::before,
.ratecheck-map-panel .map-container.has-route::before {
    display: none;
}

/* Map placeholder icon */
.map-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #444;
    z-index: 1;
    pointer-events: none;
}

.map-placeholder-icon {
    font-size: 4rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.map-placeholder-text {
    font-size: 0.85rem;
    color: #555;
}

.permit-map-panel .permit-route-map {
    height: 100%;
    width: 100%;
}

.permit-map-panel .map-miles-badge,
body.sidebar-layout .map-miles-badge {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: linear-gradient(135deg, #4a9eff 0%, #3b82f6 100%);
    color: white;
    padding: 10px 18px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 16px rgba(74, 158, 255, 0.4);
    z-index: 1000;
}

.permit-map-panel .map-expand-btn,
body.sidebar-layout .map-expand-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: #a0a0a0;
    font-size: 1rem;
    backdrop-filter: blur(8px);
    transition: all 0.15s ease;
}

body.sidebar-layout .map-expand-btn:hover {
    background: rgba(45, 45, 45, 0.95);
    color: #f5f5f5;
    border-color: #444;
    transform: scale(1.05);
}

/* Form Panel - Right Side */
.permit-form-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.permit-form-panel .form-section {
    background: linear-gradient(180deg, #1c1c1c 0%, #1a1a1a 100%);
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.permit-form-panel .form-section:hover {
    border-color: #333;
}

.permit-form-panel .form-section:focus-within {
    border-color: rgba(74, 158, 255, 0.3);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(74, 158, 255, 0.1);
}

.permit-form-panel .form-section label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.permit-form-panel .section-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.permit-form-panel .field-icon {
    margin-right: 6px;
    opacity: 0.8;
}

.permit-form-panel .dim-field label {
    text-transform: none;
    font-size: 0.75rem;
    color: #666;
    letter-spacing: 0;
    margin-bottom: 6px;
}

/* Lane Row - Origin/Dest side by side */
.permit-form-panel .lane-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.permit-form-panel .lane-field input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #232323;
    color: #f5f5f5;
    font-size: 0.9rem;
    font-weight: 500;
}

.permit-form-panel .lane-field input:hover {
    border-color: #444;
    background: #282828;
}

.permit-form-panel .lane-field input:focus {
    outline: none;
    border-color: #4a9eff;
    background: #282828;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
}

/* Dimensions Grid */
.permit-form-panel .dims-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.permit-form-panel .dim-field label {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 4px;
}

.permit-form-panel .ft-in-input {
    display: flex;
    align-items: center;
    gap: 4px;
}

.permit-form-panel .ft-in-input input {
    width: 52px;
    padding: 9px 6px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #232323;
    color: #f5f5f5;
    font-size: 0.85rem;
    text-align: center;
    font-weight: 500;
}

.permit-form-panel .ft-in-input input:hover {
    border-color: #444;
    background: #282828;
}

.permit-form-panel .ft-in-input input:focus {
    border-color: #4a9eff;
    background: #282828;
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.15);
}

.permit-form-panel .ft-in-input .unit-label {
    font-size: 0.7rem;
    color: #555;
    font-weight: 500;
    min-width: 14px;
}

.permit-form-panel .weight-input {
    display: flex;
    align-items: center;
    gap: 6px;
}

.permit-form-panel .weight-input input {
    flex: 1;
    padding: 9px 10px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #232323;
    color: #f5f5f5;
    font-size: 0.85rem;
    font-weight: 500;
}

.permit-form-panel .weight-input input:hover {
    border-color: #444;
    background: #282828;
}

.permit-form-panel .weight-input input:focus {
    border-color: #4a9eff;
    background: #282828;
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.15);
}

.permit-form-panel .weight-input .unit-label {
    font-size: 0.7rem;
    color: #555;
    font-weight: 500;
}

/* Equipment select */
.permit-form-panel .equipment-select,
body.sidebar-layout .equipment-select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #232323;
    color: #f5f5f5;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

body.sidebar-layout .equipment-select:hover {
    border-color: #444;
    background-color: #282828;
}

body.sidebar-layout .equipment-select:focus {
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
}

/* Trailer specs mini display */
.permit-form-panel .trailer-specs-mini {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
    margin-top: 10px;
    padding: 8px 10px;
    background: linear-gradient(180deg, #1e1e1e 0%, #1a1a1a 100%);
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    font-size: 0.72rem;
}

.permit-form-panel .trailer-specs-mini .spec {
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.permit-form-panel .trailer-specs-mini span span {
    color: #4a9eff;
    font-weight: 600;
}

/* Truck selector compact */
.truck-selector-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #1c1c1c 0%, #1a1a1a 100%);
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #a0a0a0;
}

.truck-selector-compact .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    background: #2d2d2d;
    border: 1px solid #333;
    border-radius: 6px;
    color: #a0a0a0;
}

.truck-selector-compact .btn:hover {
    background: #363636;
    color: #f5f5f5;
}

/* Permit results styling for dark mode */
body.sidebar-layout .permit-results-section {
    margin-top: 24px;
    padding: 20px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
}

body.sidebar-layout .permit-results-section h3 {
    margin-bottom: 16px;
    color: #f5f5f5;
}

/* ==================== RATE CHECK FORM POLISH ==================== */

body.sidebar-layout .ratecheck-form-panel .form-section {
    background: linear-gradient(180deg, #1c1c1c 0%, #1a1a1a 100%);
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.sidebar-layout .ratecheck-form-panel .form-section:hover {
    border-color: #333;
}

body.sidebar-layout .ratecheck-form-panel .form-section:focus-within {
    border-color: rgba(74, 158, 255, 0.3);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(74, 158, 255, 0.1);
}

body.sidebar-layout .ratecheck-form-panel .lane-field input {
    padding: 11px 14px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #232323;
    font-weight: 500;
}

body.sidebar-layout .ratecheck-form-panel .lane-field input:hover {
    border-color: #444;
    background: #282828;
}

body.sidebar-layout .ratecheck-form-panel label {
    color: #888;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

body.sidebar-layout .ratecheck-map-panel .map-container {
    border: 1px solid #2a2a2a;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ==================== RATES CARDS POLISH ==================== */

body.sidebar-layout .rates-card,
body.sidebar-layout .rates-card.market-rates,
body.sidebar-layout .rates-card.network-rates,
body.sidebar-layout .rates-card.ai-rates,
body.sidebar-layout .rates-card.lane-history,
body.sidebar-layout .rates-card.compact {
    background-color: #1e1e1e !important;
    background-image: linear-gradient(180deg, #222 0%, #1a1a1a 100%) !important;
    border: 1px solid #333 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    color: #e5e5e5 !important;
    padding: 16px !important;
}

body.sidebar-layout .rates-card .rates-header {
    border-bottom: 1px solid #333;
    padding-bottom: 12px;
    margin-bottom: 12px;
    background: transparent !important;
}

body.sidebar-layout .rates-card .rates-header h4 {
    color: #f5f5f5 !important;
    font-weight: 700;
}

body.sidebar-layout .rates-card .rates-source {
    background: #333 !important;
    color: #888 !important;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

body.sidebar-layout .rates-card .rates-confidence {
    color: #888;
}

body.sidebar-layout .rates-card .conf-value {
    background: #2a2a2a !important;
    color: #4a9eff !important;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

body.sidebar-layout .rates-card .rate-range {
    background: transparent !important;
}

body.sidebar-layout .rates-card .rate-row {
    background: #252525 !important;
    border: 1px solid #333 !important;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 10px 14px;
}

body.sidebar-layout .rates-card .rate-row:last-child {
    margin-bottom: 0;
}

body.sidebar-layout .rates-card .rate-label {
    color: #888 !important;
    font-weight: 500;
}

body.sidebar-layout .rates-card .rate-value {
    color: #f5f5f5 !important;
    font-weight: 700;
    letter-spacing: -0.02em;
}

body.sidebar-layout .rates-card .rate-row.rate-avg {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.15) 0%, rgba(74, 158, 255, 0.08) 100%) !important;
    border-color: rgba(74, 158, 255, 0.3) !important;
}

body.sidebar-layout .rates-card .rate-row.rate-avg .rate-value {
    color: #4a9eff !important;
    font-size: 1.4rem;
}

body.sidebar-layout .rates-card .rate-per-mile {
    color: #666 !important;
    font-size: 0.8rem;
}

body.sidebar-layout .rates-card .rate-row.rate-low .rate-value {
    color: #a0a0a0 !important;
}

body.sidebar-layout .rates-card .rate-row.rate-high .rate-value {
    color: #f59e0b !important;
}

/* AI Rates card specific */
body.sidebar-layout .rates-card.ai-rates .ai-reasoning {
    background: rgba(74, 158, 255, 0.08) !important;
    border: 1px solid rgba(74, 158, 255, 0.2);
    color: #a0a0a0 !important;
}

body.sidebar-layout .rates-card.ai-rates .rate-ai-prediction {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.08) 100%) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}

body.sidebar-layout .rates-card.ai-rates .ai-rate {
    color: #22c55e !important;
}

body.sidebar-layout .rates-card .btn {
    background: #333 !important;
    border: 1px solid #444 !important;
    color: #a0a0a0 !important;
}

body.sidebar-layout .rates-card .btn:hover {
    background: #404040 !important;
    color: #f5f5f5 !important;
}

body.sidebar-layout .rates-card .btn-success,
body.sidebar-layout .rates-card .btn.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    border: none !important;
    color: white !important;
}

/* Card feedback buttons */
body.sidebar-layout .rates-card .card-feedback {
    border-top: 1px solid #333;
    padding-top: 10px;
    margin-top: 10px;
}

body.sidebar-layout .rates-card .card-feedback-label {
    color: #666 !important;
    font-size: 0.75rem;
}

body.sidebar-layout .rates-card .card-fb-btn {
    background: #2a2a2a !important;
    border: 1px solid #333 !important;
    color: #888 !important;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
}

body.sidebar-layout .rates-card .card-fb-btn:hover {
    background: #333 !important;
    color: #f5f5f5 !important;
}

/* ==================== RESULTS SECTION POLISH ==================== */

body.sidebar-layout .ratecheck-results-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #2a2a2a;
    animation: fadeIn 0.3s ease;
}

body.sidebar-layout .rates-row-layout {
    gap: 16px;
}

/* Rate bottom actions */
body.sidebar-layout .rate-bottom-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #2a2a2a;
}

body.sidebar-layout .rate-bottom-actions .btn-outline {
    background: transparent !important;
    border: 1px solid #444 !important;
    color: #a0a0a0 !important;
}

body.sidebar-layout .rate-bottom-actions .btn-outline:hover {
    background: #2a2a2a !important;
    border-color: #555 !important;
    color: #f5f5f5 !important;
}

/* Lane history stats */
body.sidebar-layout .lane-stats {
    display: flex;
    gap: 12px;
}

body.sidebar-layout .lane-stat {
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 14px;
    text-align: center;
}

body.sidebar-layout .lane-stat .stat-label {
    color: #666 !important;
    font-size: 0.7rem;
    display: block;
    margin-bottom: 4px;
}

body.sidebar-layout .lane-stat .stat-value {
    color: #f5f5f5 !important;
    font-weight: 700;
    font-size: 0.95rem;
}

/* Save quote form */
body.sidebar-layout #saveQuoteForm {
    background: #1a1a1a !important;
    border: 1px solid #333;
    border-radius: 10px;
}

body.sidebar-layout #saveQuoteForm input,
body.sidebar-layout #saveQuoteForm select {
    background: #2a2a2a !important;
    border: 1px solid #444 !important;
    color: #f5f5f5 !important;
}

/* Rates loaded message */
body.sidebar-layout .rates-loaded-msg,
body.sidebar-layout [style*="Rates loaded"] {
    background: linear-gradient(180deg, #162016 0%, #141a14 100%) !important;
    border: 1px solid #2a3d2a !important;
    color: #6ee76e !important;
}

/* Beta tag */
body.sidebar-layout .beta-tag {
    background: linear-gradient(135deg, #4a9eff 0%, #6d28d9 100%) !important;
    color: white !important;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
}

/* ==================== FOOTER - HIDE GLOBAL, SHOW ONLY IN PERMITS ==================== */

/* Hide global footer completely */
body.sidebar-layout .site-footer {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.sidebar-layout footer.site-footer {
    display: none !important;
}

body.sidebar-layout > footer {
    display: none !important;
}

/* Permit page footer - show inline at bottom of permits tab */
body.sidebar-layout #permits .permit-footer {
    display: block !important;
    margin-top: 40px;
    padding: 24px;
    background: #141414;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
}

body.sidebar-layout .permit-footer .footer-disclaimer {
    background: linear-gradient(180deg, #1e1a14 0%, #1a1814 100%);
    border: 1px solid #3d3428;
    border-left: 3px solid #f59e0b;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 16px;
    color: #c9b896;
}

body.sidebar-layout .permit-footer .footer-disclaimer strong {
    color: #f59e0b;
}

body.sidebar-layout .permit-footer .footer-contact {
    color: #888;
    margin-bottom: 8px;
    text-align: center;
    font-size: 0.85rem;
}

body.sidebar-layout .permit-footer .footer-contact a {
    color: #4a9eff;
}

body.sidebar-layout .permit-footer .footer-copyright {
    color: #555;
    text-align: center;
    font-size: 0.8rem;
}

/* Disclaimer banner (the warning box) */
body.sidebar-layout .disclaimer-banner {
    background: linear-gradient(180deg, #1e1a14 0%, #1a1814 100%) !important;
    border: 1px solid #3d3428 !important;
    border-left: 3px solid #f59e0b !important;
    color: #c9b896 !important;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

body.sidebar-layout .disclaimer-banner strong {
    color: #f59e0b !important;
}

/* Mobile responsive */
@media (max-width: 900px) {
    .permit-main-layout {
        grid-template-columns: 1fr;
    }

    .permit-map-panel .map-container {
        min-height: 300px;
    }

    .permit-form-panel .dims-grid {
        grid-template-columns: 1fr 1fr;
    }

    .permit-form-panel .lane-row {
        grid-template-columns: 1fr;
    }
}
