/* === RESET === */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    background: #f3f4f6;
}
h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 600; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
.hidden { display: none !important; }
.muted { color: #6b7280; }

/* === LOGIN === */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-size: 24px; color: #1f2937; margin: 0; }
.login-subtitle { font-size: 13px; color: #6b7280; margin: 4px 0 0; }

/* === FORM === */
.field {
    display: block;
    margin-bottom: 16px;
}
.field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}
.field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: white;
}
.field input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
    text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary {
    background: #667eea;
    color: white;
}
.btn-primary:hover:not(:disabled) { background: #5568d3; }
.btn-danger {
    background: #ef4444;
    color: white;
}
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-block { width: 100%; }

/* === MESSAGES === */
.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}
.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}
.message { margin: 8px 0; }
.message.error, .message.success { display: block; }

/* === APP LAYOUT === */
.app-screen {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}
.sidebar {
    background: #1f2937;
    color: #e5e7eb;
    padding: 20px 0;
    overflow-y: auto;
}
.sidebar-header { padding: 0 20px 20px; border-bottom: 1px solid #374151; }
.brand { font-size: 18px; font-weight: 600; color: white; }
.brand-sub { font-size: 12px; color: #9ca3af; }

.sidebar-nav { padding: 12px 0; }
.nav-section {
    padding: 16px 20px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    font-weight: 600;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: #d1d5db;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.1s;
}
.nav-item:hover:not(.disabled) { background: #374151; color: white; }
.nav-item.active { background: #4f46e5; color: white; }
.nav-item.disabled { opacity: 0.4; cursor: not-allowed; }
.nav-icon { width: 20px; text-align: center; }

/* === MAIN === */
.main {
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.topbar {
    background: white;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}
.topbar-title { font-size: 17px; font-weight: 600; color: #1f2937; }
.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4b5563;
}
.user-role {
    background: #ede9fe;
    color: #5b21b6;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.section { padding: 24px; }

/* === DASHBOARD === */
.welcome h2 { font-size: 24px; margin-bottom: 4px; }
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.card-icon { font-size: 22px; line-height: 1; }
.card-title { font-weight: 600; color: #1f2937; }
.card-desc { color: #6b7280; font-size: 13px; }
.card-ok { border-left: 4px solid #10b981; }
.card-progress { border-left: 4px solid #f59e0b; }
.card-pending { border-left: 4px solid #9ca3af; opacity: 0.7; }

/* === ENTITY CARD (просмотр) === */
.entity-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 18px;
    color: #6b7280;
    font-size: 13px;
}
.entity-section {
    margin-bottom: 18px;
}
.entity-section h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin: 0 0 8px;
    font-weight: 600;
}
.entity-section dl {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 6px 16px;
    margin: 0;
}
.entity-section dt { color: #6b7280; font-size: 13px; }
.entity-section dd { margin: 0; color: #1f2937; }
.entity-section dd code { font-family: ui-monospace, monospace; font-size: 13px; }

.linked-accounts { display: flex; flex-direction: column; gap: 8px; }
.linked-account {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.linked-account-icon { font-size: 22px; line-height: 1; }
.linked-account-info { flex: 1; min-width: 0; }
.linked-account-name { font-weight: 600; color: #1f2937; }
.linked-account-details { color: #6b7280; font-size: 12px; }
.linked-account-balance { color: #1f2937; font-weight: 600; white-space: nowrap; }

.modal-window.wide { max-width: 720px; }

/* === SETTINGS === */
.settings-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 22px;
    margin-bottom: 16px;
    max-width: 600px;
}
.profile-fields {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 8px 16px;
    margin: 0;
}
.profile-fields dt { color: #6b7280; font-size: 13px; }
.profile-fields dd { margin: 0; color: #1f2937; }

.placeholder { padding: 40px; text-align: center; color: #6b7280; }
.placeholder h2 { color: #9ca3af; }

/* === SECTION HEADER === */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* === TABLES === */
.table-wrap {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th {
    background: #f9fafb;
    color: #4b5563;
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.data-table th.accounts-group-title {
    background: #1f2937;
    color: white;
    font-size: 13px;
    padding: 10px 16px;
    text-transform: none;
    letter-spacing: 0;
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fafb; }
.data-table tr.clickable td { cursor: pointer; }
.data-table tr.clickable:hover td { background: #eef2ff; }
.data-table .row-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}
.data-table .row-actions button {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: white;
    cursor: pointer;
    color: #4b5563;
    transition: background 0.1s;
}
.data-table .row-actions button:hover { background: #f3f4f6; }
.data-table .row-actions button.danger { color: #dc2626; border-color: #fecaca; }
.data-table .row-actions button.danger:hover { background: #fef2f2; }

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: #f3f4f6;
    color: #4b5563;
}
.tag-active { background: #d1fae5; color: #065f46; }
.tag-inactive { background: #fee2e2; color: #991b1b; }
.tag-blue { background: #dbeafe; color: #1e40af; }
.tag-purple { background: #ede9fe; color: #5b21b6; }
.tag-orange { background: #ffedd5; color: #9a3412; }

.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #6b7280;
}
.loading {
    padding: 40px;
    text-align: center;
    color: #9ca3af;
}

/* === MODAL === */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}
.modal-window {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    box-shadow: 0 25px 75px rgba(0, 0, 0, 0.25);
    z-index: 1;
}
.modal-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-close {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
}
.modal-close:hover { background: #f3f4f6; color: #1f2937; }
.modal-body { padding: 24px; }
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}
.modal-actions .btn { padding: 8px 14px; }
.btn-secondary {
    background: white;
    color: #4b5563;
    border: 1px solid #d1d5db;
}
.btn-secondary:hover { background: #f3f4f6; }

/* === FORM === */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.field select, .field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
}
.field textarea { resize: vertical; min-height: 60px; }
.field select:focus, .field textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.field-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}
.field-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}
.field-checkbox input { width: auto; }

/* === TOAST === */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
}
.toast {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #667eea;
    font-size: 14px;
    animation: slideIn 0.2s ease-out;
}
.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* === ALERT === */
.alert {
    background: #fef9c3;
    border: 1px solid #fde047;
    color: #713f12;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert code {
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, monospace;
}

/* === DRIVER SCREEN (мобильный) === */
.driver-screen {
    min-height: 100vh;
    background: #f3f4f6;
    display: flex;
    flex-direction: column;
}
.driver-header {
    background: #1f2937;
    color: white;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.driver-greet { font-size: 16px; font-weight: 600; }
.driver-date { font-size: 13px; color: #9ca3af; margin-top: 2px; }
.driver-logout {
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}
.driver-logout:hover { background: rgba(255,255,255,0.2); }

.driver-main {
    flex: 1;
    padding: 16px;
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.driver-empty {
    background: white;
    border-radius: 14px;
    padding: 40px 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.driver-empty-icon { font-size: 56px; margin-bottom: 16px; }
.driver-empty h2 { font-size: 22px; margin-bottom: 8px; }

.driver-card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.driver-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.driver-card h3 {
    font-size: 16px;
    margin: 0;
    color: #1f2937;
}
.driver-count {
    display: inline-block;
    background: #ede9fe;
    color: #5b21b6;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}

.driver-meter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #6b7280;
    font-size: 14px;
}
.driver-meter-row strong {
    color: #1f2937;
    font-size: 16px;
}

.driver-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.driver-list-empty {
    padding: 16px 8px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

.driver-group {
    background: #f9fafb;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid transparent;
}
.driver-group-planned {
    background: #fffbeb;
    border-color: #fde68a;
}
.driver-group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}
.driver-group-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
}
.driver-group-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed #e5e7eb;
}
.driver-group-item:last-child { border-bottom: none; }
.driver-group-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.driver-group-actions .btn-sm { padding: 6px 10px; font-size: 12px; }

.status-planned   { background: #fef3c7; color: #92400e; }

.driver-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.1s;
}
.driver-item:hover, .driver-item:active { background: #f3f4f6; }
.driver-item-icon { font-size: 22px; line-height: 1; }
.driver-item-main { flex: 1; min-width: 0; }
.driver-item-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.driver-item-sub { color: #6b7280; font-size: 12px; margin-top: 2px; }
.driver-item-amount {
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
}
.driver-item-status {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 6px;
}
.status-delivered { background: #d1fae5; color: #065f46; }
.status-partial   { background: #fef3c7; color: #92400e; }
.status-returned  { background: #fee2e2; color: #991b1b; }
.status-failed    { background: #f3f4f6; color: #4b5563; }

.driver-totals { background: linear-gradient(135deg, #eef2ff, #faf5ff); }
.driver-total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    color: #4b5563;
    font-size: 14px;
}
.driver-total-row strong { color: #1f2937; font-size: 16px; }
.driver-total-final {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 16px;
}
.driver-total-final span { font-weight: 600; color: #1f2937; }
.driver-total-final strong { font-size: 22px; color: #4f46e5; }

.btn-lg {
    padding: 14px 18px;
    font-size: 16px;
    border-radius: 12px;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
}

.driver-history {
    margin-top: 8px;
    background: white;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.driver-history h3 { font-size: 16px; margin-bottom: 12px; }

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 8px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}
.history-item:last-child { border-bottom: none; }
.history-date { color: #1f2937; font-weight: 500; }
.history-meta { color: #6b7280; font-size: 12px; }

/* === REPORT DELIVERIES (в модале бухгалтера) === */
.client-group {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}
.client-group-header {
    display: flex;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 10px;
    font-size: 14px;
}
.invoice-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed #e5e7eb;
}
.invoice-row:last-child { border-bottom: none; }
.invoice-row-main { flex: 1; min-width: 0; }
.invoice-row-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    margin-bottom: 6px;
    font-size: 14px;
}
.invoice-row-payments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.invoice-row-amount {
    font-weight: 700;
    font-size: 15px;
    color: #1f2937;
    white-space: nowrap;
    flex-shrink: 0;
}
.pay-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}
.pay-cash { background: #d1fae5; color: #065f46; }
.pay-bank { background: #dbeafe; color: #1e40af; }
.pay-card { background: #ffedd5; color: #9a3412; }

/* === ROUTE DELIVERIES (внутри модала маршрутного листа) === */
.route-deliveries {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.route-delivery {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}
.route-delivery-main { flex: 1; min-width: 0; }
.route-delivery-client {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
    margin-bottom: 4px;
}
.route-delivery-address {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 4px;
}
.route-delivery-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    color: #6b7280;
    font-size: 13px;
}
.route-delivery-amount {
    margin-left: auto;
    color: #1f2937;
    font-weight: 600;
}
.route-delivery-notes { font-size: 12px; margin-top: 4px; }
.route-delivery-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}
.route-delivery-actions button {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: white;
    cursor: pointer;
    color: #4b5563;
    white-space: nowrap;
}
.route-delivery-actions button:hover { background: #f3f4f6; }
.route-delivery-actions button.danger {
    color: #dc2626;
    border-color: #fecaca;
    width: 32px;
    padding: 5px 0;
    font-size: 16px;
    line-height: 1;
}

/* === БЛОК ВЫБОРА МАГАЗИНА ДЛЯ СТАРШЕГО ПРОДАВЦА === */
.senior-shops {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.senior-shops .btn { width: 100%; padding: 12px 14px; }

/* === ВИДЖЕТ ТАБЕЛЯ В ШАПКЕ === */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.timesheet-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    background: #f3f4f6;
    color: #4b5563;
}
.timesheet-widget.present {
    background: #d1fae5;
    color: #065f46;
}
.timesheet-widget .ts-status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #9ca3af;
}
.timesheet-widget.present .ts-status-dot { background: #10b981; }
.timesheet-widget button {
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0 0 0 6px;
    text-decoration: underline;
    font-size: 12px;
}
.timesheet-widget button:hover { color: #1f2937; }

/* === SELLER ACTIONS === */
.seller-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* === ФОРМА ПОДСЧЁТА ДЕНЕГ ПО НОМИНАЛАМ === */
.cash-count {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 60vh;
    overflow-y: auto;
}
.cash-count-row {
    display: grid;
    grid-template-columns: 90px 1fr 110px;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    background: #f9fafb;
    border-radius: 8px;
}
.cash-count-row.coin { background: #f3f4f6; }
.cash-count-denom { font-weight: 600; color: #1f2937; }
.cash-count-row input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
}
.cash-count-subtotal {
    text-align: right;
    font-weight: 500;
    color: #4b5563;
    font-size: 14px;
}
.cash-count-total {
    margin-top: 12px;
    padding: 14px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 17px;
}
.cash-count-total .value { font-size: 22px; font-weight: 700; }

/* === ТП BALANCES WIDGET === */
.tp-summary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 20px 24px;
    border-radius: 14px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.tp-summary-label { font-size: 13px; opacity: 0.85; }
.tp-summary-value { font-size: 28px; font-weight: 700; line-height: 1.2; }

.tp-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.tp-card-empty {
    opacity: 0.65;
    background: #f9fafb;
}
.tp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 12px;
}
.tp-card-name { font-weight: 600; font-size: 16px; color: #1f2937; }
.tp-card-total {
    font-size: 22px;
    font-weight: 700;
    color: #4f46e5;
}
.tp-card-empty .tp-card-total { color: #9ca3af; font-size: 16px; }
.tp-card-empty-msg {
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
}
.tp-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #f3f4f6;
}
.tp-breakdown-row:last-child { border-bottom: none; }
.tp-breakdown-le { font-size: 14px; }
.tp-breakdown-amount { font-weight: 600; color: #1f2937; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .app-screen { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .form-row { grid-template-columns: 1fr; }
}
