:root{
    --tflow-primary:#2563EB;
    --tflow-primary-dark:#1D4ED8;
    --tflow-success:#22C55E;
    --tflow-bg:#F8FAFC;
    --tflow-border:#E2E8F0;
    --tflow-text:#0F172A;
    --tflow-text-light:#64748B;
}

/* APP PAGE (темата не се рисува – вижда се templates/app.php) */

body.tflow-app-page{
    margin:0;
    background:var(--tflow-bg);
    color:var(--tflow-text);
}

/* GLOBAL LAYOUT */

.tms-wrap{
    width:100%;
    max-width:100%;
    margin:0;
    padding:24px 24px 40px;
    background:var(--tflow-bg);
    box-sizing:border-box;
}

.tms-page-title{
    font-size:32px;
    line-height:1.2;
    margin:0 0 24px;
    font-weight:700;
    color:var(--tflow-text);
}

.tms-card{
    background:#ffffff;
    border:1px solid var(--tflow-border);
    border-radius:16px;
    box-shadow:0 6px 20px rgba(0,0,0,0.05);
    padding:20px;
    margin-bottom:24px;
}

.tms-card h3,
.tms-card h4{
    margin-top:0;
    color:#111827;
}

.tms-section-title{
    margin:0 0 14px;
    font-size:22px;
    color:#111827;
}

.tms-muted{
    color:#6b7280;
}

.tms-link-back,
.tms-back-link{
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin-bottom:16px;
    text-decoration:none;
    color:#374151;
    font-weight:600;
}

.tms-back-link:hover,
.tms-link-back:hover{
    color:var(--tflow-primary);
}

/* GRID / STATS */

.tms-grid{
    display:grid;
    grid-template-columns:repeat(12,1fr);
    gap:20px;
    margin-bottom:24px;
}

.tms-col-4{
    grid-column:span 3;
}

.tms-stat-link{
    display:block;
    text-decoration:none;
    color:inherit;
}

.tms-stat{
    background:#ffffff;
    border:1px solid var(--tflow-border);
    border-radius:16px;
    padding:20px;
    box-shadow:0 6px 18px rgba(0,0,0,0.04);
    transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    cursor:pointer;
}

.tms-stat:hover{
    transform:translateY(-2px);
    box-shadow:0 12px 28px rgba(15,23,42,0.08);
}

.tms-stat.is-active{
    border-color:var(--tflow-primary);
    box-shadow:0 0 0 2px rgba(37,99,235,0.10);
}

.tms-stat-label{
    color:#6b7280;
    font-size:13px;
    margin-bottom:6px;
}

.tms-stat-value{
    font-size:28px;
    font-weight:700;
    color:#111827;
}

.tms-stat-in-progress{
    background:#eff6ff;
    border-color:#bfdbfe;
}

.tms-stat-completed{
    background:#ecfdf5;
    border-color:#a7f3d0;
}

/* TOOLBARS / FILTERS / FORMS */

.tms-toolbar{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    align-items:end;
    margin:20px 0 24px;
    padding:16px;
    background:#f9fafb;
    border:1px solid #e5e7eb;
    border-radius:14px;
}

.tms-toolbar > div{
    min-width:180px;
}

.tms-toolbar label,
.tms-filter-field label{
    display:block;
    margin-bottom:6px;
    font-size:13px;
    font-weight:600;
    color:#374151;
}

.tms-admin-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    flex-wrap:wrap;
    margin-bottom:20px;
}

.tms-admin-toolbar-left,
.tms-admin-toolbar-right{
    display:flex;
    align-items:center;
    gap:12px;
}

