@font-face {
    font-family: 'Golos Text';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/golos-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Golos Text';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/golos-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --primary: #0066cc;
    --primary-hover: #0052a3;
    --secondary: #6c757d;
    --success: #4caf50;
    --error: #f44336;
    --danger: #f44336;
    --warning: #ff9800;
    --info: #2196f3;
    --text-dark: #222;
    --text-gray: #666;
    --text-muted: #999;
    --text-light: #999;
    --bg: #fff;
    --bg-white: #fff;
    --bg-light: #f5f5f5;
    --bg-hover: #f0f0f0;
    --bg-gray: #f8f9fa;
    --bg-secondary: #e9ecef;
    --border: #ddd;
    --border-light: #e5e5e5;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 2px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --radius: 6px;
    --radius-lg: 8px;
    --accent-orange: #FF6B35;
}

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

html {
    overflow-y: scroll;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-dark);
    background: var(--bg-light);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

h1 { font-size: 22px }
h2 { font-size: 19px }
h3 { font-size: 17px }
h4 { font-size: 15px }

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover { color: var(--primary-hover) }

p { margin-bottom: 1rem }

.form-group { margin-bottom: 1rem }
.form-row { display: flex; gap: 1rem }
.form-row .form-group { flex: 1 }

label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 13px;
}

.required { color: var(--error) }

input, select, textarea {
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: var(--bg-white);
}

input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.input-readonly, input[readonly], textarea[readonly] {
    background-color: var(--bg-light) !important;
    color: var(--text-gray);
    cursor: default;
}

textarea {
    resize: vertical;
    min-height: 70px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1rem;
}

.checkbox-list .checkbox-group {
    padding: 0.6rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: #fafafa;
    transition: all 0.2s;
}

.checkbox-list .checkbox-group:hover {
    background: white;
    border-color: var(--primary);
}

.checkbox-group input[type="checkbox"] { width: auto }
.checkbox-group label { margin: 0; font-weight: normal; font-size: 14px }

.field-hint { font-size: 12px; color: var(--text-gray); margin-top: 0.25rem }

.input-group { display: flex; gap: 0.5rem }
.input-group input { flex: 1 }

.btn {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.5;
    min-height: 32px;
    white-space: nowrap;
    background: var(--bg-white);
    color: var(--text-dark);
}

.btn:hover:not(:disabled) { background: var(--bg-light) }
.btn:disabled { opacity: 0.6; cursor: not-allowed }

.btn-primary { background: var(--primary); color: white; border-color: var(--primary) }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); color: white }
.btn-success { background: var(--success); color: white; border-color: var(--success) }
.btn-danger { background: var(--error); color: white; border-color: var(--error) }
.btn-warning { background: var(--accent-orange); color: white; border-color: var(--secondary) }
.btn-warning:hover:not(:disabled) { background: var(--secondary); border-color: var(--secondary); color: white }
.btn-secondary { background: var(--bg-light); color: var(--text-dark); border-color: var(--border) }
.btn-secondary:hover:not(:disabled) { background: var(--border-light); border-color: var(--border) }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 13px; min-height: 28px }
.btn-block { display: block; width: 100% }

.alert {
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.85rem;
    border-radius: var(--radius);
    font-size: 14px;
}

