/* Luxalent CRM - Modern Premium SaaS Stylesheet (Bulgarian Edition) */

:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-subtle: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --navy-sidebar: #0f172a;
    --navy-sidebar-hover: #1e293b;
    --navy-sidebar-active: #2563eb;
    --navy-text: #f8fafc;
    --navy-text-muted: #94a3b8;

    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;

    --success: #10b981;
    --success-hover: #059669;
    --success-light: #ecfdf5;

    --warning: #f97316;
    --warning-hover: #ea580c;
    --warning-light: #fff7ed;

    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #fef2f2;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--navy-sidebar);
    color: var(--navy-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid #1e293b;
    z-index: 40;
}

.sidebar-brand {
    padding: 20px 16px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.1) 100%);
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar-brand-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 16px;
    width: 100%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    transition: all 0.25s ease;
}

.sidebar-brand:hover .sidebar-brand-wrapper {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.sidebar-brand img {
    height: 46px;
    width: auto;
    max-width: 195px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
    transition: transform 0.2s ease;
}

.sidebar-brand-badge {
    margin-top: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 7px;
}

.sidebar-brand-badge .badge-dot {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--navy-text-muted);
    padding: 12px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    margin-bottom: 3px;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background-color: var(--navy-sidebar-hover);
    color: #ffffff;
}

.nav-item.active {
    background-color: var(--navy-sidebar-active);
    color: #ffffff;
    font-weight: 600;
}

.nav-item .icon {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

.nav-item .badge-count {
    margin-left: auto;
    background-color: rgba(255, 255, 255, 0.18);
    font-size: 0.75rem;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.sidebar-footer {
    padding: 16px 18px;
    border-top: 1px solid #1e293b;
    background-color: rgba(15, 23, 42, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-snippet {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background-color: #3b82f6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-meta-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
}

.user-meta-role {
    font-size: 0.75rem;
    color: var(--navy-text-muted);
}

.btn-logout {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: color 0.15s;
}

.btn-logout:hover {
    color: #ef4444;
}

/* Main Content */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background-color: #ffffff;
    height: 64px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 30;
}

@media (min-width: 1600px) {
    .topbar {
        padding: 0 40px;
    }
}

@media (min-width: 2400px) {
    .topbar {
        padding: 0 48px;
    }
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.content-body {
    flex: 1;
    padding: 24px 32px;
    max-width: 100%;
    width: 100%;
    margin: 0;
}

@media (min-width: 1600px) {
    .content-body {
        padding: 28px 40px;
    }
}

@media (min-width: 2400px) {
    .content-body {
        max-width: 2200px;
        margin: 0 auto;
        padding: 32px 48px;
    }
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 1.08rem;
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Grid & Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.metric-label {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.metric-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.metric-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.82rem;
}

.btn-lg {
    padding: 12px 22px;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background-color: var(--success-hover);
}

.btn-warning {
    background-color: var(--warning);
    color: #ffffff;
}

.btn-warning:hover {
    background-color: var(--warning-hover);
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: #f1f5f9;
}

.btn-primary-gradient {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    font-weight: 700;
    padding: 10px 20px;
    font-size: 0.92rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary-gradient:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
    color: #ffffff;
}

/* Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    white-space: nowrap !important;
    line-height: 1.2;
}

.badge-blue { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.badge-purple { background: #faf5ff; color: #7e22ce; border-color: #e9d5ff; }
.badge-indigo { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.badge-sky { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.badge-amber { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge-emerald { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.badge-orange { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.badge-cyan { background: #ecfeff; color: #155e75; border-color: #a5f3fc; }
.badge-green { background: #dcfce7; color: #166534; border-color: #86efac; }
.badge-slate { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.badge-rose { background: #ffe4e6; color: #9f1239; border-color: #fecdd3; }
.badge-gray { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }

/* Recurring Subscription & One-time Project Badges */
.badge-recurring {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    margin-top: 4px;
}

.badge-onetime {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 4px;
}

/* Lead Score Badges */
.score-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.score-high { background-color: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.score-med { background-color: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.score-low { background-color: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

/* Tables & Responsive Scrolling */
.table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    position: relative;
    cursor: default;
}

/* Grab to scroll when table has overflow */
.table-responsive.has-overflow {
    cursor: grab;
}

.table-responsive.is-dragging {
    cursor: grabbing !important;
    user-select: none !important;
}

.table-responsive.is-dragging * {
    user-select: none !important;
    pointer-events: none !important;
}

/* Prominent, comfortable 12px horizontal scrollbar */
.table-responsive::-webkit-scrollbar {
    height: 12px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin: 0 4px 4px 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 9999px;
    border: 2px solid #f1f5f9;
    transition: background-color 0.15s ease;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

.table-responsive::-webkit-scrollbar-thumb:active {
    background: #2563eb;
}

/* Visual edge scroll indicator cues */
.table-responsive.has-scroll-left::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 12px;
    left: 0;
    width: 24px;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0) 100%);
    pointer-events: none;
    z-index: 10;
}

.table-responsive.has-scroll-right::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 12px;
    right: 0;
    width: 24px;
    background: linear-gradient(270deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0) 100%);
    pointer-events: none;
    z-index: 10;
}

/* Quick Scroll Navigation Controls */
.table-scroll-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 0.78rem;
    color: #64748b;
}

.table-scroll-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    padding: 3px 9px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    transition: all 0.15s;
    line-height: 1.2;
}

.table-scroll-btn:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

/* On tablets and smaller laptop windows, prevent column crush */
@media (max-width: 1200px) {
    .data-table {
        min-width: 950px;
    }
}

/* On desktop, table takes 100% width and breathes naturally */
@media (min-width: 1201px) {
    .data-table {
        min-width: 100%;
    }
}

.data-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 14px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap !important;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

.data-table tr:hover td {
    background-color: #f8fafc;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.cell-nowrap {
    white-space: nowrap !important;
}

.cell-money-negative {
    color: #dc2626;
    font-weight: 600;
    white-space: nowrap !important;
    display: inline-block;
}

.cell-money-positive {
    color: #059669;
    font-weight: 800;
    white-space: nowrap !important;
}

.month-navigator {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.month-nav-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.month-nav-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.month-nav-btn.active {
    background: #ffffff;
    color: #0f172a;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    color: var(--text-main);
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Fast Calling Queue Card */
.queue-card {
    background-color: #ffffff;
    border: 2px solid #3b82f6;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.script-box {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #2563eb;
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    margin: 16px 0;
    font-size: 0.96rem;
    color: #1e293b;
    line-height: 1.6;
    position: relative;
    white-space: pre-line;
}

.script-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 4px 9px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.script-copy-btn:hover {
    background-color: #eff6ff;
    color: #2563eb;
}

.talking-points-list {
    list-style: none;
    margin: 12px 0;
}

.talking-points-list li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    font-size: 0.92rem;
}

.talking-points-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 800;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 580px;
    overflow: hidden;
    animation: modalSlide 0.2s ease;
}

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

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* Tabs */
.tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    gap: 8px;
}