.tms-admin-filters{
    display:grid;
    grid-template-columns:minmax(260px, 2fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
    gap:16px;
    align-items:end;
}

.tms-filter-field{
    display:flex;
    flex-direction:column;
    gap:8px;
    min-width:0;
}

.tms-filter-actions{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
}

.tms-toolbar input[type="text"],
.tms-toolbar input[type="date"],
.tms-toolbar input[type="time"],
.tms-toolbar select,
.tms-filter-field input,
.tms-filter-field select,
.tms-create-order input[type="text"],
.tms-create-order input[type="number"],
.tms-create-order input[type="date"],
.tms-create-order input[type="time"],
.tms-create-order select,
.tms-create-order textarea,
.tms-edit-order input[type="text"],
.tms-edit-order input[type="number"],
.tms-edit-order input[type="date"],
.tms-edit-order input[type="time"],
.tms-edit-order select,
.tms-edit-order textarea,
.tms-mobile-form-field textarea,
.tms-mobile-form-field input,
.tms-mobile-form-field select,
.tms-comment-field{
    width:100%;
    max-width:100%;
    min-height:44px;
    border:1px solid #d1d5db;
    border-radius:10px;
    padding:10px 12px;
    background:#fff;
    font-size:14px;
    box-sizing:border-box;
    font-family:inherit;
}

.tms-comment-field{
    min-height:72px;
    resize:vertical;
}

/* BUTTONS */

.tms-inline-actions{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

.tms-wrap .button,
.tms-wrap .button-primary,
.tms-wrap button,
.tms-toggle-summary{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    min-height:40px;
    padding:0 16px;
    border-radius:10px !important;
    border:1px solid #d1d5db !important;
    background:#ffffff !important;
    color:#111827 !important;
    text-decoration:none !important;
    box-shadow:none !important;
    font-size:14px !important;
    font-weight:600;
    line-height:1;
    cursor:pointer;
    white-space:nowrap;
}

.tms-wrap .button-primary{
    background:var(--tflow-primary) !important;
    border-color:var(--tflow-primary) !important;
    color:#ffffff !important;
}

.tms-wrap .button-primary:hover{
    background:var(--tflow-primary-dark) !important;
    border-color:var(--tflow-primary-dark) !important;
}

.button.button-danger,
.tms-wrap .tms-cancel-order-btn{
    background:#dc2626 !important;
    border-color:#dc2626 !important;
    color:#ffffff !important;
}

.button.button-danger:hover,
.tms-wrap .tms-cancel-order-btn:hover,
.tms-wrap .tms-cancel-order-btn:focus{
    background:#b91c1c !important;
    border-color:#b91c1c !important;
    color:#ffffff !important;
}

/* TABLES */

.tms-table-wrap{
    overflow-x:auto;
    overflow-y:visible;
}

.tms-table{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:14px;
    overflow:hidden;
}

.tms-table thead th{
    position:sticky;
    top:0;
    z-index:3;
    background:#F8FAFC;
    color:#111827;
    font-size:13px;
    font-weight:700;
    text-align:left;
    padding:14px 12px;
    border-bottom:1px solid #e5e7eb;
    white-space:nowrap;
}

.tms-table tbody td{
    padding:14px 12px;
    border-bottom:1px solid #f1f5f9;
    vertical-align:middle;
    color:#1f2937;
    font-size:14px;
}

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

.tms-table tbody tr{
    transition:background-color .18s ease;
}

.tms-table tbody tr:hover{
    background:#F8FBFF;
}

.tms-table-stack{
    display:flex;
    flex-direction:column;
    gap:4px;
    min-width:0;
}

.tms-table-main{
    font-size:16px;
    font-weight:700;
    color:#0f172a;
    line-height:1.4;
    word-break:break-word;
}

.tms-table-sub{
    font-size:15px;
    font-weight:700;
    color:#0f172a;
    line-height:1.4;
    word-break:break-word;
}

.tms-table-sub strong{
    font-weight:700;
    color:#0f172a;
}

/* BADGES / MESSAGES */

.tms-message{
    padding:14px 16px;
    border-radius:12px;
    margin:0 0 18px;
    font-size:14px;
    border:1px solid transparent;
}

.tms-message-success{
    background:#ECFDF5;
    border-color:#86EFAC;
    color:#065F46;
}

.tms-message-error{
    background:#fef2f2;
    border-color:#fecaca;
    color:#991b1b;
}

.tms-message-warning{
    background:#fffbeb;
    border-color:#fcd34d;
    color:#92400e;
}

.tms-busy-note,
.tms-pending-note{
    margin-top:4px;
    font-size:12px;
    font-weight:600;
    line-height:1.35;
    color:#b45309;
}

.tms-truck-change-list{
    margin:8px 0 0;
    padding-left:18px;
}

.tms-truck-change-list li{
    margin:0 0 8px;
}

.tms-truck-change-list .tms-inline-actions{
    display:inline-flex;
    gap:6px;
    margin-left:6px;
    vertical-align:middle;
}

.tms-form-hint{
    margin:0 0 8px;
    font-size:12px;
    color:#6b7280;
}

.tms-message-info{
    background:#eff6ff;
    border-color:#bfdbfe;
    color:#1d4ed8;
}

.tms-badge{
    display:inline-flex;
    align-items:center;
    padding:5px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    line-height:1;
    white-space:nowrap;
}

.tms-badge-new{
    background:#DBEAFE;
    color:#1D4ED8;
}

.tms-badge-ordered,
.tms-badge-pending{
    background:#FEF3C7;
    color:#92400E;
}

.tms-badge-in_progress{
    background:#E0F2FE;
    color:#0369A1;
}

.tms-badge-approved,
.tms-badge-completed{
    background:#DCFCE7;
    color:#166534;
}

.tms-badge-rejected,
.tms-badge-cancelled{
    background:#fee2e2;
    color:#991b1b;
}

/* PAGINATION / TOGGLE */

.tms-toggle{
    margin-bottom:16px;
}

.tms-toggle-summary{
    list-style:none;
    user-select:none;
}

.tms-toggle-summary::-webkit-details-marker{
    display:none;
}

.tms-pagination{
    display:flex;
    gap:8px;
    margin-top:16px;
    flex-wrap:wrap;
}

.tms-pagination a{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:38px;
    height:38px;
    border:1px solid #d1d5db;
    border-radius:10px;
    text-decoration:none;
    color:#111827;
    background:#fff;
}

.tms-page-gap{
    padding:0 6px;
    color:#6b7280;
}

.tms-pagination a.tms-page-current{
    background:var(--tflow-primary);
    color:#fff;
    border-color:var(--tflow-primary);
}

/* ACF / FORMS */

.tms-create-order .acf-form,
.tms-edit-order .acf-form,
.tms-add-truck .acf-form,
.tms-edit-truck .acf-form{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:16px;
    padding:24px;
    box-shadow:0 8px 24px rgba(0,0,0,.05);
}

.tms-create-order .acf-label label,
.tms-edit-order .acf-label label,
.tms-add-truck .acf-label label,
.tms-edit-truck .acf-label label{
    font-weight:700;
    color:#111827;
}

.tms-create-order .acf-form-submit,
.tms-edit-order .acf-form-submit,
.tms-add-truck .acf-form-submit,
.tms-edit-truck .acf-form-submit{
    margin-top:20px;
}

/* HEADER */

.tflow-header{
    width:100%;
    background:#0F172A;
    color:#fff;
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:14px 28px;
    box-shadow:0 4px 16px rgba(0,0,0,0.08);
    margin-bottom:0;
    box-sizing:border-box;
    position:sticky;
    top:0;
    z-index:9999;
}

.tflow-header-left{
    display:flex;
    flex-direction:column;
    gap:4px;
}

.tflow-logo{
    font-size:20px;
    font-weight:700;
    letter-spacing:0.5px;
}

.tflow-company-name{
    font-size:13px;
    color:#94A3B8;
    font-weight:600;
}

.tflow-nav{
    display:flex;
    gap:18px;
    flex-wrap:wrap;
}

.tflow-nav a{
    color:#E2E8F0;
    text-decoration:none;
    font-weight:600;
    font-size:14px;
}

.tflow-nav a:hover{
    color:#ffffff;
}

.tflow-logout{
    margin-left:12px;
    color:#F87171 !important;
}

/* LOGIN */

.tms-login-shell{
    min-height:calc(100vh - 80px);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:40px 16px;
    background:linear-gradient(180deg,#f8fafc 0%, #eef2f7 100%);
    box-sizing:border-box;
}

.tms-login-card{
    width:100%;
    max-width:460px;
    background:#ffffff;
    border:1px solid #e5e7eb;
    border-radius:22px;
    box-shadow:0 18px 50px rgba(15,23,42,0.08);
    padding:32px;
    box-sizing:border-box;
}

.tms-login-brand{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:8px 14px;
    border-radius:999px;
    background:#eff6ff;
    color:#1d4ed8;
    font-weight:700;
    font-size:13px;
    margin-bottom:18px;
}

.tms-login-title{
    margin:0 0 8px;
    font-size:32px;
    line-height:1.15;
    font-weight:800;
    color:#0f172a;
}

.tms-login-subtitle{
    margin:0 0 24px;
    color:#64748b;
    font-size:14px;
}

.tms-login-card form{
    margin:0;
}

.tms-login-card p{
    margin:0 0 16px;
}

.tms-login-card label{
    display:block;
    margin-bottom:8px;
    font-size:14px;
    font-weight:700;
    color:#111827;
}

.tms-login-card input[type="text"],
.tms-login-card input[type="password"]{
    width:100%;
    height:46px;
    border:1px solid #cbd5e1;
    border-radius:12px;
    padding:0 14px;
    font-size:15px;
    color:#111827;
    background:#fff;
    box-sizing:border-box;
    outline:none;
    transition:border-color .2s ease, box-shadow .2s ease;
}

.tms-login-card input[type="text"]:focus,
.tms-login-card input[type="password"]:focus{
    border-color:#2563eb;
    box-shadow:0 0 0 4px rgba(37,99,235,0.12);
}

.tms-login-card .login-remember{
    display:flex;
    align-items:center;
    gap:10px;
    margin:8px 0 20px;
}

.tms-login-card .login-remember label{
    margin:0;
    font-weight:600;
    color:#334155;
}

.tms-login-card input[type="checkbox"]{
    width:16px;
    height:16px;
    margin:0;
}

.tms-login-card .login-submit{
    margin-top:4px;
}

.tms-login-card .button,
.tms-login-card input[type="submit"],
.tms-login-card #wp-submit{
    width:100%;
    min-height:48px;
    border:none !important;
    border-radius:12px !important;
    background:#2563EB !important;
    color:#ffffff !important;
    font-size:15px !important;
    font-weight:700;
    cursor:pointer;
    box-shadow:0 10px 24px rgba(37,99,235,0.22);
}

.tms-login-card .button:hover,
.tms-login-card input[type="submit"]:hover,
.tms-login-card #wp-submit:hover{
    background:#1D4ED8 !important;
}

.tms-login-card .tms-message{
    margin:0 0 18px;
}

/* CALENDAR */

.tms-calendar-day{
    border:1px solid #e5e7eb;
    border-radius:14px;
    padding:16px;
    background:#fff;
    margin-bottom:16px;
}

.tms-calendar-date{
    font-size:18px;
    font-weight:700;
    color:#111827;
    margin-bottom:12px;
}

.tms-calendar-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.tms-calendar-item{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    align-items:center;
    padding:12px;
    border:1px solid #eef2f7;
    border-radius:10px;
    background:#f9fafb;
}

.tms-calendar-time{
    min-width:70px;
    font-weight:700;
    color:#0f172a;
}

.tms-calendar-order{
    font-weight:700;
    color:#111827;
}

.tms-calendar-meta{
    color:#475569;
    font-size:14px;
}

/* ORDER DETAILS PAGE */

.tms-order-claims-back{
    margin-bottom:18px;
}

.tms-order-hero{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:20px;
    flex-wrap:wrap;
}

.tms-order-title{
    margin-bottom:0;
}

.tms-order-actions{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
}

.tms-order-actions .button{
    min-height:46px;
    padding:0 18px;
    border-radius:12px;
}

.tms-order-actions .button.button-primary{
    box-shadow:0 8px 20px rgba(37,99,235,0.14);
}

.tms-order-actions .button.button-danger{
    box-shadow:0 8px 20px rgba(220,38,38,0.12);
}

.tms-order-summary-grid{
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:16px;
}

.tms-summary-item{
    padding:16px 18px;
    border:1px solid #E2E8F0;
    border-radius:14px;
    background:#fff;
    min-width:0;
}

.tms-summary-item-wide{
    grid-column:span 2;
}

.tms-summary-label{
    font-size:13px;
    line-height:1.4;
    font-weight:600;
    color:#64748B;
    margin-bottom:8px;
}

.tms-summary-value{
    font-size:16px;
    line-height:1.45;
    font-weight:600;
    color:var(--tflow-text);
    word-break:break-word;
}

.tms-order-comments-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
    margin-top:18px;
}