.alert-error, .alert-danger { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2 }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9 }
.alert-info { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d }
.alert-secondary { background: #f5f5f5; color: #616161; border: 1px solid #e0e0e0 }

.toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    z-index: 9999;
    animation: toastIn 0.3s ease;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.toast.hide { animation: toastOut 0.3s ease forwards }
.toast-success { background: #2e7d32; color: white }
.toast-error { background: #c62828; color: white }
.toast-info { background: #1565c0; color: white }
.toast-warning { background: #f57c00; color: white }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) } to { opacity: 1; transform: translateY(0) } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0) } to { opacity: 0; transform: translateY(20px) } }

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg) } }

.badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
}

.badge-success { background: #e8f5e9; color: #4caf50 }
.badge-warning { background: #fff3e0; color: #ff9800 }
.badge-danger { background: #ffebee; color: #f44336 }
.badge-info { background: #e3f2fd; color: #2196f3 }
.badge-secondary { background: var(--bg-light); color: var(--text-gray) }

.table, .data-table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .data-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-weight: 500;
    color: var(--text-gray);
    border-bottom: 2px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
}

.table td, .data-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--bg-hover);
    font-size: 14px;
}

.table tbody tr:hover, .data-table tbody tr:hover { background: #fafafa }
.table tbody tr:last-child td, .data-table tbody tr:last-child td { border-bottom: none }

.table-responsive { overflow-x: auto }
.table-filters { display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center }
.table-filters form { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center }
.table-filters select, .table-filters input { min-width: 150px; width: auto }
.live-filter-count { color: var(--secondary); font-size: 0.875rem; margin-left: 0.5rem }
.live-filter-count:empty { display: none }
.table-actions { display: flex; gap: 0.3rem; flex-wrap: wrap }
.actions-column { cursor: default !important; }
.clickable-row { cursor: pointer }
.clickable-row:hover { background: #f0f5ff !important }

.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding: 0 !important;
}

.sortable-header a {
    color: inherit;
    text-decoration: none;
    display: block;
    padding: 0.6rem 1.5rem 0.6rem 0.75rem;
}

.sortable-header::after {
    content: '↕';
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
    font-size: 14px;
    pointer-events: none;
}

.sortable-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.sortable-header:hover::after {
    opacity: 0.6;
}

.sortable-header.sorted-asc::after {
    content: '↑';
    opacity: 1;
}

.sortable-header.sorted-desc::after {
    content: '↓';
    opacity: 1;
}

.content-section {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    padding: 1.35rem;
    margin-bottom: 1.1rem;
    border-radius: var(--radius);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--bg-hover);
}

.section-title {
    font-size: 17px;
    font-weight: 500;
}

.info-grid, .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 1.1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0.85rem;
    background: var(--bg-light);
    border-radius: var(--radius);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.4rem 0;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.info-label {
    font-size: 12px;
    color: var(--text-gray);
    text-transform: uppercase;
    flex-shrink: 0;
    margin-right: 1rem;
}

.info-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
    text-align: right;
}

.stat-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-dark);
}

.stat-label {
    font-size: 12px;
    color: var(--text-gray);
    margin-top: 0.3rem;
    text-transform: uppercase;
}

