:root {
    --ic-orange: #b25416;
    --ic-orange-light: #c96a2e;
    --ic-darkblue: #1a2744;
    --ic-darkgrey: #2d3748;
    --ic-white: #ffffff;
    --ic-lightgrey: #f7fafc;
    --ic-border: #e2e8f0;
}

h1 {
	font-family:'Bebas Neue',sans-serif;
	letter-spacing:1.3px;
}

.body-title {
	font-size:36px;
	font-weight:700;
}

/* Page heading bar */
.page-heading {
    position: relative;
    background: var(--ic-white);
    border-bottom: 1px solid var(--ic-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;

	height:57px;
}

.page-heading.loaded {
    opacity: 1;
}

.page-heading .logo-small {
    height: 32px;
}

.page-heading .user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.role-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
	margin-top:2px;
}

.role-badge-customer {
    background: #dbeafe;
    color: #1e40af;
}

.role-badge-sales {
    background: #fef3c7;
    color: #92400e;
}

.max-message-size {
	max-width:600px;
}

/* Sidebar */
.sidebar {
    background: var(--ic-darkblue);
    color: var(--ic-white);
    width: 16rem;
    min-height: 100vh;
    height: 100vh;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.sidebar.loaded {
    opacity: 1;
}

.sidebar > div {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar a {
    display: block;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    color: #cbd5e0;
    transition: all 0.15s;
    text-decoration: none;
}

.sidebar a:hover,
.sidebar a.active {
    background: rgba(255,255,255,0.1);
    color: var(--ic-white);
}

.sidebar a.active {
    background: var(--ic-orange);
    color: var(--ic-white);
    font-weight: 600;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-bokad { background: #e2e8f0; color: #4a5568; }
.status-hamtad { background: #dbeafe; color: #1e40af; }
.status-vardering { background: #fef3c7; color: #92400e; }
.status-auktion { background: #fce7f3; color: #9d174d; }
.status-sald { background: #c7d2fe; color: #4338ca; }
.status-avraknad { background: #bbf7d0; color: #166534; }

/* Kanban board */
.kanban-board {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: 0;
}

.kanban-column {
    min-width: 220px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem 0.5rem 0 0;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-column-body {
    background: #f1f5f9;
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 0.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 120px;
}

.kanban-card {
    background: var(--ic-white);
    border: 1px solid var(--ic-border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: box-shadow 0.15s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.kanban-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.kanban-card .card-reg {
    font-family: ui-monospace, monospace;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--ic-darkblue);
    letter-spacing: 0.02em;
}

.kanban-card .card-vehicle {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ic-darkgrey);
    margin-top: 0.1rem;
}

.kanban-card .card-price {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ic-orange);
    margin-top: 0.4rem;
}

.kanban-card .card-contact {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.2rem;
}

.kanban-card .card-handler {
    font-size: 0.7rem;
    color: #3b82f6;
    margin-top: 0.3rem;
    font-weight: 500;
}

.kanban-card .card-note {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.3rem;
    font-style: italic;
}

.kanban-card .card-warning {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.4rem;
    padding: 0.25rem 0.5rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #dc2626;
}

.kanban-card .card-warning svg {
    flex-shrink: 0;
}

.kanban-card .card-success {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.4rem;
    padding: 0.25rem 0.5rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #16a34a;
}

.kanban-card .card-success svg {
    flex-shrink: 0;
}

.kanban-count {
    background: rgba(255,255,255,0.5);
    border-radius: 9999px;
    padding: 0 0.45rem;
    font-size: 0.7rem;
    font-weight: 700;
}

/* Column header colors */
.kh-bokad    { background: #e2e8f0; color: #4a5568; }
.kh-hamtad   { background: #dbeafe; color: #1e40af; }
.kh-vardering{ background: #fef3c7; color: #92400e; }
.kh-auktion  { background: #fce7f3; color: #9d174d; }
.kh-sald     { background: #c7d2fe; color: #4338ca; }
.kh-avraknad { background: #bbf7d0; color: #166534; }

@media (max-width: 640px) {
    .kanban-board {
        flex-direction: column;
    }
    .kanban-column {
        min-width: 100%;
    }
}

/* Summary cards */
.summary-card {
    background: var(--ic-white);
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid var(--ic-border);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.summary-card.card-active {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
}

.summary-card.card-action {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
}

.summary-card .card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ic-darkblue);
}

.summary-card .card-label {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 0.25rem;
}

.summary-card .card-detail {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.5rem;
    font-weight: 500;
}

.summary-card.card-action .card-detail {
    color: #dc2626;
    font-weight: 600;
}

/* Buttons */
.btn-ic {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    text-decoration: none;
}

.btn-ic-primary {
    background: var(--ic-orange);
    color: var(--ic-white);
}

.btn-ic-primary:hover {
    background: var(--ic-orange-light);
}

.btn-ic-outline {
    background: transparent;
    color: var(--ic-darkblue);
    border: 1px solid var(--ic-border);
}

.btn-ic-outline:hover {
    background: var(--ic-lightgrey);
}

.btn-ic-info {
    background: #e2f3fe;
    color: #3b82f6;
    border: 1px solid #93c5fd;
}

.btn-ic-info:hover {
    background: #eff6ff;
}

.btn-ic-info.active {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #60a5fa;
}

.btn-ic-info .arrow-icon {
    transition: transform 0.3s ease;
}

.btn-ic-info.active .arrow-icon {
    transform: rotate(180deg);
}

/* Table */
.ic-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.ic-table thead {
    background: var(--ic-lightgrey);
}

.ic-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--ic-darkgrey);
    border-bottom: 2px solid var(--ic-border);
}

.ic-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--ic-border);
}

.ic-table tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}

.ic-table tbody tr:hover {
    background: var(--ic-lightgrey);
}

.ic-table .vehicle-thumb {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 0.375rem;
    border: 1px solid var(--ic-border);
}

.ic-table .vehicle-nickname {
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
}

.ic-table .price-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.ic-table .price-reservation {
    font-size: 0.75rem;
    color: #94a3b8;
}

.ic-table .price-final {
    font-size: 0.875rem;
    font-weight: 600;
    color: #166534;
}

/* Tabs */
.tab-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: #718096;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.tab-btn.active {
    color: var(--ic-orange);
    border-bottom-color: var(--ic-orange);
}

/* Document list */
.doc-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--ic-border);
}

.doc-item:last-child {
    border-bottom: none;
}

/* Login/register pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ic-darkblue) 0%, var(--ic-darkgrey) 100%);
	margin-bottom:80px;
}

.auth-card {
    background: var(--ic-white);
    border-radius: 1rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-card input,
.auth-card select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--ic-border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.auth-card input:focus,
.auth-card select:focus {
    border-color: var(--ic-orange);
    box-shadow: 0 0 0 3px rgba(178,84,22,0.1);
}

.auth-card label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ic-darkgrey);
    margin-bottom: 0.3rem;
}

/* AI Chat Component */
.ai-chat-container {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.ai-chat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.ai-chat-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-chat-title {
    font-weight: 600;
    color: var(--ic-darkblue);
    font-size: 0.95rem;
}

.ai-chat-description {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.4;
}

.ai-chat-input-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.ai-chat-input {
    flex: 1;
    padding: 0.65rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.15s;
    background: white;
}

.ai-chat-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.ai-chat-input::placeholder {
    color: #94a3b8;
}

.ai-chat-btn {
    padding: 0.65rem 1.25rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.ai-chat-btn:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.ai-chat-btn:active {
    transform: translateY(0);
}

.ai-chat-messages {
    max-height: 300px;
    overflow-y: auto;
    margin-top: 1rem;
    display: none;
}

.ai-chat-messages.active {
    display: block;
}

.ai-chat-message {
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.ai-chat-message.user {
    background: white;
    border: 1px solid #e2e8f0;
    margin-left: 2rem;
}

.ai-chat-message.ai {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    margin-right: 2rem;
}

.ai-chat-message-label {
    font-weight: 600;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

/* Mobile sidebar toggle */
@media (max-width: 640px) {

	.logo-topbar {
		display:none;
	}

	.logo-sidebar {
		display:none;
	}

    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
    }

    .sidebar-mobile-short {
		max-height:60px;
    }

.sidebar-mobile-topspace {
	margin-top:48px;
}

	#sidebar-toggle {
		position: absolute;
		right: 1.25rem;
		top: 1.25rem;
		margin: 0;
	}

	.sidebar-mobile-icon {
		display: block !important;
		position: absolute;
		left: 1.25rem;
		top: 0.9rem;
		width: 32px;
		height: 32px;
	}

    .sidebar-mobile-hidden {
        display: none;
    }

    .ai-chat-input-wrapper {
        flex-direction: column;
    }

    .ai-chat-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Line clamp utility for truncating text */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chat-style correspondence */
.correspondence-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.chat-message-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.15s ease;
    background-color: rgba(255, 255, 255, 0.6);
}

.chat-message-item:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.chat-avatar {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #b25416 0%, #c96a2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.chat-avatar-unsent {
    background: linear-gradient(135deg, #94a3b8 0%, #cbd5e1 100%);
}

.chat-content {
    flex: 1;
    min-width: 0;
}

.chat-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.chat-vehicle {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1a2744;
    background-color: #e0f2fe;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

.chat-customer {
    font-size: 0.75rem;
    color: #475569;
    background-color: #f1f5f9;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

.chat-sender {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #b25416;
}

.chat-meta {
    font-size: 0.75rem;
    color: #64748b;
}

.chat-time {
    font-size: 0.6875rem;
    color: #94a3b8;
    margin-left: auto;
}

.chat-text {
    font-size: 0.8125rem;
    color: #334155;
    line-height: 1.5;
    margin-top: 0.25rem;
}

/* Unread message indicators */
.chat-message-unread {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-left: 3px solid #10b981;
    position: relative;
}

.chat-message-unread .chat-text {
    font-weight: 500;
}

.unread-indicator {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
}

.unread-badge {
    background-color: #10b981;
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

.desktop-hidden {
	display:none;
}

@media (max-width: 640px) {
    .chat-message-item {
        padding: 0.5rem;
    }
	
.desktop-hidden {
	display:block;
}
	

    .chat-avatar {
        width: 2rem;
        height: 2rem;
        min-width: 2rem;
        font-size: 0.625rem;
    }

    .chat-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .chat-time {
        margin-left: 0;
    }

    .chat-text {
        font-size: 0.75rem;
    }
}




.fade-out {
    opacity: 0;
    transition: opacity 700ms ease;
}



/* Standard filter buttons */
.standard-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    background-color: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.standard-filter-btn:hover {
    background-color: #f3f4f6;
    border-color: #b25416;
    color: #b25416;
}

.standard-filter-btn.active {
    background-color: #b25416;
    border-color: #b25416;
    color: white;
}

.standard-filter-btn svg {
    flex-shrink: 0;
}

/* Vehicle status legend */
.vehicle-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--ic-border);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.vehicle-legend-title {
    width: 100%;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #475569;
    white-space: nowrap;
}

.legend-car {
    width: 20px;
    height: 14px;
    flex-shrink: 0;
}

.legend-car-grey { color: #9ca3af; }
.legend-car-grey-dotted { color: #9ca3af; }
.legend-car-grey-red-dotted { color: #9ca3af; }
.legend-car-darkgrey { color: #4b5563; }
.legend-car-yellow { color: #eab308; }
.legend-car-orange { color: #f97316; }
.legend-car-black { color: #1f2937; }
.legend-car-green { color: #22c55e; }
.legend-car-blue { color: #3b82f6; }
.legend-car-red { color: #ef4444; }
.legend-car-darkred { color: #991b1b; }
.legend-car-red-reddotted { color: #ef4444; }