.tms-comment-panel{
    padding:16px 18px;
    border:1px solid #E2E8F0;
    border-radius:14px;
    background:#fff;
}

.tms-comment-box{
    margin-top:6px;
    color:var(--tflow-text);
    line-height:1.6;
    white-space:pre-line;
    min-width:220px;
    max-width:320px;
}

.tms-logs-dropdown{
    border:1px solid #E2E8F0;
    border-radius:16px;
    background:#fff;
    overflow:hidden;
}

.tms-logs-summary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    cursor:pointer;
    list-style:none;
    padding:18px 20px;
    font-size:22px;
    font-weight:700;
    color:var(--tflow-text);
}

.tms-logs-summary::-webkit-details-marker{
    display:none;
}

.tms-logs-summary span{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:32px;
    height:32px;
    padding:0 10px;
    border-radius:999px;
    background:#EEF2FF;
    color:var(--tflow-primary);
    font-size:14px;
    font-weight:700;
}

.tms-logs-wrap{
    padding:0 18px 18px;
}

.tms-logs-empty{
    padding:0 20px 20px;
}

.tms-logs-table{
    font-size:14px;
}

.tms-logs-table tbody tr:nth-child(even){
    background:#FAFCFF;
}

.tms-claims-table td:last-child{
    text-align:center;
    vertical-align:middle;
}

.tms-claims-table td:last-child .button{
    min-width:90px;
    height:40px;
    padding:0 16px;
    border-radius:10px;
}

/* DESKTOP / MOBILE SWITCH */

.tms-desktop-only{
    display:block;
}

.tms-mobile-only{
    display:none;
}

    /* UNIFIED DROPDOWN STYLE */

.tms-toggle,
.tms-logs-dropdown{
    border:1px solid #E2E8F0;
    border-radius:16px;
    background:#fff;
    overflow:visible;
    margin-bottom:0;
}

.tms-toggle-summary,
.tms-logs-summary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    cursor:pointer;
    list-style:none;
    padding:18px 20px;
    font-size:22px;
    font-weight:700;
    color:var(--tflow-text);
    background:#fff;
    user-select:none;
    width:100%;
    box-sizing:border-box;
    border:none !important;
    min-height:auto !important;
    box-shadow:none !important;
    overflow:visible;
}

.tms-toggle-summary span,
.tms-logs-summary span{
    flex-shrink:0;
}

.tms-toggle-summary::-webkit-details-marker,
.tms-logs-summary::-webkit-details-marker{
    display:none;
}

.tms-toggle-summary span,
.tms-logs-summary span{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:32px;
    height:32px;
    padding:0 10px;
    border-radius:999px;
    background:#EEF2FF;
    color:var(--tflow-primary);
    font-size:14px;
    font-weight:700;
    line-height:1;
    flex:0 0 auto;
}

.tms-toggle[open] > .tms-toggle-summary,
.tms-logs-dropdown[open] > .tms-logs-summary{
    border-bottom:1px solid #E2E8F0;
}

.tms-toggle > .tms-table-wrap,
.tms-toggle > .tms-desktop-only,
.tms-toggle > .tms-mobile-only,
.tms-toggle > .tms-muted,
.tms-toggle > p,
.tms-logs-dropdown > .tms-table-wrap,
.tms-logs-dropdown > .tms-muted,
.tms-logs-dropdown > p{
    margin-top:0;
}

.tms-toggle .tms-table-wrap,
.tms-logs-wrap{
    padding:18px;
}

.tms-toggle > .tms-desktop-only,
.tms-toggle > .tms-mobile-only{
    padding:18px;
}

.tms-toggle > .tms-desktop-only .tms-table-wrap,
.tms-toggle > .tms-mobile-only .tms-table-wrap{
    padding:0;
}

.tms-toggle > p.tms-muted{
    padding:18px 20px 20px;
    margin:0;
}

@media (max-width: 768px){
    .tms-toggle-summary,
    .tms-logs-summary{
        font-size:18px;
        padding:16px 18px;
    }

    .tms-toggle .tms-table-wrap,
    .tms-logs-wrap{
        padding:12px;
    }

    .tms-toggle > .tms-desktop-only,
    .tms-toggle > .tms-mobile-only{
        padding:12px;
    }

    .tms-toggle > p.tms-muted{
        padding:12px 16px 16px;
    }
}

/* ZEBRA ROWS */

.tms-table tbody tr:nth-child(odd){
    background:#ffffff;
}

.tms-table tbody tr:nth-child(even){
    background:#f1f5f9;
}

/* hover */

.tms-table tbody tr:hover{
    background:#e8eefc;
    transition:background .15s ease;
}

.tms-table tbody tr{
    border-bottom:1px solid #e2e8f0;
}

/* CARRIER MOBILE CARDS */

.tms-carrier-dashboard .tms-mobile-jobs-list{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.tms-carrier-dashboard .tms-mobile-job-card{
    background:#ffffff;
    border:1px solid #e5e7eb;
    border-radius:16px;
    padding:14px;
    box-shadow:0 4px 14px rgba(15,23,42,0.05);
}

.tms-carrier-dashboard .tms-mobile-job-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:10px;
    margin-bottom:12px;
}

.tms-carrier-dashboard .tms-mobile-job-title{
    font-size:16px;
    font-weight:700;
    color:#0f172a;
    line-height:1.3;
}

.tms-carrier-dashboard .tms-mobile-info-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:10px;
}

.tms-carrier-dashboard .tms-mobile-info-grid-cols-1{
    grid-template-columns:repeat(1, minmax(0, 1fr));
}

.tms-carrier-dashboard .tms-mobile-info-grid-cols-2{
    grid-template-columns:repeat(2, minmax(0, 1fr));
}

.tms-carrier-dashboard .tms-mobile-info-grid-cols-3{
    grid-template-columns:repeat(3, minmax(0, 1fr));
}

.tms-carrier-dashboard .tms-mobile-info-grid-cols-4{
    grid-template-columns:repeat(4, minmax(0, 1fr));
}

.tms-carrier-dashboard .tms-mobile-info-item{
    min-width:0;
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:12px;
    padding:10px;
}

.tms-carrier-dashboard .tms-mobile-info-item-full{
    grid-column:1 / -1;
}

.tms-carrier-dashboard .tms-mobile-info-label{
    display:block;
    margin-bottom:4px;
    font-size:11px;
    line-height:1.2;
    text-transform:uppercase;
    letter-spacing:.03em;
    font-weight:700;
    color:#64748b;
}

.tms-carrier-dashboard .tms-mobile-info-value{
    font-size:14px;
    line-height:1.4;
    font-weight:600;
    color:#0f172a;
    word-break:break-word;
}

.tms-carrier-dashboard .tms-mobile-job-note{
    margin-top:12px;
    padding:10px 12px;
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:12px;
    font-size:13px;
    line-height:1.5;
    color:#334155;
}

.tms-carrier-dashboard .tms-mobile-job-actions{
    margin-top:12px;
}

.tms-carrier-dashboard .tms-mobile-inline-form{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.tms-carrier-dashboard .tms-mobile-form-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:10px;
}

.tms-carrier-dashboard .tms-mobile-form-field{
    min-width:0;
}

.tms-carrier-dashboard .tms-mobile-form-field label{
    display:block;
    margin-bottom:6px;
    font-size:12px;
    font-weight:700;
    color:#475569;
}

.tms-carrier-dashboard .tms-mobile-action-row{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
}

/* CARRIER DESKTOP CLAIM FORM */

.tms-claim-form-inline{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}

.tms-claim-form-inline select,
.tms-claim-form-inline input{
    height:40px;
    min-height:40px;
    padding:0 12px;
    border:1px solid #d1d5db;
    border-radius:10px;
    background:#fff;
    font-size:14px;
    color:#111827;
    box-sizing:border-box;
}