.stat-success .stat-value { color: var(--success) }
.stat-warning .stat-value { color: #d97706 }
.stat-danger .stat-value { color: var(--error) }


.balance-display {
    background: linear-gradient(135deg, var(--primary) 0%, #004999 100%);
    color: white;
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.balance-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.withdraw-form {
    max-width: 400px;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.finance-summary {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.summary-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.summary-card.text-center {
    text-align: center;
}

.summary-card.summary-income {
    border-left: 4px solid var(--success);
}

.summary-card.summary-expense {
    border-left: 4px solid var(--error);
}

.summary-card.summary-tax {
    border-left: 4px solid var(--warning);
}

.summary-card.summary-profit {
    border-left: 4px solid var(--primary);
    background: linear-gradient(135deg, rgba(0,102,204,0.05) 0%, rgba(0,102,204,0.02) 100%);
}

.summary-card.summary-partner {
    border-left: 4px solid #9c27b0;
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.summary-details {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    line-height: 1.5;
}

.empty-state {
    padding: 2.5rem;
    text-align: center;
    color: var(--text-gray);
}

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.empty-state-text { margin-bottom: 1.25rem }

.services-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.service-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s;
}

.service-card-header:hover {
    background: var(--bg);
}

.service-card-body {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    gap: 1rem;
}

.service-card.open .service-card-body {
    display: flex;
}


.service-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.service-actions .inline-form {
    display: inline-block;
}

.service-card[onclick] {
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.service-card[onclick]:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.info-rows {
    display: flex;
    flex-direction: column;
}

.companies-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.company-card, .detail-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.company-card.company-active, .detail-card-active {
    border-left: 4px solid var(--success);
}

.company-header, .detail-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.company-name, .detail-card-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.company-type, .detail-card-subtitle {
    font-size: 0.75rem;
    color: var(--text-gray);
    font-weight: 500;
    background: var(--bg-light);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.company-actions, .detail-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.company-details, .detail-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    font-size: 0.875rem;
    color: var(--text-gray);
}

.company-detail span, .detail-card-row span {
    color: var(--text-muted);
}

.companies-list, .detail-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-gray);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.modal-close:hover {
    color: var(--text-dark);
    background: var(--bg-gray);
}

.modal-content form {
    padding: 1.25rem;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.radio-label input[type="radio"] {
    width: auto;
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--bg-hover);
}

.page-info { color: var(--text-gray); font-size: 14px }

.form-tabs {
    display: flex;
    gap: 2px;
    background: var(--border-light);
    padding: 2px;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    overflow-x: auto;
}

.tabs {
    background: rgba(0, 0, 0, 0.03);
    padding: 4px;
    border-radius: var(--radius);
    display: flex;
    gap: 3px;
    margin-bottom: 1.5rem;
}

.form-tab, .tab {
    padding: 0.5rem 0.9rem;
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    border-radius: calc(var(--radius) - 2px);
}

.form-tab:hover, .tab:hover { background: rgba(255,255,255,0.6) }

.form-tab.active, .tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.form-tab-content { display: none; animation: fadeIn 0.3s ease }
.form-tab-content.active { display: block }

body.auth-page {
    background: linear-gradient(135deg, #E8F4FF 0%, #fff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    padding: 2.25rem;
    animation: fadeInUp 0.5s ease-out;
}

.logo {
    text-align: center;
    margin-bottom: 1.75rem;
}

.logo a {
    display: inline-block;
    transition: transform 0.3s ease;
}

.logo a:hover { transform: scale(1.05) }

.logo img {
    height: 40px;
    width: auto;
}

.auth-container h1 {
    font-size: 1.35rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.6rem;
    color: #222;
}

.subtitle {
    color: var(--text-gray);
    text-align: center;
    margin-bottom: 1.75rem;
    font-size: 14px;
    line-height: 1.5;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.35rem;
    border-bottom: 2px solid #ddd;
}

.auth-tab {
    flex: 1;
    padding: 0.65rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-weight: 600;
    color: var(--text-gray);
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.auth-tab:hover:not(.disabled) {
    color: var(--primary);
}

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

.auth-tab.disabled {
    color: #bbb;
    cursor: not-allowed;
    opacity: 0.6;
}

.auth-tab-content {
    display: none;
}

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

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.1rem;
}

.forgot-link {
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
}

.forgot-link:hover { text-decoration: underline }

.divider {
    text-align: center;
    margin: 1.75rem 0 1.25rem;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--border);
}

.divider span {
    background: #fff;
    padding: 0 1rem;
    color: var(--text-gray);
    font-size: 13px;
    position: relative;
}

.links { text-align: center }
.links a { font-weight: 500; font-size: 14px }

.back-link {
    display: block;
    text-align: center;
    margin-top: 1.25rem;
    color: var(--primary);
    font-weight: 500;
    font-size: 14px;
}

.copyright {
    text-align: center;
    margin-top: 1.75rem;
    color: var(--text-muted);
    font-size: 12px;
}

.message-container { text-align: center }

.icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.25rem;
}

.icon-success { background: #4caf50; color: white }

.message {
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 1.75rem;
    font-size: 14px;
}

.panel-layout {
    display: flex;
    min-height: 100vh;
}

.panel-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 54px;
    display: flex;
    justify-content: center;
    background: white;
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1330px;
    padding: 0 20px;
    height: 100%;
}

.panel-main {
    max-width: 1330px;
    margin: 0 auto;
    display: flex;
    width: 100%;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--text-gray);
    display: none;
}

.header-logo img { height: 28px }

.header-right .balance-display {
    padding: 5px 14px;
    background: var(--bg-light);
    border-radius: var(--radius);
    margin: 0;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-right .balance-label {
    color: var(--text-gray);
    margin-right: 7px;
    font-size: 13px;
}

.balance-amount {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

.balance-chevron {
    transition: transform 0.2s;
    opacity: 0.6;
}

.balance-display.open .balance-chevron {
    transform: rotate(180deg);
}

.balance-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 240px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.balance-display.open .balance-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.balance-dropdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.balance-dropdown-row:first-child {
    padding-top: 0;
}

.balance-dropdown-label {
    font-size: 13px;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 4px;
}

.balance-dropdown-value {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    flex-shrink: 0;
    white-space: nowrap;
}

.info-hint {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid #ccc;
    border-radius: 50%;
    cursor: help;
}

.info-hint-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #1a1a1a;
    color: white;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 1001;
}

.info-hint-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1a1a1a;
}

.info-hint:hover .info-hint-tooltip {
    opacity: 1;
    visibility: visible;
}

.balance-dropdown-btn {
    width: 100%;
    margin-top: 12px;
    text-align: center;
}

.user-dropdown { position: relative }

.user-button {
    display: flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: 1px solid var(--border);
    padding: 7px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.user-button:hover { background: var(--bg-light) }

.user-dropdown.open .dropdown-menu { display: block }

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 190px;
    z-index: 1000;
}

.dropdown-item {
    display: block;
    padding: 9px 14px;
    color: var(--text-dark);
    transition: background 0.2s;
    font-size: 14px;
}

.dropdown-item:hover { background: var(--bg-light) }

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 3px 0;
}

.panel-sidebar {
    position: sticky;
    top: 54px;
    align-self: flex-start;
    width: 180px;
    min-width: 180px;
    background: #f8f9fa;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    border-radius: 0 0 8px 0;
    z-index: 100;
}

.panel-sidebar.collapsed { width: 52px; min-width: 52px }
.panel-sidebar.collapsed .nav-section-title,
.panel-sidebar.collapsed .nav-badge { display: none }
.panel-sidebar.collapsed .nav-item { justify-content: center }

.sidebar-nav { padding: 8px 0 }

.nav-section { margin-bottom: 4px }

.nav-section-title {
    padding: 5px 18px;
    margin-bottom: 2px;
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: rgba(0,0,0,0.03);
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 18px 8px 15px;
    border-left: 3px solid transparent;
    color: var(--text-dark);
    transition: all 0.2s;
    font-size: 14px;
    line-height: 1.2;
}

.nav-item:hover { background: rgba(0,0,0,0.05) }

.nav-item.active {
    background: white;
    color: var(--primary);
    font-weight: 500;
    border-left-color: var(--primary);
}

.nav-badge {
    background: var(--accent-orange);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.panel-content {
    padding: 70px 20px 20px;
    flex: 1;
    min-width: 0;
}


.order-summary {
    background: #f9f9f9;
    padding: 0.85rem;
    border-radius: var(--radius);
    margin-bottom: 0.85rem;
}

.order-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.45rem 0;
    font-size: 14px;
}

.order-summary-row.total {
    border-top: 1px solid #ddd;
    margin-top: 0.45rem;
    padding-top: 0.85rem;
    font-weight: 600;
}

.order-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #666;
}

.tariff-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.tariff-controls .tabs {
    width: 100%;
}

.tariff-controls .tabs .tab {
    flex: 1;
    text-align: center;
}

.tariff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 300px));
    gap: 1.35rem;
    justify-content: center;
}

