/* DS Salgsystem — Main Styles */

* { margin: 0; padding: 0; box-sizing: border-box; }

body.ds-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
}

/* Layout */
.ds-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.ds-sidebar {
    width: 240px;
    background: #1a1a2e;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.ds-sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ds-sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.ds-user-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
}

.ds-user-role {
    display: block;
    font-size: 12px;
    opacity: 0.6;
    margin-top: 2px;
}

/* Navigation */
.ds-nav {
    list-style: none;
    padding: 12px 0;
    flex: 1;
    overflow-y: auto;
}

.ds-nav li a {
    display: block;
    padding: 10px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
}

.ds-nav li a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.ds-nav li.active a {
    background: rgba(74,108,247,0.25);
    color: #fff;
    border-right: 3px solid #4a6cf7;
}

/* Sidebar footer */
.ds-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.ds-logout {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 13px;
}
.ds-logout:hover { color: #fff; }

/* Main content */
.ds-main {
    flex: 1;
    margin-left: 240px;
    padding: 32px;
    min-height: 100vh;
}

.ds-content {
    max-width: 1200px;
    margin: 0 auto;
}

/* Page heading */
.ds-page-header {
    margin-bottom: 24px;
}

.ds-page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
}

/* Cards */
.ds-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.ds-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a2e;
}