.tms-claim-form-inline select{
    min-width:170px;
}

.tms-claim-form-inline input[name="driver_name"]{
    min-width:150px;
}

.tms-claim-form-inline input[name="driver_phone"]{
    min-width:160px;
}

.tms-claim-form-inline textarea[name="claim_comment"]{
    flex:1 1 220px;
    min-width:200px;
    height:40px;
    min-height:40px;
    padding:9px 12px;
    border:1px solid #d1d5db;
    border-radius:10px;
    background:#fff;
    font:inherit;
    font-size:14px;
    color:#111827;
    box-sizing:border-box;
    resize:vertical;
}

.tms-claim-form-inline .button,
.tms-claim-form-inline .button-primary,
.tms-claim-form-inline button{
    min-height:40px;
    height:40px;
    padding:0 16px;
    min-width:130px;
    flex:0 0 auto;
}

.tms-claim-form-inline .button:hover,
.tms-claim-form-inline .button-primary:hover{
    transform:translateY(-1px);
}

/* BREAKPOINTS */

@media (max-width: 1024px){
    .tms-order-summary-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }

    .tms-summary-item-wide{
        grid-column:span 2;
    }
}

@media (max-width: 1024px){
    .tms-admin-filters{
        grid-template-columns:1fr 1fr;
    }

    .tms-filter-actions{
        grid-column:1 / -1;
    }

    .tms-desktop-only{
        display:none;
    }

    .tms-mobile-only{
        display:block;
    }
}

@media (max-width: 1024px){
    .tms-col-4{
        grid-column:span 12;
    }

    .tms-page-title{
        font-size:26px;
    }

    .tms-wrap{
        padding:18px 16px 32px;
    }

    .tms-toolbar{
        flex-direction:column;
        align-items:stretch;
    }

    .tms-toolbar > div{
        min-width:100%;
    }

    .tflow-header{
        flex-direction:column;
        align-items:flex-start;
        gap:12px;
        padding:14px 16px;
    }

    .tflow-nav{
        width:100%;
        gap:12px;
    }

    .tms-comment-box{
        min-width:160px;
        max-width:100%;
    }

    .tms-carrier-dashboard .tms-mobile-form-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px){

    .tflow-header{
        position:static !important;
        top:auto !important;
        z-index:auto !important;
        padding:10px 12px;
        gap:8px;
    }

    .tms-wrap{
        padding:10px 10px 18px;
    }

    .tms-page-title{
        font-size:20px;
        margin:0 0 12px;
    }

    .tms-card{
        padding:12px;
        margin-bottom:12px;
        border-radius:12px;
    }

    .tms-section-title,
    .tms-card h3,
    .tms-card h4{
        font-size:16px;
        margin-bottom:10px;
    }

    .tflow-header-left{
        width:100%;
    }

    .tflow-logo{
        font-size:16px;
    }

    .tflow-company-name{
        font-size:11px;
    }

    .tflow-nav{
        width:100%;
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:6px;
    }

    .tflow-nav a{
        display:flex;
        align-items:center;
        justify-content:center;
        min-height:36px;
        padding:7px 8px;
        border:1px solid rgba(255,255,255,0.12);
        border-radius:8px;
        background:rgba(255,255,255,0.04);
        font-size:12px;
        text-align:center;
    }

    .tflow-logout{
        margin-left:0;
    }

    .tms-toolbar{
        margin:10px 0 14px;
        padding:10px;
        gap:8px;
        flex-direction:column;
        align-items:stretch;
    }

    .tms-toolbar label{
        font-size:12px;
        margin-bottom:4px;
    }

    .tms-toolbar > div{
        min-width:100%;
        width:100%;
    }

    .tms-inline-actions{
        width:100%;
        flex-direction:column;
        align-items:stretch;
    }

    .tms-inline-actions .button,
    .tms-inline-actions .button-primary,
    .tms-inline-actions button{
        width:100%;
    }

    .tms-wrap .button,
    .tms-wrap .button-primary,
    .tms-wrap button,
    .tms-toggle-summary{
        width:100%;
        min-height:38px;
        padding:8px 10px;
        font-size:13px !important;
        border-radius:8px;
    }

    .tms-table-wrap{
        -webkit-overflow-scrolling:touch;
        border-radius:12px;
    }

    .tms-table{
        min-width:620px;
        border-radius:12px;
    }

    .tms-table thead th{
        font-size:11px;
        padding:8px 6px;
    }


    .tms-table tbody td{
        padding:16px 14px;
        border-bottom:1px solid #f1f5f9;
        vertical-align:middle;
        color:#0f172a;
        font-size:15px;
        font-weight:600;
    }

    .tms-comment-box{
        min-width:180px;
        max-width:220px;
        font-size:13px;
    }

    .tms-comment-field{
        min-width:180px;
        font-size:13px;
        padding:8px 10px;
    }

    .tms-grid{
        grid-template-columns:1fr;
        gap:12px;
        margin-bottom:16px;
    }

    .tms-col-4{
        grid-column:span 1;
    }

    .tms-stat{
        padding:16px;
        border-radius:14px;
    }

    .tms-stat-value{
        font-size:24px;
    }

    .tms-calendar-day{
        padding:12px;
        margin-bottom:12px;
    }

    .tms-calendar-date{
        font-size:16px;
        margin-bottom:10px;
    }

    .tms-calendar-item{
        padding:10px;
        gap:8px;
        align-items:flex-start;
        flex-direction:column;
    }

    .tms-calendar-time{
        min-width:auto;
    }

    .tms-pagination{
        gap:6px;
    }

    .tms-pagination a{
        min-width:34px;
        height:34px;
        font-size:13px;
    }

    .acf-form-submit input[type="submit"],
    .acf-form-submit .acf-button{
        width:100%;
    }

    .tms-order-hero{
        align-items:flex-start;
        flex-direction:column;
    }

    .tms-order-actions{
        flex-direction:column;
        align-items:stretch;
    }

    .tms-order-actions .button{
        width:100%;
        text-align:center;
    }

    .tms-order-summary-grid{
        grid-template-columns:1fr;
    }

    .tms-summary-item-wide{
        grid-column:span 1;
    }

    .tms-order-comments-grid{
        grid-template-columns:1fr;
    }

    .tms-logs-summary{
        font-size:18px;
        padding:16px 18px;
    }

    .tms-logs-wrap{
        padding:0 12px 12px;
    }

    .tms-table th:nth-child(4),
    .tms-table td:nth-child(4),
    .tms-table th:nth-child(6),
    .tms-table td:nth-child(6){
        display:none;
    }

    .tms-carrier-dashboard .tms-mobile-job-card{
        padding:12px;
        border-radius:14px;
    }

    .tms-carrier-dashboard .tms-mobile-job-title{
        font-size:15px;
    }

    .tms-carrier-dashboard .tms-mobile-info-grid,
    .tms-carrier-dashboard .tms-mobile-form-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }

    .tms-carrier-dashboard .tms-mobile-action-row .button,
    .tms-carrier-dashboard .tms-mobile-action-row .button-primary,
    .tms-carrier-dashboard .tms-mobile-inline-form .button,
    .tms-carrier-dashboard .tms-mobile-inline-form .button-primary{
        width:100%;
    }
}

@media (max-width: 768px){
    .tms-admin-toolbar{
        flex-direction:column;
        align-items:stretch;
    }

    .tms-admin-toolbar-left,
    .tms-admin-toolbar-right{
        width:100%;
    }

    .tms-admin-toolbar-left .button,
    .tms-admin-toolbar-right .button{
        width:100%;
        text-align:center;
    }

    .tms-admin-filters{
        grid-template-columns:1fr;
    }

    .tms-filter-actions{
        width:100%;
        flex-direction:column;
        align-items:stretch;
    }

    .tms-filter-actions .button{
        width:100%;
        text-align:center;
    }
}

@media (max-width: 768px){
    .tms-login-card{
        padding:24px 18px;
        border-radius:18px;
    }

    .tms-login-title{
        font-size:26px;
    }
}