.tariff-card {
    background: white;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius);
    padding: 1.65rem;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tariff-card:hover {
    border-color: #4A90E2;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.1);
    transform: translateY(-2px);
}

.tariff-card.popular {
    border-color: #4A90E2;
    background: linear-gradient(to bottom, white, #F0F7FF);
}

.tariff-card[data-category="vip"] { border-color: #ffc107 }
.tariff-card[data-category="bitrix"] { border-color: #e91e63 }

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent-orange), #FF3B30);
    color: white;
    padding: 5px 18px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    box-shadow: 0 4px 10px rgba(255, 107, 53, 0.4);
}

.tariff-header {
    margin-bottom: 1.35rem;
    padding-bottom: 1.35rem;
    border-bottom: 2px solid #E2E8F0;
}

.tariff-name {
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #0A1628;
    margin-bottom: 0.7rem;
}

.tariff-price-block { margin-top: 0.7rem }

.price-display { display: none }
.price-display.active { display: block }

.price-main-line {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.price-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: #334155;
    letter-spacing: -0.02em;
}

.price-currency {
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

.price-period {
    font-size: 13px;
    color: #475569;
}

.price-month-line {
    font-size: 13px;
    color: #94a3b8;
}

.tariff-features {
    list-style: none;
    margin-bottom: 1.35rem;
    flex-grow: 1;
    padding: 0;
}

.tariff-features li {
    padding: 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
    color: #0A1628;
    border-bottom: 1px solid #f5f5f5;
}

.tariff-features li:last-child { border-bottom: none }

.feature-check {
    color: #10B981;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.feature-value {
    font-weight: 700;
    color: #4A90E2;
}

.tariff-options {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.options-label {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.options-label::before,
.options-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.options-label::before { margin-right: 0.75rem }
.options-label::after { margin-left: 0.75rem }

.options-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: #64748b;
}

.options-items span {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.tariff-action { margin-top: auto }

.btn-order {
    display: block;
    width: 100%;
    padding: 0.65rem;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    text-align: center;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.btn-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(74, 144, 226, 0.4);
    color: white;
}

.tariff-card.popular .btn-order {
    background: linear-gradient(135deg, var(--accent-orange), #FF3B30);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.tariff-card.popular .btn-order:hover {
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.4);
}

.promo-block {
    background: #E8F4FF;
    padding: 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    text-align: center;
}

.promo-block h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

.text-muted { color: var(--text-light) }
.text-success { color: var(--success) }
.text-warning { color: #f59e0b }
.text-danger { color: var(--error) }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px) }
    to { opacity: 1; transform: translateY(0) }
}

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

.bottom-nav { display: none }
.mobile-menu-toggle { display: none }
.mobile-menu { display: none }
.mobile-menu-overlay { display: none }

@media (max-width: 768px) {
    .form-row { flex-direction: column }
    .dashboard-grid, .info-grid { grid-template-columns: 1fr }

    .menu-toggle { display: none }
    .panel-sidebar { display: none }
    .sidebar-overlay { display: none !important }
    .user-dropdown { display: none }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        padding: 8px;
        cursor: pointer;
        color: var(--text-dark);
        border-radius: 6px;
    }

    .mobile-menu-toggle:active {
        background: var(--bg-hover);
    }

    .mobile-menu {
        display: block;
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100%;
        background: #fff;
        z-index: 2000;
        transition: right 0.3s ease;
        overflow-y: auto;
        box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    }

    .mobile-menu.open {
        right: 0;
    }

    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1999;
    }

    .mobile-menu-overlay.open {
        display: block;
    }

    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        border-bottom: 1px solid var(--border-light);
        background: #f8f9fa;
    }

    .mobile-menu-title {
        font-weight: 600;
        font-size: 16px;
        color: var(--text-dark);
    }

    .mobile-menu-close {
        background: none;
        border: none;
        padding: 4px;
        cursor: pointer;
        color: var(--text-gray);
    }

    .mobile-menu-nav {
        padding: 8px 0;
    }

    .mobile-menu-section {
        padding: 8px 0;
    }

    .mobile-menu-section-title {
        padding: 8px 16px;
        font-size: 11px;
        text-transform: uppercase;
        color: #94a3b8;
        font-weight: 700;
        letter-spacing: 0.5px;
    }

    .mobile-menu-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        color: var(--text-dark);
        text-decoration: none;
        font-size: 15px;
        transition: background 0.15s;
    }

    .mobile-menu-item:active {
        background: var(--bg-hover);
    }

    .mobile-menu-item.active {
        color: var(--primary);
        background: #e8f4ff;
        font-weight: 500;
    }

    .mobile-menu-badge {
        background: var(--accent-orange);
        color: white;
        padding: 2px 8px;
        border-radius: 10px;
        font-size: 12px;
        font-weight: 600;
    }

    .mobile-menu-logout {
        color: #dc2626;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    .panel-header {
        padding: 0 12px;
        height: 50px;
    }

    .header-left, .header-right { gap: 8px }

    .header-logo img { height: 24px }

    .header-right .balance-display {
        padding: 6px 10px;
        font-size: 13px;
        border-radius: 20px;
    }

    .header-right .balance-label { display: none }
    .header-right .balance-amount { font-weight: 600 }
    .header-right .balance-chevron { display: none }

    .balance-dropdown {
        right: 0;
        min-width: 200px;
    }

    .panel-content {
        padding: 58px 12px 70px 12px;
        overflow-x: hidden;
    }

    .content-section {
        padding: 12px;
        max-width: 100%;
        overflow-x: hidden;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: #fff;
        border-top: 1px solid var(--border-light);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        padding: 0 4px;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #64748b;
        font-size: 9px;
        font-weight: 500;
        padding: 4px 8px;
        border-radius: 6px;
        transition: all 0.15s;
        min-width: 50px;
        position: relative;
    }

    .bottom-nav-item:active {
        background: #f1f5f9;
    }

    .bottom-nav-item.active {
        color: var(--primary);
    }

    .bottom-nav-item.active .nav-icon {
        color: var(--primary);
    }

    .bottom-nav-item .nav-icon {
        width: 22px;
        height: 22px;
        margin-bottom: 2px;
        color: #64748b;
    }

    .bottom-nav-item .nav-icon svg {
        width: 100%;
        height: 100%;
    }

    .bottom-nav-badge {
        position: absolute;
        top: 0;
        right: 4px;
        background: var(--accent-orange);
        color: white;
        font-size: 8px;
        font-weight: 700;
        min-width: 14px;
        height: 14px;
        border-radius: 7px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 3px;
    }

    .tabs {
        width: 100%;
        flex-wrap: wrap;
        gap: 4px;
    }

    .tab {
        font-size: 13px;
        padding: 8px 12px;
    }

    .quick-amounts { grid-template-columns: repeat(3, 1fr); gap: 6px }
    .quick-amount { padding: 8px 4px; font-size: 13px }

    .tariff-controls { flex-direction: column; align-items: stretch }
    .tariff-grid { grid-template-columns: 1fr }

    .modal-content { width: 95%; margin: 1rem auto }
    .modal-footer { flex-direction: column }
    .modal-footer .btn { width: 100% }

    .table-responsive {
        margin: 0 -12px;
        padding: 0 12px;
        overflow-x: auto;
    }

    .service-card-body {
        flex-direction: column;
        align-items: flex-start;
    }

    .service-info {
        gap: 0.5rem 1rem;
    }

    .service-actions {
        margin-top: 10px;
        width: 100%;
    }

    .service-actions .btn {
        width: 100%;
    }

    .ticket-layout {
        flex-direction: column;
    }

    .ticket-sidebar {
        width: 100%;
    }

    .ticket-header-top {
        flex-direction: column;
        gap: 12px;
    }

    .chat-form-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-form-buttons {
        justify-content: stretch;
    }

    .chat-form-buttons .btn {
        flex: 1;
    }
}