.tab-btn {
    padding: 10px 16px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Flash Messages */
.flash-alert {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* Financial Breakdown Card */
.calc-breakdown {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-top: 14px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.92rem;
}

.calc-row.highlight {
    font-weight: 700;
    font-size: 1.05rem;
    border-top: 1px solid #cbd5e1;
    margin-top: 6px;
    padding-top: 10px;
}

/* Estimated Commission Card */
.est-commission-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #86efac;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin: 14px 0;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.admin-override-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 12px;
}

/* Toggle Switch & Net/Gross Controls */
.toggle-switch-group {
    display: inline-flex;
    align-items: center;
    background: #e2e8f0;
    padding: 3px;
    border-radius: 8px;
    gap: 3px;
}

.toggle-switch-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.toggle-switch-btn:hover {
    color: #1e293b;
}

.toggle-switch-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    font-weight: 700;
}

.toggle-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    user-select: none;
    padding: 6px 12px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    transition: all 0.15s ease;
}

.toggle-checkbox-label:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.toggle-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
    cursor: pointer;
}

/* Mobile shell: content stays in place while the full navigation opens as a drawer. */
.mobile-menu-toggle,
.mobile-menu-close,
.mobile-bottom-nav,
.mobile-nav-backdrop,
.mobile-action-label { display: none; }
.mobile-page-title { display: none; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

@media (max-width: 900px) {
    html { scroll-padding-top: 72px; }
    body { overflow-x: hidden; }
    .app-container { display: block; min-height: 100dvh; }
    .main-wrapper { min-width: 0; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
    .topbar {
        height: 62px;
        padding: 0 16px;
        gap: 12px;
        box-shadow: none;
    }
    .mobile-menu-toggle {
        display: inline-grid;
        place-items: center;
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        background: transparent;
        color: var(--text-main);
        border: 0;
        border-radius: 12px;
        font-size: 21px;
        cursor: pointer;
    }
    .topbar-title { flex: 1; min-width: 0; font-size: 1.07rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .desktop-page-title { display: none; }
    .mobile-page-title { display: inline; }
    .topbar-actions { gap: 6px; flex-shrink: 0; }
    .topbar-actions .btn { min-height: 40px; padding: 8px 10px; font-size: 0.8rem; white-space: nowrap; }
    .topbar-actions .btn:first-child:not(:last-child) { display: none; }
    .topbar-actions .desktop-action-label { display: none; }
    .topbar-actions .mobile-action-label { display: inline; }
    .topbar-actions { display: none; }
    .is-companies-list .topbar-actions { display: flex; }
    .content-body { padding: 18px 14px 24px; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(310px, 86vw);
        height: 100dvh;
        z-index: 101;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: 12px 0 40px rgb(15 23 42 / 0.18);
        visibility: hidden;
    }
    .sidebar.is-open { transform: translateX(0); visibility: visible; }
    .sidebar-brand { padding: 17px 58px 14px 16px; }
    .sidebar-brand-wrapper { box-shadow: none; }
    .sidebar-nav { display: block; padding: 12px; overflow-y: auto; overflow-x: hidden; }
    .nav-item { min-height: 46px; font-size: 0.94rem; }
    .mobile-menu-close {
        display: grid;
        place-items: center;
        position: absolute;
        top: 18px;
        right: 12px;
        width: 40px;
        height: 40px;
        border: 1px solid #334155;
        border-radius: 10px;
        background: #1e293b;
        color: white;
        font-size: 27px;
        line-height: 1;
        cursor: pointer;
    }
    .mobile-nav-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 100; background: rgb(15 23 42 / 0.55); }
    body.mobile-nav-open { overflow: hidden; }
    .mobile-bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        position: fixed;
        inset: auto 0 0;
        z-index: 50;
        min-height: calc(70px + env(safe-area-inset-bottom));
        padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
        background: rgb(255 255 255 / 0.97);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -8px 24px rgb(15 23 42 / 0.06);
        backdrop-filter: blur(12px);
    }
    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2px;
        min-width: 0;
        min-height: 54px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: #64748b;
        font: inherit;
        font-size: clamp(0.58rem, 2.5vw, 0.72rem);
        font-weight: 650;
        text-decoration: none;
        cursor: pointer;
    }
    .mobile-tab-icon { display: grid; place-items: center; width: 44px; height: 29px; border-radius: 999px; }
    .mobile-tab-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
    .mobile-bottom-nav .active { color: #1d4ed8; }
    .mobile-bottom-nav .active .mobile-tab-icon { background: #dbeafe; }
    .card { padding: 17px; margin-bottom: 16px; border-radius: 13px; }
    .card-title { flex-wrap: wrap; gap: 9px; margin-bottom: 14px; }
    .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; margin-bottom: 16px; }
    .metric-card { min-width: 0; padding: 15px; }
    .metric-label { font-size: 0.72rem; line-height: 1.3; }
    .metric-value { font-size: clamp(1.25rem, 5vw, 1.65rem); overflow-wrap: anywhere; }
    .btn { min-height: 40px; }
    .btn-sm { min-height: 38px; }
    .form-control { min-height: 44px; font-size: 16px; }
    textarea.form-control { min-height: 100px; resize: none; }
    .tabs-nav { overflow-x: auto; overscroll-behavior-x: contain; white-space: nowrap; scrollbar-width: thin; margin-bottom: 17px; }
    .tab-btn { flex: 0 0 auto; min-height: 44px; }
    .table-responsive { max-width: 100%; overscroll-behavior-x: contain; }
    .data-table { min-width: 680px; }
    .data-table th, .data-table td { padding: 11px 12px; }
    .modal-overlay { padding: 12px; align-items: flex-end; }
    .modal-box { max-height: calc(100dvh - 24px); display: flex; flex-direction: column; border-radius: 18px 18px 12px 12px; }
    .modal-header { padding: 15px 18px; flex-shrink: 0; }
    .modal-body { padding: 17px 18px; max-height: none; overflow-y: auto; overscroll-behavior: contain; }
    .modal-footer { padding: 13px 18px calc(13px + env(safe-area-inset-bottom)); flex-wrap: wrap; flex-shrink: 0; }
    .modal-footer .btn { flex: 1 1 auto; }
    .queue-card { padding: 18px; }
    .script-box { padding: 16px; overflow-wrap: anywhere; }
    .script-copy-btn { position: static; float: right; margin: 0 0 8px 8px; }
    .calc-row { gap: 12px; }
    .calc-row > :last-child { text-align: right; overflow-wrap: anywhere; }
    .month-navigator { max-width: 100%; overflow-x: auto; }
    .month-nav-btn { white-space: nowrap; }
    .mobile-filter-form,
    .mobile-filter-fields { flex-direction: column !important; align-items: stretch !important; min-width: 0; width: 100%; }
    .mobile-filter-fields > div,
    .mobile-filter-fields > select,
    .mobile-filter-fields > input { max-width: 100%; min-width: 0; }
    .mobile-filter-fields .form-control { width: 100% !important; }
    .mobile-filter-fields .month-navigator { width: 100%; }
    .company-hero { padding: 18px !important; }
    .company-hero-layout { display: block !important; }
    .company-hero-layout > div:first-child { min-width: 0; }
    .company-hero-kicker,
    .company-hero-meta { flex-wrap: wrap; overflow-wrap: anywhere; }
    .company-hero-kicker { gap: 7px !important; }
    .company-hero-kicker > span:first-child { flex-basis: 100%; font-size: 0.73rem !important; letter-spacing: 0.025em !important; }
    .company-hero-meta { display: grid !important; gap: 7px !important; font-size: 0.84rem !important; line-height: 1.4; }
    .company-meta-separator { display: none; }
    .company-hero h1 { font-size: clamp(1.35rem, 5.7vw, 1.68rem) !important; line-height: 1.2; margin: 10px 0 8px; overflow-wrap: anywhere; }
    .company-hero-actions { align-items: stretch !important; text-align: left !important; margin-top: 18px; min-width: 0; }
    .company-hero-buttons { flex-wrap: wrap; }
    .company-hero-buttons .btn { flex: 1 1 140px; min-height: 46px; white-space: normal; }
    .company-quick-info { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 16px 12px !important; margin-top: 17px !important; }
    .company-quick-info > div { min-width: 0; overflow-wrap: anywhere; }
    .company-quick-info a { overflow-wrap: anywhere; }
    .is-company-detail .tabs-nav { gap: 6px; border: 0; padding-bottom: 5px; }
    .is-company-detail .tab-btn { min-height: 40px; padding: 8px 13px; border: 1px solid #cbd5e1; border-radius: 999px; background: white; color: #475569; font-size: 0.8rem; }
    .is-company-detail .tab-btn.active { background: #dbeafe; border-color: #bfdbfe; color: #1d4ed8; }
    .companies-filters { padding: 14px !important; }
    .companies-search-row { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 8px !important; }
    .companies-search-row > div { min-width: 0; }
    .companies-search-row .btn { padding-inline: 13px; }
    .companies-search-row .btn-outline { grid-column: 1 / -1; justify-self: start; }
    .companies-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
    .companies-filter-grid > div { min-width: 0; }
    .companies-filter-grid select { width: 100%; font-size: 0.84rem; padding-inline: 9px; }
    .companies-result-heading { align-items: flex-start !important; gap: 12px; flex-wrap: wrap; }
    .companies-result-heading > div:first-child { display: flex; flex-direction: column; }
    .companies-result-heading span[style*="margin-left"] { margin-left: 0 !important; }
    .companies-results { padding: 0 !important; border: 0; background: transparent; box-shadow: none; overflow: visible !important; }
    .companies-results .table-responsive { overflow: visible; }
    .companies-table { display: block; min-width: 0; }
    .companies-table thead { display: none; }
    .companies-table tbody { display: grid; gap: 11px; }
    .companies-table .company-list-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding: 15px; background: white; border: 1px solid var(--border-color); border-radius: 14px; box-shadow: 0 2px 8px rgb(15 23 42 / 0.035); }
    .companies-table .company-list-row td { display: block; min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; font-size: 0.86rem; }
    .companies-table .company-list-row td::before { content: attr(data-label); display: block; margin-bottom: 2px; color: #64748b; font-size: 0.71rem; font-weight: 600; }
    .companies-table .company-list-row .company-list-name { grid-column: 1 / -1; padding-bottom: 8px; border-bottom: 1px solid #e2e8f0; }
    .companies-table .company-list-name a { display: block; font-size: 1rem !important; line-height: 1.3; }
    .companies-table .company-list-row .company-list-actions { grid-column: 1 / -1; padding-top: 4px; }
    .companies-table .company-list-actions > div { display: grid !important; grid-template-columns: 1fr 44px; gap: 8px !important; }
    .companies-table .company-list-actions .btn { display: grid; place-items: center; min-height: 42px; }
    .companies-pagination { gap: 8px; padding: 15px 0 !important; background: transparent !important; border: 0 !important; }
    .companies-pagination > div:nth-child(2) { font-size: 0.75rem !important; text-align: center; }
    [style*="grid-template-columns: 320px 1fr"],
    [style*="grid-template-columns: 2fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr 1fr"],
    [style*="minmax(340px, 1fr)"],
    [style*="minmax(200px, 1fr)"],
    [style*="minmax(220px, 1fr)"] { grid-template-columns: minmax(0, 1fr) !important; }
    .company-quick-info[style] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .company-info-email, .company-info-website { grid-column: 1 / -1; }
    [style*="max-height: calc(100vh - 220px)"] { max-height: 330px !important; }
    img, svg, video, canvas { max-width: 100%; }
    input, select, textarea { max-width: 100%; }
}

@media (max-width: 340px) {
    .topbar-actions .btn { font-size: 0.78rem; }
    .metrics-grid { grid-template-columns: minmax(0, 1fr) !important; }
    .metric-card { padding: 16px; }
    .company-quick-info { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Shared phone records and Android-style actions, September 2026. */
:root { --scroll-thumb:#94a3b8; --scroll-track:#f1f5f9; }
* { scrollbar-color:var(--scroll-thumb) var(--scroll-track); scrollbar-width:thin; }
*::-webkit-scrollbar { width:8px; height:8px; }
*::-webkit-scrollbar-thumb { background:var(--scroll-thumb); border-radius:8px; }
*::-webkit-scrollbar-track { background:var(--scroll-track); }
.record-toggle-cell, .task-section-tabs { display:none; }
.btn:active, .mobile-bottom-nav a:active, .task-section-tab:active { filter:brightness(.94); }
button:disabled { cursor:not-allowed; opacity:.6; }
@media (max-width:900px) {
    body { font-size:15px; }
    .topbar { padding-top:env(safe-area-inset-top); height:calc(60px + env(safe-area-inset-top)); }
    .content-body { padding:14px 12px 24px; }
    .main-wrapper { padding-bottom:calc(80px + env(safe-area-inset-bottom)); }
    .btn, .btn-sm { min-height:46px; padding:10px 14px; font-size:.88rem; line-height:1.3; justify-content:center; text-align:center; }
    .btn-lg { font-size:.98rem; }
    .form-label { line-height:1.35; }
    .status-badge { white-space:normal; line-height:1.35; }
    .metrics-grid { gap:10px; }
    .metric-card { padding:14px !important; }
    .metric-label[style] { flex-wrap:wrap; align-items:flex-start !important; gap:6px; line-height:1.35; }
    .metric-label > span + span { font-size:.62rem !important; }
    .metric-sub { font-size:.76rem; line-height:1.45; }
    .company-list-actions > div[style] { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
    .company-list-actions .btn { min-height:48px !important; font-size:.87rem; }
    .companies-table .company-list-actions .btn { display:flex; gap:6px; }
    .companies-table a[href^="tel:"] { white-space:nowrap; font-variant-numeric:tabular-nums; }
    .mobile-record-container { overflow:visible; border:0; box-shadow:none; }
    .mobile-record-container::before, .mobile-record-container::after { display:none !important; }
    .mobile-record-table.records-ready { display:block; width:100%; min-width:0 !important; border:0; background:transparent; }
    .mobile-record-table.records-ready thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
    .mobile-record-table.records-ready tbody { display:grid; gap:12px; }
    .mobile-record-table .mobile-record { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px 16px; padding:16px; background:var(--bg-card) !important; border:1px solid var(--border-color); border-radius:14px; opacity:1 !important; box-shadow:var(--shadow-sm); }
    .mobile-record-table .mobile-record td { display:block; padding:0; border:0; min-width:0; width:auto !important; white-space:normal !important; text-align:left !important; font-size:.88rem; overflow-wrap:anywhere; }
    .mobile-record-table .mobile-record td[data-label]::before { content:attr(data-label); display:block; color:var(--text-muted); font-size:.69rem; font-weight:600; line-height:1.3; margin-bottom:5px; }
    .mobile-record-table .mobile-record .record-title { grid-column:1/-1; order:-3; padding-bottom:11px; border-bottom:1px solid var(--border-color); }
    .mobile-record-table .mobile-record .record-title::before { display:none; }
    .mobile-record-table .record-title a { display:block; font-size:1.02rem !important; line-height:1.35 !important; }
    .mobile-record-table .mobile-record .record-wide { grid-column:1/-1; }
    .mobile-record-table .record-phone a { display:inline-flex !important; align-items:center; min-height:44px; padding:8px 12px; background:var(--primary-light); border-radius:10px; white-space:nowrap; font-variant-numeric:tabular-nums; font-size:.95rem; }
    .mobile-record-table .record-phone::before { display:none !important; }
    .mobile-record-table .mobile-record .record-actions { grid-column:1/-1; padding-top:12px; border-top:1px solid var(--border-color); }
    .mobile-record-table .record-actions::before { display:none !important; }
    .mobile-record-table .record-actions > div { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px !important; width:100%; }
    .mobile-record-table .record-actions form { display:block !important; }
    .mobile-record-table .record-actions .btn { width:100%; min-height:46px; white-space:normal !important; font-size:.85rem !important; padding:10px !important; }
    .mobile-record-table .record-amount { color:#047857 !important; font-size:1.2rem !important; font-weight:800; }
    .mobile-record-table .mobile-record .record-detail { display:none; }
    .mobile-record-table .record-expanded .record-detail { display:block; }
    .mobile-record-table .mobile-record .record-toggle-cell { display:block; grid-column:1/-1; order:5; }
    .record-toggle { width:100%; min-height:44px; padding:10px 14px; border:1px solid var(--border-color); border-radius:10px; background:var(--bg-main); color:var(--primary); font:inherit; font-size:.83rem; font-weight:600; cursor:pointer; }
    .mobile-record-table .record-empty { display:block; }
    .mobile-record-table .record-empty td { display:block; padding:28px 16px !important; white-space:normal; }
    body[data-page="sales"] .card:has(> .mobile-record-container), body[data-page="commissions"] .card:has(> .mobile-record-container) { background:transparent; border:0; box-shadow:none; overflow:visible !important; }
    body[data-page="sales"] .card:has(> .mobile-record-container) > div:first-child:not(.mobile-record-container) { padding:8px 2px 16px !important; flex-wrap:wrap; gap:8px; }
    .month-navigator { display:grid !important; grid-template-columns:44px minmax(0,1fr) 44px; width:100%; overflow:visible; gap:4px; padding:4px; }
    .month-navigator > * { min-width:0; }
    .month-nav-btn { font-size:0; min-height:42px; display:grid; place-items:center; padding:8px !important; }
    .month-nav-btn:first-child::after { content:'‹'; font-size:25px; }
    .month-nav-btn:nth-child(3)::after { content:'›'; font-size:25px; }
    .month-navigator > :nth-child(2) { font-size:.87rem !important; padding:8px 0 !important; text-align:center; white-space:normal; }
    .month-nav-btn:last-child { grid-column:1/-1; font-size:.78rem; min-height:34px; }
    .mobile-filter-fields { gap:9px !important; }
    .mobile-filter-fields label { margin:0 !important; }
    .mobile-filter-form > div:last-child { flex-wrap:wrap; gap:8px !important; min-width:0; }
    .mobile-filter-form > div:last-child .btn { width:100%; white-space:normal; }
    .task-page-heading > div { width:100%; min-width:0; }
    .task-page-heading h2 { display:none; }
    .task-page-heading > div:last-child { align-items:stretch !important; }
    .task-page-heading form { flex-wrap:wrap; flex:1; }
    .task-page-heading select { width:100% !important; }
    .task-page-heading .btn-primary { width:100%; }
    .task-summary { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:8px !important; margin-bottom:16px !important; }
    .task-summary > .card { padding:10px 12px !important; }
    .task-summary > .card > div:first-child { font-size:.65rem !important; }
    .task-summary > .card > div:last-child { font-size:1.25rem !important; }
    .task-sections-ready .task-section-tabs { display:flex; position:sticky; top:calc(60px + env(safe-area-inset-top)); z-index:20; overflow-x:auto; background:var(--bg-main); gap:6px; padding:8px 0; margin:0 -2px 12px; scroll-snap-type:x proximity; }
    .task-section-tab { flex:0 0 auto; min-height:44px; padding:9px 15px; border:1px solid var(--border-color); border-radius:24px; background:white; color:var(--text-muted); font:inherit; font-size:.84rem; font-weight:600; cursor:pointer; scroll-snap-align:nearest; }
    .task-section-tab[aria-selected="true"] { background:var(--primary); color:white; border-color:var(--primary); }
    .task-sections-ready .task-section { display:none; }
    .task-sections-ready .task-section.is-selected { display:block; }
    .task-section[style], .task-section { padding:0; border:0 !important; background:transparent !important; box-shadow:none !important; touch-action:pan-y; }
    .task-section > div:first-child { padding:10px 2px 14px; }
    .task-section > div:first-child > div:first-child { min-width:0; }
    .task-section h3 { font-size:1.03rem !important; }
    .task-section .card-title { font-size:.97rem; line-height:1.35; }
    .task-section .table-responsive { padding:0 !important; }
    .queue-result-panel { padding:14px !important; }
    .queue-result-actions { display:flex !important; flex-direction:column; gap:12px !important; align-items:stretch !important; }
    .queue-secondary-actions { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px !important; }
    .queue-secondary-actions .btn { min-width:0; font-size:.8rem; white-space:normal; padding:10px; }
    .queue-secondary-actions .btn:last-child { grid-column:1/-1; }
    .queue-result-actions > .btn { width:100%; min-width:0 !important; min-height:50px; }
    .queue-card h2 { font-size:1.3rem !important; overflow-wrap:anywhere; }
    .queue-card a[href^="tel:"] { display:inline-flex; white-space:nowrap; font-size:1.2rem; min-height:44px; align-items:center; }
    .package-grid { gap:14px !important; }
    .package-card { padding:18px !important; border-width:1px !important; margin:0; }
    .package-card h3 { font-size:1.25rem !important; }
    .package-card > div:first-child > div:first-child { flex-wrap:wrap; gap:8px; }
    .package-actions { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)); }
    .package-actions .btn { min-width:0; white-space:normal; font-size:.82rem; padding:10px; }
    .catalog-tabs { gap:6px; padding-bottom:7px; scroll-snap-type:x proximity; }
    .catalog-tabs .tab-btn { border:1px solid var(--border-color); border-radius:22px; background:white; font-size:.82rem; padding:9px 14px; }
    .catalog-tabs .tab-btn.active { color:white; background:var(--primary); border-color:var(--primary); }
    .modal-overlay { padding:8px; }
    .modal-box { max-height:calc(100dvh - 16px); }
    .modal-box > form { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
    .modal-body { min-height:0; flex:1 1 auto; overflow:auto; }
    .modal-header { gap:10px; }
    .modal-title { font-size:1.05rem; line-height:1.3; }
    .modal-close { flex:0 0 44px; width:44px; height:44px; }
    .modal-footer .btn { min-width:0; white-space:normal; }
    .modal-body [style*="display: flex"] { max-width:100%; }
    .modal-body input, .modal-body select, .modal-body textarea { min-width:0; }
}
@media (forced-colors:active) { * { scrollbar-color:auto; } }
@media (max-width:900px) {
    .task-summary { display:flex !important; overflow-x:auto; scroll-snap-type:x proximity; padding-bottom:5px; }
    .task-summary > .card { flex:0 0 115px; scroll-snap-align:start; }
    .task-summary > .card > div:first-child { min-height:28px; }
    .task-section-tab { scroll-snap-align:start; }
    .mobile-record-table .mobile-record .record-title::before { display:none !important; }
    .task-section-tabs { scroll-margin-top:calc(60px + env(safe-area-inset-top)); }
}
.queue-list-toggle { display:none; }
.catalog-label-mobile { display:none; }
@media(max-width:900px) {
    html, body, body * { scrollbar-width:none !important; }
    html::-webkit-scrollbar, body::-webkit-scrollbar, body *::-webkit-scrollbar { display:none !important; width:0 !important; height:0 !important; }
    .queue-quota-card { padding:16px !important; }
    .dashboard-progress { padding:16px !important; }
    .dashboard-progress-heading { display:grid !important; grid-template-columns:minmax(0,1fr); gap:7px; }
    .dashboard-next-header { display:flex !important; flex-direction:column; gap:10px; min-width:0; }
    .dashboard-next-header > div { max-width:100%; min-width:0; }
    .dashboard-next-header h2, .dashboard-next-header h2 a { overflow-wrap:anywhere; }
    .dashboard-next-meta { display:flex; flex-wrap:wrap; gap:6px 10px !important; font-size:.83rem !important; }
    .dashboard-next-meta > span:nth-child(2), .dashboard-next-meta > span:nth-child(4) { display:none; }
    .dashboard-next-contact { grid-template-columns:minmax(0,1fr) !important; padding:14px !important; gap:14px !important; }
    .dashboard-next-contact > div, .dashboard-next-contact a { min-width:0; overflow-wrap:anywhere; }
    .dashboard-next-actions { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px !important; }
    .dashboard-next-actions .btn { min-width:0; width:100%; white-space:normal; min-height:48px; padding:9px; font-size:.85rem; }
    .dashboard-next-actions .btn:first-child { grid-column:1/-1; }
    .report-value-controls { display:grid !important; grid-template-columns:minmax(0,1fr); width:100%; min-width:0; padding:12px 0 0 !important; border-left:0 !important; border-top:1px solid var(--border-color); }
    .report-value-controls .toggle-checkbox-label { min-width:0; max-width:100%; white-space:normal; }
    .report-value-controls .toggle-switch-group { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; }
    .report-value-controls .toggle-switch-btn { min-width:0; text-align:center; }
    .queue-secondary-actions { grid-template-columns:minmax(0,1fr) !important; }
    .queue-secondary-actions .btn, .queue-secondary-actions .btn:last-child { grid-column:1/-1; width:100%; min-height:44px; }
    .queue-quota-header { display:grid !important; grid-template-columns:minmax(0,1fr); gap:12px; align-items:start !important; margin-bottom:16px !important; }
    .queue-quota-header > div { min-width:0; }
    .queue-quota-title { display:block; font-size:1.05rem !important; line-height:1.35; overflow-wrap:anywhere; }
    .queue-quota-count { display:block; margin:5px 0 0 !important; font-size:.8rem !important; }
    .queue-quota-remaining { display:inline-flex; max-width:100%; padding:7px 10px; border-radius:9px; background:#fff7ed; font-size:.82rem; line-height:1.3; }
    .task-summary { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)) !important; overflow:visible; padding:0; scroll-snap-type:none; }
    .task-summary > .card { min-width:0; flex:auto; }
    .task-summary > .card:last-child:nth-child(odd) { grid-column:1/-1; }
    .is-company-detail .tabs-nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; overflow:visible; white-space:normal; }
    .is-company-detail .tabs-nav .tab-btn { min-width:0; width:100%; white-space:normal; line-height:1.2; padding:8px; font-size:.75rem; }
    .companies-table .company-list-row { gap:13px 14px; }
    .companies-table .company-list-row td[data-label="Статус"],
    .companies-table .company-list-row td[data-label="Отговорник"] { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; gap:12px; padding-top:9px; border-top:1px solid var(--border-color); }
    .companies-table .company-list-row td[data-label="Статус"]::before,
    .companies-table .company-list-row td[data-label="Отговорник"]::before { margin:0; flex:0 0 auto; }
    .companies-table .company-list-row td[data-label="Статус"] .status-badge { max-width:65%; text-align:center; }
    .mobile-key-value-table { display:block; width:100%; min-width:0 !important; }
    .mobile-key-value-table tbody { display:grid; gap:0; }
    .mobile-key-value-table tr { display:grid; grid-template-columns:minmax(0,1fr); padding:10px 0; border-bottom:1px solid var(--border-color); }
    .mobile-key-value-table td { display:block; width:auto !important; min-width:0; padding:2px 0 !important; border:0; overflow-wrap:anywhere; white-space:normal !important; }
    .task-sections-ready .task-section-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; overflow:visible; margin:0 0 14px; padding:4px; border:1px solid var(--border-color); border-radius:14px; background:#eef2f7; scroll-snap-type:none; }
    .task-section-tab { width:100%; min-width:0; border:0; border-radius:10px; padding:8px 5px; font-size:.8rem; white-space:normal; }
    .task-section-tab[aria-selected="true"] { box-shadow:0 2px 6px rgb(37 99 235 / .18); }
    .catalog-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; width:100%; max-width:100%; margin:0 0 18px !important; padding:4px; overflow:visible; white-space:normal; border:1px solid var(--border-color); border-radius:14px; background:#eef2f7; }
    .catalog-tabs .tab-btn { width:100%; min-width:0; min-height:44px; padding:8px 4px; border:0; border-radius:10px; font-size:.78rem; line-height:1.15; white-space:normal; box-shadow:none; }
    .catalog-tabs .tab-btn.active { box-shadow:0 2px 6px rgb(37 99 235 / .18); }
    .catalog-label-desktop { display:none; }
    .catalog-label-mobile { display:inline; }
    .catalog-label-mobile small { font-size:.7rem; opacity:.8; }
    .mobile-record-table .mobile-record td { background:transparent !important; }
    .mobile-filter-form .btn-primary-gradient { width:100%; min-height:48px; justify-content:center; white-space:normal; font-size:.9rem; }
    body[data-page="packages"] .content-body > div:first-child h2 { font-size:1.25rem !important; line-height:1.35; }
    .queue-company-header { flex-direction:column; gap:14px; }
    .queue-company-header > div { min-width:0; max-width:100%; }
    .queue-company-header > div:last-child { display:flex; align-items:center; gap:10px; text-align:left !important; }
    .queue-company-meta { flex-direction:column; align-items:flex-start !important; gap:6px !important; font-size:.84rem !important; }
    .queue-company-meta > span:nth-child(2), .queue-company-meta > span:nth-child(4) { display:none; }
    .queue-card .queue-call-link { display:flex; flex-wrap:wrap; gap:5px 12px; justify-content:center; width:100%; padding:12px; border-radius:12px; color:white !important; background:#059669; font-size:.92rem; white-space:normal; }
    .queue-call-link span { white-space:nowrap; }
    .queue-list-ready .queue-list-content { display:none; }
    .queue-list-ready.is-open .queue-list-content { display:block; padding-top:12px; }
    .queue-list-toggle { display:flex; align-items:center; justify-content:space-between; width:100%; min-height:44px; border:0; color:var(--primary); background:transparent; font:inherit; font-weight:600; cursor:pointer; text-align:left; }
    .queue-list-toggle::after { content:'⌄'; font-size:22px; }
    .queue-list-toggle[aria-expanded="true"]::after { content:'⌃'; }
    .queue-company-list { padding:8px 14px !important; margin:0; }
}
