/* Air-Tech AS - Main Styles med diskret logout */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #374151; line-height: 1.5; font-weight: 400; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.app-container { max-width: 400px; margin: 0 auto; min-height: 100vh; background: #f8f9fa; display: flex; flex-direction: column; box-shadow: 0 0 30px rgba(0,0,0,0.15); position: relative; }
.app-header { background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%); color: white; padding: 12px 12px; display: flex; align-items: center; gap: 12px; box-shadow: 0 4px 20px rgba(74, 144, 226, 0.3); border-radius: 0 0 16px 16px; position: sticky; top: 0; z-index: 100; }

.header-nav-button { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: transparent; color: white; font-size: 28px; text-decoration: none; transition: background-color 0.2s ease; border: none; padding: 0; flex-shrink: 0; }
.header-nav-button:hover { background-color: rgba(255,255,255,0.15); }
.header-nav-button.hidden { display: none; }
.header-nav-spacer { width: 36px; height: 36px; flex-shrink: 0; }
.header-main-content { display: flex; align-items: center; gap: 10px; overflow: hidden; flex-grow: 1; }

.header-main-content .company-info h1 { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.1; white-space: nowrap; }
.header-main-content .company-info .app-subtitle { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.9); white-space: nowrap; }
.header-user-info { display: flex; align-items: center; gap: 8px; text-align: right; font-size: 13px; font-weight: 500; color: white; flex-shrink: 0; }
.header-user-info .technician-avatar { width: 32px; height: 32px; background-color: rgba(255,255,255,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 13px; flex-shrink: 0; }

/* Diskret logout button */
.logout-button {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    width: 32px;
    height: 32px;
    opacity: 0.7;
}

.logout-button:hover {
    background-color: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
    opacity: 1;
}

.main-content { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.calendar-section { background: white; border-radius: 14px; padding: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.calendar-controls { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.calendar-toggle { display: flex; background: #e9ecef; border-radius: 10px; padding: 3px; gap: 3px; }
.toggle-btn { flex: 1; padding: 8px 12px; border: none; border-radius: 7px; font-weight: 600; font-size: 13px; cursor: pointer; transition: all 0.2s; background: transparent; color: #495057; }
.toggle-btn.active { background: white; color: #4A90E2; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.calendar-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; }
.nav-btn { width: 36px; height: 36px; border: none; border-radius: 10px; background: #f8f9fa; color: #4A90E2; cursor: pointer; font-size: 16px; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.calendar-title { font-size: 16px; font-weight: 600; }
.calendar-weekdays, .month-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.weekday, .month-weekday { text-align: center; font-size: 11px; font-weight: 600; color: #6c757d; }
.calendar-days, .month-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-day, .month-day { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; font-weight: 500; cursor: pointer; transition: all 0.2s; border: 2px solid transparent; min-height: 42px; position: relative; }
.day-number { font-size: 14px; }
.service-indicator { position: absolute; bottom: 5px; width: 6px; height: 6px; background-color: #FF6B35; border-radius: 50%; }
.calendar-day.selected .service-indicator, .month-day.selected .service-indicator { background-color: white; }
.calendar-day.past, .month-day.past { color: #adb5bd; }
.calendar-day.selected, .month-day.selected { background-color: #4A90E2; color: white; font-weight: 600; }
.calendar-day.is-today, .month-day.is-today { border-color: #FF6B35; }
.month-day { min-height: 38px; }
.month-day.other-month { color: #dee2e6; }
.hidden { display: none !important; }
.status-cards { display: flex; flex-direction: column; gap: 12px; }
.status-card { background: white; border-radius: 14px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #f1f3f4; }
.card-header h4 { font-size: 14px; font-weight: 600; margin: 0; }
.order-count { background: #e9ecef; color: #495057; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; }
.card-content { padding: 4px 8px 8px 8px; display: flex; flex-direction: column; gap: 6px; }
.placeholder-text { color: #94a3b8; font-style: italic; font-size: 13px; text-align: center; padding: 16px 0; }
.order-card { background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 10px; transition: all 0.3s; }
.order-card.expanded { box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-color: #dee2e6; }
.order-card-header { display: flex; align-items: center; padding: 10px; gap: 10px; cursor: pointer; }
.order-status-indicator { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.order-status-indicator.status-scheduled { background: #6c757d; }
.order-status-indicator.status-in_progress { background: #ffc107; }
.order-status-indicator.status-completed { background: #28a745; }
.order-info { flex: 1; min-width: 0; }
.order-customer { font-weight: 600; font-size: 14px; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-details { display: flex; gap: 6px; font-size: 12px; color: #6b7280; }
.order-meta { text-align: right; }
.order-time { font-size: 13px; font-weight: 600; color: #343a40; }
.order-number { font-size: 11px; color: #6c757d; }
.order-expanded-content { padding: 0 10px 10px 10px; animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.customer-details { padding: 10px; background-color: #fff; border-radius: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; border: 1px solid #e9ecef; }
.detail-row { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; }
.detail-label { color: #6c757d; display: flex; align-items: center; white-space: nowrap; }
.detail-value { color: #374151; word-break: break-word; }
.order-actions { margin-top: 10px; display: flex; gap: 8px; }
.action-btn { padding: 8px 16px; border: none; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.action-btn.primary { background: #4A90E2; color: white; }
.action-btn.primary:hover { background: #357ABD; box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3); }

/* Loading spinner */
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center; z-index: 9999; backdrop-filter: blur(2px); }
.loading-spinner { text-align: center; }
.spinner { width: 40px; height: 40px; border: 4px solid #f3f3f3; border-top: 4px solid #4A90E2; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 10px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loading-spinner p { color: #666; font-size: 14px; font-weight: 500; }

/* Toast notifications */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; }
.toast { padding: 12px 16px; margin-bottom: 10px; border-radius: 6px; color: white; font-weight: 500; max-width: 300px; opacity: 0; transform: translateX(100%); transition: all 0.3s ease; }
.toast.show { opacity: 1; transform: translateX(0); }
.toast.info { background-color: #3b82f6; }
.toast.success { background-color: #10b981; }
.toast.error { background-color: #ef4444; }
.toast.warning { background-color: #f59e0b; }/* Lysegrønn bakgrunn for ferdige ordre */
.order-card.status-completed {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.order-card.status-completed:hover {
    background-color: #c3e6cb;
}
/* Grønn prikk for dager med kun ferdige ordre */
.service-indicator.completed {
    background-color: #28a745;
}

.calendar-day.all-completed,
.month-day.all-completed {
    background-color: #f0f9ff;
}
/* Utvidet ordrekort styling */
.order-card-details {
    padding: 16px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.customer-info-section,
.description-section {
    margin-bottom: 16px;
}

.info-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.customer-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-label {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: #212529;
    font-weight: 400;
}

.description-text {
    font-size: 14px;
    color: #495057;
    line-height: 1.5;
    margin: 0;
}

/* Forbedret hover effekt for ordrekort */
.order-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Lysegrønn bakgrunn for ferdige ordre */
.order-card.status-completed {
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.order-card.status-completed:hover {
    background-color: #c3e6cb;
}

.customer-info-section {
    margin-bottom: 12px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.customer-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-label {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
}

.info-value {
    font-size: 13px;
    color: #212529;
}
/* Justeringer for ordrekort - bredere knapp, fet skrift, konsistent tekststørrelse */

/* 1. Åpne ordre knapp skal dekke nesten hele bredden */
.order-card-details .action-btn.primary.open-order-btn {
    width: calc(100% - 8px) !important;
    margin: 12px 4px 0 4px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
}

/* 2. Fet skrift på alle labels/overskrifter */
.order-card-details .info-label {
    font-weight: 600 !important; /* Øker fra 500 til 600 */
}

.order-card-details .detail-label {
    font-weight: 600 !important; /* Øker fra standard til 600 */
    font-size: 12px; /* Beholder samme størrelse som info-label */
}

/* 3. Beskrivelse får samme skriftstørrelse som andre verdier */
.order-card-details .detail-item span:not(.detail-label) {
    font-size: 14px !important; /* Matcher info-value størrelse */
    color: #212529; /* Matcher info-value farge */
    font-weight: 400; /* Matcher info-value vekt */
}

/* KOMPLETT CSS FIX for admin layout - legg til i main.css eller egen fil */

/* Reset og base styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f7fa;
}

/* Admin container layout */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar styling */
.admin-sidebar {
    width: 250px;
    background-color: #1f2937;
    color: white;
    flex-shrink: 0;
}

.admin-logo {
    padding: 20px;
    border-bottom: 1px solid #374151;
}

.admin-logo h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.admin-menu {
    padding: 20px 0;
}

.menu-item {
    display: block;
    padding: 12px 20px;
    color: #d1d5db;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.menu-item:hover {
    background-color: #374151;
    color: white;
}

.menu-item.active {
    background-color: #3b82f6;
    color: white;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: white;
}

/* Main content area */
main {
    flex: 1;
    background-color: #f5f7fa;
    overflow-x: hidden;
}

/* Planner specific styles */
.planner-container {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.planner-header {
    margin-bottom: 30px;
}

.planner-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 12px 0;
}

/* Filter og instructions */
.planner-instructions {
    background-color: #e0f2fe;
    border: 1px solid #7dd3fc;
    border-radius: 8px;
    padding: 16px 20px;
    color: #075985;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.simple-filter {
    margin-bottom: 24px;
    background-color: white;
    padding: 16px 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
    }
    
    .planner-container {
        padding: 20px;
    }
}

/* Filter bar styling */
.filter-bar {
    background: white;
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.filter-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.filter-group select {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #374151;
    transition: all 0.2s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-group {
    display: flex;
}

.search-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

.search-group input:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-group input::placeholder {
    color: #9ca3af;
}

/* Order search card styling */
.order-search-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.order-search-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Status indicator styling */
.order-search-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #6b7280; /* Default gray */
}

.order-search-card.status-pending::before {
    background-color: #f59e0b; /* Orange */
}

.order-search-card.status-scheduled::before {
    background-color: #3b82f6; /* Blue */
}

.order-search-card.status-in_progress::before {
    background-color: #fbbf24; /* Yellow */
}

.order-search-card.status-completed::before {
    background-color: #10b981; /* Green */
}

/* Card main info layout */
.card-main-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.order-summary h3.customer-name {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.order-summary p.order-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 4px 0;
    font-weight: 500;
}

.order-summary p.customer-address {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

.order-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-meta span {
    font-size: 12px;
    color: #6b7280;
}

.order-meta .technician-name {
    font-weight: 500;
}

.order-meta .order-date {
    font-weight: 400;
}

/* Card actions styling */
.card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.details-btn,
.take-over-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.details-btn {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.details-btn:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
}

.take-over-btn {
    background-color: #4A90E2;
    color: white;
    border: 1px solid #4A90E2;
}

.take-over-btn:hover {
    background-color: #357ABD;
    border-color: #357ABD;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.3);
}

/* Status-specific card styling */
.order-search-card.status-completed {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}

.order-search-card.status-completed:hover {
    background-color: #ecfdf5;
}

.order-search-card.status-in_progress {
    background-color: #fffbeb;
    border-color: #fed7aa;
}

.order-search-card.status-in_progress:hover {
    background-color: #fef3c7;
}

/* Responsive design */
@media (min-width: 640px) {
    .filter-group {
        margin-bottom: 0;
    }
    
    .card-main-info {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
    
    .order-summary {
        flex: 1;
    }
    
    .order-meta {
        text-align: right;
        min-width: 140px;
    }
    
    .card-actions {
        justify-content: flex-start;
    }
}

/* Placeholder text styling */
.placeholder-text {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    border: 2px dashed #d1d5db;
}

/* Modal styling for order details */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 24px;
}
/* MODAL MOBILE FIX - Kun modal, ikke kort-design */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 12px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .modal-content {
        max-width: none;
        width: 100%;
        max-height: calc(100vh - 80px);
        border-radius: 12px 12px 0 0;
    }
    
    .modal-header {
        padding: 14px 16px;
        background-color: #f8f9fa;
    }
    
    .modal-body {
        padding: 16px;
        font-size: 14px;
    }
}
/* MODAL MOBILE FIX */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 12px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .modal-content {
        max-width: none;
        width: 100%;
        max-height: calc(100vh - 80px);
        border-radius: 12px 12px 0 0;
    }
    
    .modal-header {
        padding: 14px 16px;
        background-color: #f8f9fa;
    }
    
    .modal-header h2 {
        font-size: 16px;
    }
    
    .modal-close-btn {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }
    
    .modal-body {
        padding: 16px;
        font-size: 14px;
    }
    
    .modal-body strong {
        display: block;
        margin-bottom: 2px;
        font-size: 12px;
    }
    
    .modal-body p {
        margin: 6px 0;
        font-size: 13px;
    }
}
/* Page title section */
.page-title-section {
    padding: 20px 16px 16px 16px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.page-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Oppdater filter-bar spacing */
.filter-bar {
    margin-top: 0;
    margin-bottom: 16px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .page-title-section {
        padding: 16px 12px 12px 12px;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .page-description {
        font-size: 13px;
    }
}
/* Kalender status-prikker - konsistent med ordre-kort */
.service-indicator { 
    position: absolute; 
    bottom: 5px; 
    width: 6px; 
    height: 6px; 
    border-radius: 50%; 
    /* FJERNET: background-color: #FF6B35; - bruker status-klasser nå */
}

/* Grå prikk = Bare planlagte ordre */
.service-indicator.scheduled { 
    background-color: #6c757d;
}

/* Gul prikk = Minst én ordre pågår */
.service-indicator.in-progress { 
    background-color: #ffc107;
}

/* Grønn prikk = Alle ordre fullført */
.service-indicator.completed { 
    background-color: #28a745;
}

/* Hvit prikk når dag er valgt (for å se mot blå bakgrunn) */
.calendar-day.selected .service-indicator,
.month-day.selected .service-indicator { 
    background-color: white; 
}