@media (max-width: 480px){

    .tms-wrap{
        padding:8px 8px 16px;
    }

    .tms-page-title{
        font-size:18px;
        margin-bottom:10px;
    }

    .tms-card{
        padding:10px;
        margin-bottom:10px;
    }

    .tflow-nav{
        grid-template-columns:1fr;
    }

    .tms-table{
        min-width:560px;
    }

    .tms-table th:nth-child(5),
    .tms-table td:nth-child(5){
        display:none;
    }

    .tms-carrier-dashboard .tms-mobile-info-grid,
    .tms-carrier-dashboard .tms-mobile-form-grid{
        grid-template-columns:1fr;
    }

    .tms-carrier-dashboard .tms-mobile-job-head{
        flex-direction:column;
        align-items:flex-start;
    }

    .tms-carrier-dashboard .tms-mobile-action-row{
        flex-direction:column;
    }

    .tms-carrier-dashboard .tms-mobile-action-row .button,
    .tms-carrier-dashboard .tms-mobile-action-row .button-primary,
    .tms-carrier-dashboard .tms-mobile-inline-form .button,
    .tms-carrier-dashboard .tms-mobile-inline-form .button-primary{
        width:100%;
    }
}

/* NOTIFICATIONS */

.tflow-bell{
    position:relative;
}

.tflow-bell-btn{
    position:relative;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:40px;
    height:40px;
    padding:0;
    border:1px solid var(--tflow-border);
    border-radius:10px;
    background:#ffffff;
    color:var(--tflow-text);
    cursor:pointer;
}

.tflow-bell-count{
    position:absolute;
    top:-6px;
    right:-6px;
    min-width:18px;
    height:18px;
    padding:0 5px;
    border-radius:9px;
    background:#DC2626;
    color:#ffffff;
    font-size:11px;
    font-weight:700;
    line-height:18px;
    text-align:center;
    box-sizing:border-box;
}

.tflow-bell-count[hidden],
.tflow-bell-panel[hidden]{
    display:none;
}

.tflow-bell-panel{
    position:absolute;
    right:0;
    top:48px;
    z-index:1000;
    width:340px;
    max-width:calc(100vw - 24px);
    background:#ffffff;
    border:1px solid var(--tflow-border);
    border-radius:14px;
    box-shadow:0 12px 32px rgba(0,0,0,0.15);
    overflow:hidden;
}

.tflow-bell-list{
    max-height:360px;
    overflow-y:auto;
}

.tflow-bell-item,
.tms-notif-item a{
    display:block;
    padding:12px 14px;
    border-bottom:1px solid var(--tflow-border);
    color:var(--tflow-text);
    text-decoration:none;
}

.tflow-bell-item.is-unread,
.tms-notif-item.is-unread a{
    background:#EFF6FF;
}

.tflow-bell-body,
.tms-notif-body,
.tflow-bell-time,
.tms-notif-time{
    display:block;
    margin-top:2px;
    font-size:13px;
    color:var(--tflow-text-light);
}

.tflow-bell-all{
    display:block;
    padding:12px 14px;
    text-align:center;
    font-weight:600;
    text-decoration:none;
}

.tms-notif-list{
    list-style:none;
    margin:0;
    padding:0;
    border:1px solid var(--tflow-border);
    border-radius:12px;
    overflow:hidden;
}

.tms-notif-item:last-child a{
    border-bottom:0;
}

@media (max-width: 768px){
    .tflow-bell-panel{
        position:fixed;
        left:12px;
        right:12px;
        top:64px;
        width:auto;
        max-width:none;
    }
}

/* STATS: 5 карти */

.tms-stats-5{
    grid-template-columns:repeat(5, minmax(0, 1fr));
}

.tms-stats-5 > .tms-col-4{
    grid-column:auto;
}

.tms-stat-ordered .tms-stat-value{
    color:#92400E;
}

@media (max-width: 1024px){
    .tms-stats-5{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px){
    .tms-stats-5{
        grid-template-columns:1fr;
    }
}

/* DATE INPUT */

.tms-date-wrap{
    position:relative;
    display:block;
    width:100%;
}

.tms-date-wrap .tms-date-input{
    width:100%;
    padding-right:42px;
    box-sizing:border-box;
}

.tms-date-btn{
    position:absolute;
    top:50%;
    right:6px;
    transform:translateY(-50%);
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:30px;
    height:30px;
    padding:0;
    border:0;
    border-radius:8px;
    background:transparent;
    color:var(--tflow-text-light);
    pointer-events:none;
    z-index:1;
}

.tms-date-wrap:hover .tms-date-btn{
    background:#f1f5f9;
    color:var(--tflow-primary);
}

.tms-date-native{
    position:absolute;
    top:0;
    right:0;
    width:46px;
    height:100%;
    margin:0;
    padding:0;
    border:0;
    opacity:0;
    z-index:2;
    cursor:pointer;
}

/* REFRESH BANNER */

.tflow-refresh{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin:0 0 16px;
    padding:12px 16px;
    border:1px solid #BFDBFE;
    border-radius:12px;
    background:#EFF6FF;
    color:#1E3A8A;
    font-weight:600;
}

/* TABS (табло на превозвача) */

.tms-tabs{
    display:grid;
    grid-template-columns:repeat(5, minmax(0, 1fr));
    gap:10px;
    margin:0 0 16px;
}

.tms-tab{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    min-height:48px;
    padding:10px 14px;
    border:1px solid var(--tflow-border);
    border-radius:12px;
    background:#ffffff;
    color:var(--tflow-text);
    font-weight:600;
    text-decoration:none;
    box-sizing:border-box;
}

.tms-tab:hover{
    border-color:var(--tflow-primary);
}

.tms-tab.is-active{
    background:var(--tflow-primary);
    border-color:var(--tflow-primary);
    color:#ffffff;
}

.tms-tab-count{
    min-width:26px;
    padding:2px 8px;
    border-radius:999px;
    background:#EEF2F7;
    color:var(--tflow-text);
    font-size:13px;
    text-align:center;
}

.tms-tab.is-active .tms-tab-count{
    background:rgba(255,255,255,0.25);
    color:#ffffff;
}

.tms-tab-link{
    justify-content:center;
    background:#F8FAFC;
}

@media (max-width: 1024px){
    .tms-tabs{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }

    .tms-tab-link{
        grid-column:1 / -1;
    }
}

@media (max-width: 480px){
    .tms-tab{
        padding:10px;
        font-size:14px;
    }
}

/* АДРЕСИ ВЪВ ФОРМАТА НА КЛИЕНТ */

.tms-addr-title{
    margin:28px 0 4px;
}

.tms-addr-row{
    margin:0 0 14px;
    padding:14px;
    border:1px solid var(--tflow-border);
    border-radius:12px;
    background:#F8FAFC;
}

.tms-addr-row[hidden]{
    display:none;
}

.tms-addr-row.has-error{
    border-color:#DC2626;
    background:#FEF2F2;
}

.tms-addr-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:12px;
    margin-bottom:12px;
}

.tms-addr-field label{
    display:block;
    margin-bottom:4px;
    font-size:13px;
    font-weight:600;
}

.tms-addr-field input{
    width:100%;
    box-sizing:border-box;
}

@media (max-width: 768px){
    .tms-addr-grid{
        grid-template-columns:1fr;
    }
}

/* СОРТИРАНЕ ПО КОЛОНИ */

.tms-table th a.tms-sort{
    display:inline-flex;
    align-items:center;
    gap:4px;
    color:inherit;
    text-decoration:none;
    white-space:nowrap;
}

.tms-table th a.tms-sort:hover{
    text-decoration:underline;
}

.tms-sort-arrow{
    font-size:11px;
    opacity:.4;
}

.tms-sort.is-active .tms-sort-arrow{
    opacity:1;
}

/* СВИВАЕМИ АДРЕСИ В КЛИЕНТ */

.tms-addr-details{
    margin:24px 0 8px;
    border:1px solid var(--tflow-border);
    border-radius:12px;
    background:#fff;
}

.tms-addr-summary{
    cursor:pointer;
    padding:14px 16px;
    font-weight:700;
    font-size:16px;
}

.tms-addr-body{
    padding:0 16px 8px;
}

.tms-inline-form{
    display:inline;
    margin:0;
}