/* Stats boxes */
.ds-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ds-stat-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.ds-stat-box .label {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.ds-stat-box .value {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
}

/* Progress bar */
.ds-progress-container {
    margin-bottom: 24px;
}

.ds-progress-bar {
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.ds-progress-fill {
    height: 100%;
    background: #4a6cf7;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.ds-progress-fill.reached {
    background: #28a745;
}

.ds-progress-text {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
}

/* Tables */
.ds-table {
    width: 100%;
    border-collapse: collapse;
}

.ds-table th,
.ds-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.ds-table th {
    font-weight: 600;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ds-table tbody tr:hover {
    background: #f8f9fa;
}

.ds-table tbody tr.clickable {
    cursor: pointer;
}

/* Status indicators */
.ds-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.ds-status.red { background: #dc3545; }
.ds-status.yellow { background: #ffc107; }
.ds-status.green { background: #28a745; }

/* Forms */
.ds-form-group {
    margin-bottom: 16px;
}

.ds-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.ds-form-group input,
.ds-form-group select,
.ds-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.ds-form-group input:focus,
.ds-form-group select:focus,
.ds-form-group textarea:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.1);
}

/* Vilkår rich-text editor */
.ds-vilkar-editor-wrap {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.ds-vilkar-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: #f5f5f7;
    border-bottom: 1px solid #ddd;
}

.ds-vilkar-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    color: #444;
}

.ds-vilkar-toolbar button:hover {
    background: #e2e2e5;
}

.ds-vilkar-toolbar-sep {
    width: 1px;
    height: 20px;
    background: #ddd;
    margin: 0 4px;
}

.ds-vilkar-editable {
    min-height: 120px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    outline: none;
}

.ds-vilkar-editable:focus {
    box-shadow: 0 0 0 3px rgba(74,108,247,0.1);
}

.ds-vilkar-editable:empty::before {
    content: attr(data-placeholder);
    color: #999;
    pointer-events: none;
}

.ds-vilkar-editable ol {
    margin: 4px 0;
    padding-left: 24px;
}

.ds-vilkar-editable ol ol {
    list-style-type: lower-alpha;
}

.ds-vilkar-editable ol ol ol {
    list-style-type: lower-roman;
}

.ds-vilkar-editable li {
    margin-bottom: 2px;
}

.ds-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Buttons */
.ds-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    font-family: inherit;
}

.ds-btn-primary {
    background: #4a6cf7;
    color: #fff;
}
.ds-btn-primary:hover { background: #3a5ce5; }

.ds-btn-success {
    background: #28a745;
    color: #fff;
}
.ds-btn-success:hover { background: #218838; }

.ds-btn-danger {
    background: #dc3545;
    color: #fff;
}
.ds-btn-danger:hover { background: #c82333; }

.ds-btn-secondary {
    background: #6c757d;
    color: #fff;
}
.ds-btn-secondary:hover { background: #5a6268; }

.ds-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.ds-btn-xs {
    padding: 3px 10px;
    font-size: 11px;
}

.ds-btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #333;
}
.ds-btn-outline:hover {
    background: #f8f9fa;
}

.ds-ai-summary-label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    margin-top: 14px;
    margin-bottom: 2px;
}

.ds-ai-refresh-btn {
    margin-top: 6px;
    color: #888;
    border-color: #ddd;
    font-size: 11px;
}
.ds-ai-refresh-btn:hover {
    color: #555;
    border-color: #bbb;
}
.ds-ai-refresh-error {
    display: inline-block;
    margin-left: 8px;
    color: #dc3545;
    font-size: 12px;
}

/* Placeholder content */
.ds-placeholder {
    text-align: center;
    padding: 80px 20px;
    color: #666;
}

.ds-placeholder h2 {
    margin-bottom: 8px;
}

/* Alerts */
.ds-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}
.ds-alert-success { background: #d4edda; color: #155724; }
.ds-alert-error { background: #f8d7da; color: #721c24; }
.ds-alert-warning { background: #fff3cd; color: #856404; }

/* Search field */
.ds-search {
    margin-bottom: 16px;
}

.ds-search input {
    width: 100%;
    max-width: 400px;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

/* Export dropdown */
.ds-export-dropdown {
    position: relative;
}

.ds-export-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 50;
    min-width: 120px;
    overflow: hidden;
}

.ds-export-menu.open {
    display: block;
}

.ds-export-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: background 0.1s;
}

.ds-export-menu a:hover {
    background: #f0f2f5;
}

/* ══════════════════════════════════════════════════════════
   UNIFIED COMPANY PAGE — Shared styles for prospect & customer
   ══════════════════════════════════════════════════════════ */

/* ── Header ── */
.ds-company-header {
    margin-bottom: 24px;
}

.ds-company-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px 0;
}

.ds-company-totals {
    display: flex;
    gap: 24px;
    font-size: 15px;
    color: #555;
    margin-bottom: 8px;
}

.ds-company-nav {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* ── Company info card ── */
.ds-company-info-card {
    position: relative;
}

.ds-company-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.ds-company-info-header h3 {
    margin: 0;
}

.ds-company-info-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ds-company-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 32px;
}

.ds-company-info-col {
    display: flex;
    flex-direction: column;
}

.ds-company-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.ds-company-info-row:last-child {
    border-bottom: none;
}

.ds-company-info-row strong {
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
    margin-right: 12px;
}

.ds-company-info-row span {
    color: #333;
    text-align: right;
    word-break: break-word;
}

.ds-company-info-row a {
    color: #4a6cf7;
    text-decoration: none;
}

.ds-company-info-row a:hover {
    text-decoration: underline;
}

/* ── Status badges ── */
.ds-company-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ds-badge-prospekt {
    background: #e9ecef;
    color: #555;
}

.ds-badge-kunde {
    background: #d4edda;
    color: #155724;
}

/* ── Edit form actions ── */
.ds-company-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* ── Customer registration panel ── */
.ds-customer-reg-panel {
    border: 2px solid #28a745;
    border-radius: 12px;
}

/* ── Chat log (notes + meetings) ── */
.ds-chat-log {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 12px;
    padding-right: 4px;
}

.ds-chat-entry {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ds-chat-entry:last-child {
    border-bottom: none;
}

/* ── Note entry ── */
.ds-chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4a6cf7;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.ds-chat-body {
    flex: 1;
    min-width: 0;
}

.ds-chat-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.ds-chat-meta strong {
    color: #333;
    font-size: 13px;
}

.ds-chat-meta span {
    margin-left: 8px;
}

.ds-chat-text {
    font-size: 14px;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ── Note entry — chat bubble style ── */
.ds-chat-note .ds-chat-body {
    background: #e8f4f8;
    border-radius: 10px;
    border-top-left-radius: 2px;
    padding: 8px 12px;
}

.ds-chat-note .ds-chat-text {
    margin-top: 2px;
}

/* ── Meeting entry in chat log ── */
.ds-chat-meeting {
    flex-direction: column;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 14px;
    margin: 6px 0;
    border: 1px solid #e9ecef;
    border-left: 3px solid #4a6cf7;
}

.ds-chat-meeting-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.ds-chat-meeting-icon {
    font-size: 18px;
}

.ds-chat-meeting-label {
    font-weight: 600;
    color: #1a1a2e;
    font-size: 14px;
}

.ds-chat-meeting-datetime {
    font-size: 13px;
    color: #555;
}

.ds-chat-meeting-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.ds-chat-meeting-badge-planlagt {
    background: #fff3cd;
    color: #856404;
}

.ds-chat-meeting-badge-gjennomfort {
    background: #d4edda;
    color: #155724;
}

.ds-chat-meeting-outcome {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    background: #e8f4f8;
    color: #0c5460;
    margin-left: 4px;
}

.ds-chat-meeting-notes {
    margin-top: 8px;
}

.ds-chat-meeting-notes textarea {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 40px;
}

.ds-chat-meeting-notes textarea:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.1);
}

.ds-chat-meeting-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.ds-chat-meeting-notes-saved {
    font-size: 12px;
    color: #28a745;
    display: none;
}

/* ── Activity entry in chat log ── */
.ds-chat-activity {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ds-chat-activity:last-child {
    border-bottom: none;
}

.ds-chat-activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.ds-chat-activity-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

/* ── Note input at bottom of chat ── */
.ds-note-input {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.ds-note-input textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.15s;
}

.ds-note-input textarea:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,0.1);
}

.ds-company-muted {
    color: #bbb;
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* ── Tabs ── */
.ds-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
    gap: 0;
}

.ds-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.ds-tab:hover {
    color: #333;
}

.ds-tab.active {
    color: #4a6cf7;
    border-bottom-color: #4a6cf7;
}

.ds-tab-content {
    /* shown/hidden via JS */
}

.ds-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.ds-tab-filters {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ds-tab-filters select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

/* ── Filter buttons ── */
.ds-filter-btn {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
}

.ds-filter-btn:hover {
    background: #f0f2f5;
    color: #333;
}

.ds-filter-btn.active {
    background: #4a6cf7;
    color: #fff;
    border-color: #4a6cf7;
}

/* ── Sale block (expand/collapse) ── */
.ds-sale-block {
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.ds-sale-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.ds-sale-block-header:hover {
    background: #f0f2f5;
}

.ds-sale-block-sums {
    display: flex;
    gap: 16px;
    font-size: 14px;
    align-items: center;
}

.ds-sale-toggle-icon {
    font-size: 10px;
    color: #999;
    transition: transform 0.2s;
}

.ds-sale-toggle-open {
    transform: rotate(180deg);
}

.ds-sale-items {
    border-top: 1px solid #e9ecef;
    padding: 0 16px 14px;
}

.ds-sale-items .ds-table {
    margin-top: 10px;
}

/* ── Invoice block ── */
.ds-invoice-block {
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #e9ecef;
    padding: 14px 16px;
}

.ds-invoice-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.ds-invoice-block-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ds-invoice-ref {
    font-size: 13px;
    color: #666;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
}

.ds-invoice-block-right {
    display: flex;
    gap: 16px;
    font-size: 14px;
    align-items: center;
}

.ds-invoice-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

/* ── Status dots ── */
.ds-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.ds-status-grey {
    background: #adb5bd;
}

.ds-status-red {
    background: #dc3545;
}

.ds-status-orange {
    background: #fd7e14;
}

.ds-status-green {
    background: #28a745;
}

/* Responsive */
@media (max-width: 768px) {
    .ds-company-info-grid {
        grid-template-columns: 1fr;
    }

    .ds-company-info-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ds-company-totals {
        flex-direction: column;
        gap: 4px;
    }

    .ds-note-input {
        flex-direction: column;
    }

    .ds-chat-meeting-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ds-tab-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ds-sale-block-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .ds-sale-block-sums {
        flex-wrap: wrap;
        gap: 8px;
    }

    .ds-invoice-block-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ds-invoice-block-right {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* ── Mobile sidebar toggle ── */
.ds-sidebar-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 12px;
    z-index: 1100;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 22px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    line-height: 1;
}

.ds-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

.ds-sidebar-overlay.open {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .ds-sidebar-toggle {
        display: flex;
    }

    .ds-sidebar {
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .ds-sidebar.open {
        transform: translateX(0);
    }

    .ds-main {
        margin-left: 0;
        padding: 20px 12px;
        padding-top: 64px;
    }

    .ds-content {
        max-width: 100%;
    }

    .ds-page-header h1 {
        font-size: 20px;
    }

    .ds-stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .ds-stat-box {
        padding: 14px;
    }

    .ds-stat-box .label {
        font-size: 12px;
    }

    .ds-stat-box .value {
        font-size: 18px;
    }

    .ds-card {
        padding: 14px;
        border-radius: 10px;
    }

    .ds-card h3 {
        font-size: 15px;
    }

    /* Tables: horizontal scroll wrapper */
    .ds-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -14px;
        padding: 0 14px;
    }

    .ds-table {
        min-width: 500px;
    }

    .ds-table th,
    .ds-table td {
        padding: 8px 10px;
        font-size: 13px;
        white-space: nowrap;
    }

    .ds-table td.ds-wrap-cell {
        white-space: normal;
        word-break: break-word;
    }

    .ds-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .ds-btn-sm {
        padding: 5px 10px;
        font-size: 12px;
    }

    .ds-form-row {
        grid-template-columns: 1fr;
    }

    .ds-form-group input,
    .ds-form-group select,
    .ds-form-group textarea {
        font-size: 16px; /* prevents iOS zoom on focus */
    }

    .ds-search input {
        max-width: 100%;
        font-size: 16px;
    }

    /* Offset toggle button when cross-nav bar is present */
    .ds-system-nav ~ .ds-sidebar-toggle {
        top: 50px;
    }

    .ds-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .ds-tabs::-webkit-scrollbar {
        display: none;
    }

    .ds-tab {
        white-space: nowrap;
        padding: 10px 14px;
        font-size: 13px;
    }

    /* Progress bar */
    .ds-progress-text {
        font-size: 13px;
    }

    /* Company page */
    .ds-company-header h1 {
        font-size: 20px;
    }

    .ds-company-info-row {
        flex-direction: column;
        gap: 2px;
    }

    .ds-company-info-row span {
        text-align: left;
    }

    .ds-company-nav {
        flex-wrap: wrap;
    }

    .ds-company-edit-actions {
        flex-wrap: wrap;
    }

    /* Chat / notes */
    .ds-chat-log {
        max-height: 300px;
    }

    .ds-chat-entry {
        gap: 8px;
    }

    .ds-chat-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .ds-chat-text {
        font-size: 13px;
    }

    .ds-chat-meeting {
        padding: 10px;
    }

    .ds-chat-meeting-actions {
        flex-wrap: wrap;
    }

    /* Sale blocks */
    .ds-sale-block-sums {
        font-size: 13px;
    }

    /* Invoice blocks */
    .ds-invoice-block {
        padding: 10px 12px;
    }

    .ds-invoice-block-right {
        font-size: 13px;
    }

    /* Export dropdown */
    .ds-export-menu {
        right: auto;
        left: 0;
    }

    /* Filter buttons */
    .ds-tab-filters {
        flex-wrap: wrap;
    }

    .ds-filter-btn {
        font-size: 12px;
        padding: 5px 10px;
    }

    /* Vilkår editor */
    .ds-vilkar-editable {
        min-height: 80px;
        font-size: 14px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .ds-stats-row {
        grid-template-columns: 1fr;
    }

    .ds-stat-box .value {
        font-size: 20px;
    }

    .ds-main {
        padding: 16px 10px;
        padding-top: 60px;
    }
}