@media (max-width: 640px) {
    .auth-container { padding: 1.75rem; border-radius: var(--radius-lg) }
}

@media (max-width: 480px) {
    body.auth-page { padding: 10px }
    .auth-container { padding: 1.35rem }
    .logo img { height: 38px }
    .form-footer { flex-direction: column; align-items: flex-start; gap: 0.85rem }
    .checkbox-group { order: 2 }
    .forgot-link { order: 1 }

    .quick-amounts { grid-template-columns: repeat(2, 1fr); gap: 6px }
    .quick-amount { padding: 8px; font-size: 13px }

    .table th, .table td, .data-table th, .data-table td {
        padding: 0.5rem;
        font-size: 13px;
    }

    .sortable-header a {
        padding: 0.5rem 1.3rem 0.5rem 0.5rem;
    }

    .btn { padding: 0.4rem 0.7rem; font-size: 13px }
    .btn-sm { padding: 0.25rem 0.5rem; font-size: 12px }

    .stat-value { font-size: 1.4rem }
    .stat-card { padding: 0.85rem }

    .balance-value { font-size: 1.5rem }

    .form-tabs {
        flex-wrap: wrap;
        gap: 4px;
    }

    .form-tab {
        font-size: 13px;
        padding: 8px 12px;
    }

    .tariff-card {
        padding: 1.25rem;
    }

    .tariff-header {
        word-wrap: break-word;
    }
}