/* ПО-МАЛКИ КАРТИ СО СТАТИСТИКА */

.tms-stats-5{
    gap:10px;
}

.tms-stat{
    padding:10px 14px;
    border-radius:12px;
}

.tms-stat-label{
    font-size:12px;
    margin-bottom:2px;
    line-height:1.25;
}

.tms-stat-value{
    font-size:20px;
    line-height:1.2;
}

@media (max-width: 480px){
    .tms-stats-5{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }
}

/* БУТОН ДОСТАВЕН */

.button.tms-btn-delivered,
a.button.tms-btn-delivered{
    background:#16A34A;
    border-color:#16A34A;
    color:#fff;
}

.button.tms-btn-delivered:hover,
a.button.tms-btn-delivered:hover{
    background:#15803D;
    border-color:#15803D;
    color:#fff;
}

/* КОЛОНА КОМЕНТАРИ */

.tms-comment-cell{
    max-width:260px;
    font-size:13px;
    line-height:1.35;
}

.tms-comment-line + .tms-comment-line{
    margin-top:4px;
}

.tms-comment-tag{
    font-weight:700;
    color:#6b7280;
}

/* НАСТРОЙКИ НА ИЗВЕСТИЯТА */

.tms-pref-grid{
    display:grid;
    grid-template-columns:minmax(0, 1fr) 70px 70px;
    align-items:center;
    gap:0;
    margin:14px 0;
    border:1px solid var(--tflow-border);
    border-radius:12px;
    overflow:hidden;
}

.tms-pref-grid > div{
    padding:10px 12px;
    border-bottom:1px solid var(--tflow-border);
}

.tms-pref-head{
    background:#F8FAFC;
    font-weight:700;
    font-size:13px;
}

.tms-pref-cell{
    text-align:center;
}

.tms-push-box{
    margin:14px 0;
    padding:14px;
    border:1px solid var(--tflow-border);
    border-radius:12px;
    background:#F8FAFC;
}

/* ===== ПОПРАВКИ: известия, банер, бутони, мобилен хедър ===== */

/* Текстът в падащия списък на известията (наследяваше бялото от менюто) */
.tflow-nav .tflow-bell-item,
.tflow-nav .tflow-bell-item strong,
.tflow-bell-item,
.tflow-bell-item strong{
    color:#0F172A !important;
}

.tflow-nav .tflow-bell-body,
.tflow-nav .tflow-bell-time,
.tflow-bell-body,
.tflow-bell-time{
    color:#475569 !important;
}

.tflow-nav .tflow-bell-all,
.tflow-bell-all{
    color:var(--tflow-primary) !important;
}

.tflow-nav .tflow-bell-item:hover{
    background:#F1F5F9;
}

.tflow-bell-btn{
    color:#0F172A;
}

/* Банер за промени */
.tflow-refresh{
    align-items:flex-start;
    gap:12px;
}

.tflow-refresh-text{
    flex:1 1 auto;
    min-width:0;
    line-height:1.4;
}

.tflow-refresh-line{
    margin-top:2px;
    font-size:14px;
    overflow-wrap:anywhere;
}

.tflow-refresh .button{
    flex:0 0 auto;
}

/* Бутони: еднакъв размер и подравняване */
.tms-wrap .button,
.tms-wrap .button-primary,
.tms-wrap button{
    box-sizing:border-box;
}

.tms-wrap .button.tms-btn-delivered,
.tms-wrap a.button.tms-btn-delivered{
    background:#16A34A !important;
    border-color:#16A34A !important;
    color:#ffffff !important;
}

.tms-wrap .button.tms-btn-delivered:hover,
.tms-wrap a.button.tms-btn-delivered:hover{
    background:#15803D !important;
    border-color:#15803D !important;
    color:#ffffff !important;
}

.tms-carrier-dashboard .tms-mobile-action-row{
    display:flex;
    gap:8px;
    align-items:stretch;
}

.tms-carrier-dashboard .tms-mobile-action-row > .button,
.tms-carrier-dashboard .tms-mobile-action-row > a.button{
    flex:1 1 0;
    min-width:0;
    margin:0;
}

.tms-table td .button{
    margin:0;
}