@media (max-width: 360px) {
    .panel-content {
        padding: 58px 8px 70px 8px;
    }

    .content-section {
        padding: 10px;
    }

    .tariff-card {
        padding: 1rem;
    }

    .quick-amounts { grid-template-columns: 1fr 1fr }
}

.ticket-page {
    max-width: 100%;
}

.ticket-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.ticket-main {
    flex: 1;
    min-width: 0;
}

.ticket-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 16px;
}

.ticket-info-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
}

.info-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.info-panel-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.info-panel-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-panel-row .meta-label {
    font-size: 12px;
}

.ticket-header-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.ticket-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.ticket-header-top h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
}

.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
}

.ticket-meta-item {
    display: flex;
    gap: 6px;
    font-size: 13px;
}

.meta-label {
    color: #64748b;
}

.meta-value {
    color: #1e293b;
    font-weight: 500;
}

.meta-value a {
    color: var(--primary);
}

.status-open { color: #16a34a }
.status-waiting { color: #d97706 }
.status-client { color: #2563eb }
.status-closed { color: #64748b }

.chat-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.chat-message {
    display: flex;
    margin-bottom: 12px;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 80%;
}

.chat-message.theirs {
    justify-content: flex-start;
}

.chat-message.theirs .chat-bubble {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px 12px 12px 4px;
}

.chat-message.mine {
    justify-content: flex-end;
}

.chat-message.mine .chat-bubble {
    background: #d9fdd3;
    border-radius: 12px 12px 4px 12px;
}

.chat-sender {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.sender-name {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
}

.chat-message.mine .sender-name {
    color: #166534;
}

.chat-time {
    font-size: 12px;
    color: #94a3b8;
}

.chat-text {
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    word-wrap: break-word;
}

.chat-attachments {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-attachment-image {
    display: block;
}

.chat-attachment-image img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.chat-attachment-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 13px;
    color: #475569;
    text-decoration: none;
}

.chat-attachment-file:hover {
    background: #e2e8f0;
}

.chat-reply-form {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 20px;
}

.chat-reply-form textarea {
    resize: vertical;
    min-height: 100px;
}

.chat-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.chat-attachment-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.attachment-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #475569;
    transition: all 0.15s;
}

.attachment-label:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.hidden-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-hint {
    font-size: 12px;
    color: #94a3b8;
}

.selected-file {
    font-size: 13px;
    color: #0369a1;
    font-weight: 500;
}

.chat-form-buttons {
    display: flex;
    gap: 10px;
}

.btn-outline {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.chat-closed-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    color: #64748b;
    font-size: 14px;
}
/* Domain pages */
.domain-check-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}
.domain-check-form .form-group {
    flex: 1;
    margin: 0;
}
.prices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}
.price-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
}
.price-zone {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.price-card .price-value {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* Balance pages */
.balance-cards-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.balance-card,
.topup-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid #e0e0e0;
}
.topup-card {
    max-width: 500px;
    margin: 0 auto 20px auto;
}
.balance-cards-row .balance-card {
    flex: 1;
    min-width: 200px;
    max-width: 240px;
}
.balance-card {
    text-align: center;
}
.balance-card.bonus {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}
.balance-label {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 4px;
}
.balance-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
}
.balance-expiry {
    font-size: 12px;
    color: #059669;
    margin-top: 4px;
}
.topup-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: var(--text-dark);
    text-align: center;
}
.quick-amounts {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-width: 400px;
    margin: 0 auto;
}
.quick-amount {
    padding: 10px 0;
    font-size: 14px;
    border-radius: 6px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-align: center;
}
.quick-amount:hover {
    background: #eee;
    border-color: #ccc;
}
.quick-amount.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.input-currency {
    color: var(--text-gray);
    font-size: 15px;
}
.topup-card input[type="number"] {
    text-align: center;
}
.topup-card .form-group {
    text-align: center;
}
.topup-card .form-group label {
    display: block;
    margin-bottom: 8px;
}
.topup-card .btn {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.topup-card .btn + .btn {
    margin-top: 10px;
}
.topup-hint {
    margin: 12px 0 0 0;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}
.qr-container {
    padding: 16px 0;
    text-align: center;
}
#qr-code canvas, #qr-code img {
    border-radius: var(--radius-lg);
}
.qr-hint {
    margin: 12px 0 0;
    color: var(--text-gray);
    font-size: 14px;
}
.sbp-status {
    text-align: center;
    margin: 12px 0;
    color: var(--text-gray);
}
.sbp-status.status-error {
    color: #ef4444;
}
.sbp-mobile-btn {
    display: none;
    width: 100%;
}
.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: #22c55e;
    border-radius: 50%;
    color: white;
    font-size: 32px;
    line-height: 64px;
    text-align: center;
}
.success-text {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}
.success-amount {
    font-size: 24px;
    font-weight: 700;
    color: #22c55e;
    text-align: center;
}
#topup-qr .btn,
#topup-form .btn {
    width: 100%;
}
.promised-payment-block {
    text-align: center;
    margin-bottom: 16px;
}
.promised-btn {
    border-color: #f59e0b;
    color: #d97706;
}
.promised-btn:hover {
    background: #fffbeb;
}
.promised-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}
.promised-payment-info {
    text-align: center;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #92400e;
}
.promised-icon {
    margin-right: 6px;
}
.promised-date {
    color: #b45309;
    font-size: 13px;
}
@media (max-width: 480px) {
    .sbp-mobile-btn { display: block; }
    .quick-amounts { grid-template-columns: repeat(3, 1fr); }
}

/* Invoice pages */
.table td:nth-child(3) { max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Referral pages */
.withdraw-section {
    margin-top: 24px;
}
.withdraw-section h3 {
    margin-bottom: 16px;
}
.withdraw-options, .option-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.withdraw-option, .option-card {
    background: #f8f9fa;
    border-radius: var(--radius-lg);
    padding: 20px;
}
.withdraw-option h4, .option-card h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
}
.withdraw-option .option-desc, .option-card .option-desc {
    color: var(--text-gray);
    font-size: 14px;
    margin: 0 0 16px 0;
}
.withdraw-form .form-row {
    display: flex;
    gap: 12px;
}
.withdraw-form .form-row input {
    flex: 1;
}
.earnings-section {
    margin-top: 24px;
}
.earnings-section h3 {
    margin-bottom: 16px;
}
.sbp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.sbp-header p {
    margin: 0;
    color: var(--text-gray);
}
.payout-details-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.payout-detail-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: var(--radius-lg);
    border: 1px solid #e0e0e0;
}
.payout-detail-card.is-default {
    border-color: #28a745;
    background: #f0fff4;
}
.payout-detail-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.payout-detail-text {
    display: flex;
    flex-direction: column;
}
.payout-detail-text span {
    font-size: 13px;
    color: var(--text-gray);
}
.stat-card-link {
    margin-top: 16px;
}
.stat-card-link .stat-label {
    margin-bottom: 10px;
}
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}
@media (max-width: 768px) {
    .withdraw-options, .option-cards {
        grid-template-columns: 1fr;
    }
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    .sbp-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

.impersonate-bar {
    background: #ff9800;
    color: #000;
    padding: 8px 16px;
    text-align: center;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 1001;
}
.impersonate-bar strong { font-weight: 600 }
.impersonate-exit {
    margin-left: 16px;
    color: #000;
    text-decoration: underline;
    font-weight: 500;
}
.impersonate-exit:hover { text-decoration: none }

.clickable { cursor: pointer }

.tariff-diff {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}
.tariff-limit-error {
    text-align: center;
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 0.5rem;
    line-height: 1.3;
}
.tariff-card:has(.tariff-limit-error) {
    opacity: 0.7;
}

.settings-form { max-width: 800px }
.settings-group {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eee;
}
.settings-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.settings-group-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-dark);
}
.settings-hint {
    font-size: 13px;
    color: var(--text-gray);
    margin: 0 0 16px 0;
}
.settings-group-danger {
    background: #fff5f5;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid #fecaca;
}
.settings-group-danger .settings-group-title { color: #dc2626 }

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f9f9f9;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background 0.15s;
}
.checkbox-item:hover { background: var(--bg-hover) }
.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.checkbox-label {
    font-weight: 500;
    min-width: 80px;
    flex-shrink: 0;
}
.checkbox-hint {
    color: var(--text-gray);
    font-size: 13px;
    flex: 1;
}