.tms-admin-filters{
    grid-template-columns:minmax(220px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
}

.tms-filter-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

@media (max-width: 1024px){
    .tms-admin-filters{
        grid-template-columns:1fr 1fr;
    }
}

@media (max-width: 768px){

    /* Хедър: името вляво, камбанката горе вдясно, менюто под тях */
    .tflow-header{
        position:relative !important;
    }

    .tflow-header-left{
        padding-right:52px;
        min-height:40px;
        justify-content:center;
    }

    .tflow-header .tflow-bell{
        position:absolute;
        top:10px;
        right:12px;
    }

    .tflow-bell-btn{
        width:38px;
        height:38px;
    }

    .tflow-nav{
        grid-template-columns:1fr 1fr;
    }

    .tflow-nav .tflow-logout{
        grid-column:1 / -1;
    }

    .tms-carrier-dashboard .tms-mobile-action-row{
        flex-direction:column;
    }

    .tms-carrier-dashboard .tms-mobile-action-row > .button,
    .tms-carrier-dashboard .tms-mobile-action-row > a.button{
        flex:none;
        width:100%;
        min-height:42px;
    }

    .tms-admin-filters{
        grid-template-columns:1fr;
    }

    .tflow-refresh{
        flex-direction:column;
    }

    .tflow-refresh .button{
        width:100%;
    }
}

@media (max-width: 480px){
    .tflow-nav{
        grid-template-columns:1fr 1fr;
    }
}

/* === 6.0.0: по-ясни и подредени карти на заявките (мобилно) === */
@media (max-width: 1024px){

    .tms-carrier-dashboard .tms-mobile-jobs-list{
        gap:22px;
    }

    .tms-carrier-dashboard .tms-mobile-job-card{
        position:relative;
        padding:0 0 14px;
        overflow:hidden;
        border:1px solid #cbd5e1;
        border-left:5px solid #2563eb;
        border-radius:14px;
        box-shadow:0 6px 18px rgba(15,23,42,.10);
    }

    .tms-carrier-dashboard .tms-mobile-job-head{
        margin:0 0 12px;
        padding:12px 14px;
        background:#eff6ff;
        border-bottom:1px solid #dbeafe;
    }

    .tms-carrier-dashboard .tms-mobile-job-title{
        font-size:17px;
        color:#1e3a8a;
    }

    .tms-carrier-dashboard .tms-mobile-info-grid,
    .tms-carrier-dashboard .tms-mobile-info-grid-cols-1,
    .tms-carrier-dashboard .tms-mobile-info-grid-cols-2,
    .tms-carrier-dashboard .tms-mobile-info-grid-cols-3,
    .tms-carrier-dashboard .tms-mobile-info-grid-cols-4{
        grid-template-columns:repeat(2, minmax(0, 1fr));
        gap:0 14px;
        padding:0 14px;
    }

    .tms-carrier-dashboard .tms-mobile-info-item{
        background:transparent;
        border:0;
        border-bottom:1px solid #eef2f7;
        border-radius:0;
        padding:8px 0;
    }

    .tms-carrier-dashboard .tms-mobile-info-item:first-child,
    .tms-carrier-dashboard .tms-mobile-info-item:nth-child(2){
        grid-column:1 / -1;
    }

    .tms-carrier-dashboard .tms-mobile-info-label{
        font-size:10.5px;
        margin-bottom:2px;
    }

    .tms-carrier-dashboard .tms-mobile-info-value{
        font-size:14px;
    }

    .tms-carrier-dashboard .tms-mobile-job-note{
        margin:12px 14px 0;
    }

    .tms-carrier-dashboard .tms-mobile-job-actions{
        padding:0 14px;
    }
}

/* Цветове по състояние на заявката */
.tms-carrier-dashboard .tms-job-free{border-left-color:#2563eb !important}
.tms-carrier-dashboard .tms-job-free .tms-mobile-job-head{background:#eff6ff !important;border-bottom-color:#dbeafe !important}
.tms-carrier-dashboard .tms-job-free .tms-mobile-job-title{color:#1e3a8a !important}

.tms-carrier-dashboard .tms-job-claim{border-left-color:#7c3aed !important}
.tms-carrier-dashboard .tms-job-claim .tms-mobile-job-head{background:#f5f3ff !important;border-bottom-color:#ddd6fe !important}
.tms-carrier-dashboard .tms-job-claim .tms-mobile-job-title{color:#4c1d95 !important}

.tms-carrier-dashboard .tms-job-progress{border-left-color:#f59e0b !important}
.tms-carrier-dashboard .tms-job-progress .tms-mobile-job-head{background:#fffbeb !important;border-bottom-color:#fde68a !important}
.tms-carrier-dashboard .tms-job-progress .tms-mobile-job-title{color:#92400e !important}

.tms-carrier-dashboard .tms-job-done{border-left-color:#16a34a !important}
.tms-carrier-dashboard .tms-job-done .tms-mobile-job-head{background:#f0fdf4 !important;border-bottom-color:#bbf7d0 !important}
.tms-carrier-dashboard .tms-job-done .tms-mobile-job-title{color:#166534 !important}

/* Таблет: две карти една до друга */
@media (min-width: 641px) and (max-width: 1024px){
    .tms-carrier-dashboard .tms-mobile-jobs-list{
        display:grid;
        grid-template-columns:repeat(2, minmax(0, 1fr));
        gap:18px;
        align-items:start;
    }
}

@media (max-width: 640px){
    .tms-carrier-dashboard .tms-mobile-form-grid{
        grid-template-columns:1fr;
    }
}
.tms-carrier-dashboard .tms-mobile-inline-form .tms-mobile-form-grid{
    margin-bottom:10px;
}

/* === Моите камиони: карти на мобилно === */
.tms-my-trucks .tms-truck-cards{display:none}

@media (max-width: 768px){
    .tms-my-trucks .tms-truck-table{display:none}

    .tms-my-trucks .tms-truck-cards{
        display:flex;
        flex-direction:column;
        gap:14px;
    }

    .tms-my-trucks .tms-truck-card{
        background:#fff;
        border:1px solid #cbd5e1;
        border-left:5px solid #2563eb;
        border-radius:14px;
        padding:14px;
        box-shadow:0 4px 14px rgba(15,23,42,.08);
    }

    .tms-my-trucks .tms-truck-plate{
        font-size:22px;
        font-weight:800;
        letter-spacing:.06em;
        color:#0f172a;
        margin-bottom:12px;
    }

    .tms-my-trucks .tms-truck-actions{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:10px;
    }

    .tms-my-trucks .tms-truck-actions form{margin:0}

    .tms-my-trucks .tms-truck-actions .button{
        display:flex;
        align-items:center;
        justify-content:center;
        width:100%;
        min-height:46px;
        box-sizing:border-box;
        font-size:15px;
        text-align:center;
    }

    .tms-my-trucks .tms-truck-delete{
        color:#b91c1c !important;
        border-color:#fecaca !important;
    }

    .tms-my-trucks .tms-inline-actions .button,
    .tms-add-truck .tms-form-actions .button,
    .tms-edit-truck .tms-form-actions .button{
        min-height:46px;
        box-sizing:border-box;
    }

    .tms-add-truck .tms-form-actions .button,
    .tms-edit-truck .tms-form-actions .button{
        width:100%;
    }

    .tms-add-truck input[type=text],
    .tms-edit-truck input[type=text]{
        min-height:46px;
        font-size:16px;
    }
}

/* Потребител в хедъра */
.tflow-user-name{
    font-size:13px;
    color:#94A3B8;
    font-weight:600;
}

@media (max-width: 768px){
    .tflow-user-name{
        font-size:11px;
    }
}

/* Одобряване на кандидатура от админ панела */
.tms-approve-box{
    display:flex;
    flex-direction:column;
    gap:6px;
    margin-top:8px;
    min-width:190px;
}

.tms-approve-box .tms-approve-select{
    width:100%;
    max-width:260px;
    min-height:34px;
    font-size:13px;
}

.tms-approve-box .button{
    width:100%;
    max-width:260px;
    justify-content:center;
}

/* Дата на мобилно: малка иконка, текстът с датата остава видим */
@media (max-width: 768px){
    .tms-date-wrap .tms-date-input{
        padding-right:36px;
        font-weight:600;
        text-overflow:clip;
    }

    .tms-date-wrap .tms-date-btn{
        right:4px;
        width:26px;
        height:26px;
    }

    .tms-date-wrap .tms-date-btn svg{
        width:16px;
        height:16px;
    }

    .tms-date-wrap .tms-date-native{
        right:0;
        left:auto;
        width:34px;
    }
}

/* === Няколко клиента/адреса на заявка === */
.tms-stop-list{display:flex;flex-direction:column;gap:12px;margin-bottom:12px}
.tms-stop-row{border:1px solid #cbd5e1;border-left:4px solid #2563eb;border-radius:12px;padding:12px;background:#f8fafc}
.tms-stop-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.tms-stop-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.tms-stop-fields select{width:100%;box-sizing:border-box}
@media (max-width: 768px){
    .tms-stop-fields{grid-template-columns:1fr}
}

/* Няколко клиента/адреса в списъците – всеки на нов ред */
.tms-table-main,
.tms-table-sub,
.tms-mobile-info-value,
.tms-summary-value{
    white-space:pre-line;
}

/* Сгъваеми секции (Известия) */
.tms-collapse > summary{
    cursor:pointer;
    font-weight:700;
    font-size:16px;
    list-style:none;
    padding:4px 0;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}
.tms-collapse > summary::-webkit-details-marker{display:none}
.tms-collapse > summary::after{
    content:'▾';
    color:#64748b;
    transition:transform .15s;
}
.tms-collapse:not([open]) > summary::after{transform:rotate(-90deg)}

.tflow-refresh-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
.tflow-refresh-close{
    width:32px;height:32px;padding:0;
    display:inline-flex;align-items:center;justify-content:center;
    border:1px solid #BFDBFE;border-radius:8px;background:#fff;color:#1E3A8A;
    font-size:20px;line-height:1;cursor:pointer;
}
.tflow-refresh-close:hover{background:#DBEAFE}

/* Редакция: формата се отваря само с бутона */
.tms-edit-toggle > summary{
    list-style:none;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:40px;
}
.tms-edit-toggle > summary::-webkit-details-marker{display:none}
.tms-edit-toggle[open] > summary{margin-bottom:12px}
.tms-edit-toggle[open] > summary::after{content:' ▴'}
.tms-edit-toggle:not([open]) > summary::after{content:' ▾'}

@media (max-width: 1024px){
    .tms-carrier-dashboard .tms-edit-toggle > summary{
        display:flex;
        width:100%;
        box-sizing:border-box;
        min-height:46px;
    }
    .tms-carrier-dashboard .tms-delivered-full{
        display:flex;
        width:100%;
        box-sizing:border-box;
        min-height:46px;
        justify-content:center;
        align-items:center;
        margin-top:10px;
    }
}

/* Информационни известия (без линк) */
.tms-notif-item .tms-notif-info{
    display:block;
    padding:12px 14px;
    border-bottom:1px solid var(--tflow-border);
    color:var(--tflow-text);
    cursor:default;
}
.tms-notif-item.is-unread .tms-notif-info{background:#EFF6FF}
.tms-notif-item:last-child .tms-notif-info{border-bottom:0}
div.tflow-bell-item{cursor:default}

.tms-pref-grid.tms-pref-grid-2{
    grid-template-columns:minmax(0, 1fr) 70px;
}

/* ЧАТ */

.tflow-chat-link{
    position:relative;
    display:inline-flex;
    align-items:center;
    gap:6px;
}

.tflow-chat-count{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:18px;
    height:18px;
    padding:0 5px;
    border-radius:9px;
    background:#ef4444;
    color:#fff;
    font-size:11px;
    font-weight:700;
    line-height:1;
}

.tflow-chat-count[hidden]{
    display:none;
}

.tms-chat{
    display:grid;
    grid-template-columns:1fr;
    height:calc(100vh - 220px);
    min-height:420px;
    background:#fff;
    border:1px solid var(--tflow-border);
    border-radius:16px;
    box-shadow:0 6px 20px rgba(0,0,0,0.05);
    overflow:hidden;
}

.tms-chat-admin{
    grid-template-columns:300px 1fr;
}

.tms-chat-list{
    display:flex;
    flex-direction:column;
    min-height:0;
    border-right:1px solid var(--tflow-border);
    background:#f9fafb;
}

.tms-chat-search{
    margin:12px;
    height:38px;
    padding:0 12px;
    border:1px solid #d1d5db;
    border-radius:10px;
    font-size:14px;
    box-sizing:border-box;
}

.tms-chat-threads{
    flex:1;
    overflow-y:auto;
}

.tms-chat-thread-item{
    display:block;
    padding:10px 14px;
    border-bottom:1px solid #eef0f3;
    color:#111827;
    text-decoration:none;
}

.tms-chat-thread-item:hover{
    background:#f1f5f9;
}

.tms-chat-thread-item.is-active{
    background:#e0ecff;
}

.tms-chat-thread-top,
.tms-chat-thread-sub{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:8px;
}

.tms-chat-thread-name{
    font-weight:600;
    font-size:14px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.tms-chat-thread-item.has-unread .tms-chat-thread-name{
    font-weight:800;
}

.tms-chat-thread-sub{
    margin-top:3px;
    font-size:12px;
    color:#6b7280;
}

.tms-chat-thread-last{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.tms-chat-thread-time{
    flex:0 0 auto;
}

.tms-chat-badge{
    flex:0 0 auto;
    min-width:20px;
    height:20px;
    padding:0 6px;
    border-radius:10px;
    background:#ef4444;
    color:#fff;
    font-size:11px;
    font-weight:700;
    line-height:20px;
    text-align:center;
    box-sizing:border-box;
}

.tms-chat-thread{
    display:flex;
    flex-direction:column;
    min-height:0;
    min-width:0;
}

.tms-chat-head{
    display:flex;
    align-items:center;
    gap:10px;
    padding:14px 18px;
    border-bottom:1px solid var(--tflow-border);
    font-size:16px;
    color:#111827;
}

.tms-chat-back{
    display:none;
    font-size:20px;
    text-decoration:none;
    color:#111827;
}

.tms-chat-messages{
    flex:1;
    overflow-y:auto;
    padding:16px 18px;
    background:#f8fafc;
}

.tms-chat-older{
    display:block;
    margin:0 auto 12px;
}

.tms-chat-older[hidden]{
    display:none;
}

.tms-chat-items{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.tms-chat-msg{
    max-width:min(640px, 80%);
    padding:9px 13px;
    border-radius:14px;
    background:#fff;
    border:1px solid #e5e7eb;
    align-self:flex-start;
}

.tms-chat-mine{
    align-self:flex-end;
    background:#dbeafe;
    border-color:#bfdbfe;
}

.tms-chat-meta{
    font-size:11px;
    color:#6b7280;
    margin-bottom:3px;
}

.tms-chat-body{
    font-size:14px;
    color:#111827;
    white-space:pre-wrap;
    overflow-wrap:anywhere;
}

.tms-chat-form{
    display:flex;
    gap:10px;
    align-items:flex-end;
    padding:12px 18px;
    border-top:1px solid var(--tflow-border);
}

.tms-chat-form textarea{
    flex:1;
    min-height:44px;
    max-height:160px;
    padding:10px 12px;
    border:1px solid #d1d5db;
    border-radius:10px;
    font:inherit;
    font-size:14px;
    resize:vertical;
    box-sizing:border-box;
}

.tms-chat-form .button{
    min-height:44px;
}

.tms-chat-error{
    margin:0 18px 12px;
    color:#b91c1c;
    font-size:13px;
}

.tms-chat-error[hidden]{
    display:none;
}

.tms-chat-empty{
    margin:auto;
    padding:24px;
    text-align:center;
}

.tms-chat-pad{
    padding:12px 14px;
    margin:0;
}

@media (max-width: 768px){
    .tms-chat-page.tms-wrap{
        padding:12px 12px 24px;
    }

    .tms-chat-page .tms-page-title{
        font-size:22px;
        margin-bottom:12px;
    }

    .tms-chat,
    .tms-chat-admin{
        grid-template-columns:1fr;
        height:calc(100vh - 200px);
    }

    .tms-chat-admin .tms-chat-list{
        border-right:0;
    }

    /* Мобилно при админа: или списъкът, или разговорът. */
    .tms-chat-admin.tms-chat-has-thread .tms-chat-list,
    .tms-chat-admin:not(.tms-chat-has-thread) .tms-chat-thread{
        display:none;
    }

    .tms-chat-back{
        display:inline-block;
    }

    .tms-chat-msg{
        max-width:88%;
    }

    .tms-chat-form{
        padding:10px 12px;
    }
}

/* НОВО В T-FLOW (след обновяване) */

.tms-whats-new{
    margin:16px 24px 0;
    padding:16px 20px;
    background:#eff6ff;
    border:1px solid #bfdbfe;
    border-left:4px solid var(--tflow-primary);
    border-radius:12px;
    color:#111827;
    font-size:14px;
}

.tms-whats-new-head{
    font-size:15px;
    margin-bottom:6px;
}

.tms-whats-new-version{
    margin-top:8px;
    font-weight:600;
    font-size:13px;
    color:#1e40af;
}

.tms-whats-new ul{
    margin:6px 0 12px;
    padding-left:20px;
}

.tms-whats-new li{
    margin:4px 0;
    line-height:1.45;
}

.tms-whats-new .tms-whats-new-ok{
    display:inline-flex;
    align-items:center;
    min-height:36px;
    padding:0 18px;
    border-radius:10px;
    background:var(--tflow-primary);
    color:#fff;
    text-decoration:none;
    font-weight:600;
}

@media (max-width: 768px){
    .tms-whats-new{
        margin:12px 12px 0;
        padding:14px;
    }
}

/* Предложен друг час на товарене (1.6.5) */
.tms-claim-form-inline .tms-claim-time{
    display:inline-flex;
    align-items:center;
    gap:6px;
    font-size:13px;
    color:#6b7280;
    white-space:nowrap;
}

.tms-claim-form-inline .tms-claim-time input{
    width:82px;
    min-width:82px;
    text-align:center;
}

.tms-proposed-time{
    margin-top:4px;
    font-size:12px;
    font-weight:600;
    color:#b45309;
}

.tms-comment-box + .tms-proposed-time,
td > .tms-proposed-time:first-child{
    margin-top:0;
    margin-bottom:4px;
}

/* Предложения за час в колона „Товарене“ */
.tms-proposals{
    margin-top:6px;
    padding-top:4px;
    border-top:1px dashed #fcd34d;
}

.tms-proposals .tms-proposed-time{
    margin:2px 0 0;
    white-space:nowrap;
}

.tms-proposals .tms-proposed-time span{
    font-weight:500;
    color:#92400e;
}

/* Прозорец за избор на час при одобрение */
.tms-modal-backdrop{
    position:fixed;
    inset:0;
    z-index:100000;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:16px;
    background:rgba(15,23,42,.55);
}

.tms-modal{
    width:100%;
    max-width:460px;
    padding:22px;
    border-radius:16px;
    background:#fff;
    color:#111827;
    box-shadow:0 20px 50px rgba(0,0,0,.25);
}

.tms-modal h3{
    margin:0 0 6px;
    font-size:18px;
}

.tms-modal p{
    margin:0 0 12px;
    font-size:14px;
}

.tms-modal-label{
    font-weight:600;
}

.tms-modal-warning{
    padding:10px 12px;
    border-radius:10px;
    background:#fef2f2;
    color:#b91c1c;
}

.tms-modal-choices{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    margin-bottom:12px;
}

.tms-modal-choices .button{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:2px;
    height:auto !important;
    min-height:0 !important;
    padding:12px 10px !important;
    line-height:1.3;
    white-space:normal;
}

.tms-modal-choices strong{
    font-size:22px;
}

.tms-modal-choices small{
    font-size:11px;
    opacity:.8;
}

.tms-modal-cancel{
    width:100%;
}

@media (max-width: 480px){
    .tms-modal-choices{
        grid-template-columns:1fr;
    }
}