.sessions-actions { margin-bottom: 16px }
.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f9f9f9;
    border-radius: var(--radius-lg);
    border: 1px solid #e0e0e0;
}
.session-item.session-current {
    background: #f0f7ff;
    border-color: var(--primary);
}
.session-device {
    font-weight: 500;
    margin-bottom: 2px;
}
.session-location {
    color: var(--text-gray);
    font-weight: normal;
}
.session-meta {
    font-size: 13px;
    color: var(--text-gray);
}
.session-ip::after { content: " · " }

.email-change-pending {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--radius-lg);
    margin: 8px 0 16px 0;
    font-size: 13px;
}
.pending-info { flex: 1 }
.pending-email {
    color: var(--primary);
    font-weight: 500;
}
.email-change-form { margin: 8px 0 16px 0 }
.inline-email-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.inline-email-form input[type="email"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 250px;
}
.email-change-hint {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: var(--text-gray);
}

.link-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.link-card {
    display: block;
    padding: 24px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.link-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}
.link-card-icon {
    color: var(--primary);
    margin-bottom: 12px;
}
.link-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}
.link-card-desc {
    font-size: 14px;
    color: var(--text-gray);
}

.modal-lg { max-width: 700px }
.list-items { margin-bottom: 16px }
.list-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.list-item:last-child { border-bottom: none }
.list-item-content { flex: 1 }
.list-item-content .item-label { font-size: 14px }
.badge-system {
    font-size: 11px;
    color: #888;
    margin-left: 8px;
}
.list-item-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    position: relative;
}
.btn-arrow {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1;
}
.btn-arrow:hover:not(.disabled) { color: var(--text-dark) }
.btn-arrow.disabled {
    color: #ddd;
    cursor: default;
}
.btn-action {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--text-gray);
    font-size: 16px;
    line-height: 1;
}
.btn-action:hover { color: var(--text-dark) }
.action-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 130px;
    z-index: 1000;
}
.action-menu.show { display: block }
.action-menu button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
}
.action-menu button:hover { background: #f5f5f5 }
.edit-form {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 6px;
}
.edit-input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex: 1;
    font-size: 14px;
}
.add-item-form {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}
.add-item-form input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.section-subtitle {
    color: var(--text-gray);
    font-size: 14px;
    margin-top: 4px;
}
.user-header-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

/* Utility classes */
.inline-form { display: inline }
.text-sm { font-size: 12px }
.text-secondary { color: var(--text-gray) }
.mt-1 { margin-top: 8px }
.mt-2 { margin-top: 16px }
.mb-1 { margin-bottom: 8px }
.mb-2 { margin-bottom: 16px }
.ml-1 { margin-left: 8px }
.mb-0 { margin-bottom: 0 }
.input-compact { max-width: 300px }
.input-total { font-weight: 600 }
.hidden { display: none }

/* Image modal lightbox */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.image-modal.active { display: flex }
.image-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
    cursor: default;
}
.chat-attachment-image { cursor: pointer }
