/* Admin Panel Styles */

@import url("https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600;700;800;900&display=swap");

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #ea580c;
    /* --gray-50: #f9fafb; */
    /* --gray-100: #f3f4f6; */
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
}

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

/* Remove number input spinners globally */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

body {
    font-family: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h1 {
    font-size: 24px;
    margin-bottom: 10px;
    text-align: center;
}

.login-box .subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 30px;
}

.ip-info {
    background: var(--gray-100);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.ip-info code {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
}

.info-box {
    background: var(--gray-50);
    border-left: 4px solid var(--success);
    padding: 15px;
    margin-top: 20px;
    font-size: 14px;
}

.info-box p {
    margin: 8px 0;
}

/* Navbar */
.navbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.navbar-brand h1 {
    font-size: 20px;
    color: var(--primary);
}

.navbar-menu {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 5px;
}

.nav-link.logout {
    color: var(--danger);
}

.nav-info {
    color: var(--gray-500);
    font-size: 14px;
    font-family: monospace;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-900);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

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

.btn-success:hover {
    background: #15973f;
}

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

.btn-warning:hover {
    background: #d64a00;
}

.btn-info {
    background: #0891b2;
    color: white;
}

.btn-info:hover {
    background: #0e7490;
}

.btn-transfer {
    background: #7c3aed;
    color: white;
}

.btn-transfer:hover {
    background: #6d28d9;
}

.btn-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    fill: currentColor;
}

.button-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

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

.session-info {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
}

.actions-cell {
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-small.add-balance-btn {
    background: var(--success);
}

.btn-small.add-balance-btn:hover {
    background: #15973f;
}

.btn-small.set-balance-btn {
    background: var(--warning);
}

.btn-small.set-balance-btn:hover {
    background: #d64a00;
}

/* Dashboard */
.dashboard {
    background: white;
    border-radius: 8px;
    padding: 30px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 20px;
    border-radius: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 10px;
}

/* Dashboard Actions */
.dashboard-actions {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.dashboard-actions .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Search Box */
.search-box {
    margin-bottom: 30px;
    position: relative;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 16px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--gray-500);
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.3s;
}

.search-result-item:hover {
    background: var(--gray-50);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    /* border-bottom: 1px solid var(--gray-200); */
}

.modal-header h3 {
    margin: 0;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--gray-900);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-message {
    padding: 15px 20px;
    margin-top: 15px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.modal-message-success {
    background: #d1f2db;
    color: #166534;
    border: 1px solid #86efac;
}

.modal-message-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.transfer-hint {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.transfer-amount-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.transfer-amount-row .form-control {
    flex: 1;
}

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--gray-600);
}

.transfer-preview {
    margin-top: 12px;
    padding: 12px;
    border-radius: 6px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    font-size: 14px;
    line-height: 1.6;
}

.transfer-preview-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.transfer-rate {
    margin-top: 6px;
    font-size: 12px;
    color: var(--gray-600);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    background-color: white;
    color: var(--gray-900);
}

.form-control option {
    background-color: white;
    color: var(--gray-900);
}

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

/* Users Table */
.users-table {
    overflow-x: auto;
    margin-bottom: 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--gray-100);
}

table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
}

table tr:hover {
    background: var(--gray-50);
}

body.user-shell table thead,
body.user-shell table thead th {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--user-muted) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

body.user-shell table th {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--user-muted) !important;
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

body.user-shell table td {
    color: var(--user-muted-strong) !important;
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

body.user-shell table tr:hover,
body.user-shell table tr:hover td {
    background: rgba(255, 255, 255, 0.03) !important;
    color: var(--user-muted-strong) !important;
}

/* Proxies Table in Modal */
.proxies-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.proxies-table thead {
    background: var(--gray-100);
}

.proxies-table th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
}

.proxies-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--gray-200);
}

.proxies-table code {
    background: var(--gray-50);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

table code {
    background: var(--gray-100);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
}

table td.balance {
    font-weight: 600;
    color: var(--primary);
    font-family: monospace;
}

.balance-value {
    font-weight: 600;
    color: var(--primary);
    font-family: monospace;
    font-size: 16px;
}

.proxy-credentials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 12px;
}

@media (max-width: 1200px) {
    .proxy-credentials-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.proxy-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.proxy-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}

.proxy-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.proxy-endpoint {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.proxy-endpoint:last-child {
    margin-bottom: 0;
}

.endpoint-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.endpoint-url {
    background-color: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--gray-900);
    word-break: break-all;
    display: block;
    overflow-x: auto;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.spinner {
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status.active {
    background: #dcfce7;
    color: var(--success);
}

.status.inactive {
    background: #fee2e2;
    color: var(--danger);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.status-subscribed {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.status-not-subscribed {
    background: #fee2e2;
    color: #dc2626;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--gray-500);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination-link {
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    text-decoration: none;
    color: var(--primary);
    transition: all 0.3s;
}

.pagination-link:hover {
    background: var(--primary);
    color: white;
}

.pagination-current {
    padding: 8px 12px;
    background: var(--primary);
    color: white;
    border-radius: 4px;
}

/* User Detail */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-200);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.detail-section {
    background: var(--gray-50);
    padding: 20px;
    border-radius: 8px;
}

.detail-section h3 {
    margin-bottom: 15px;
    color: var(--primary);
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.detail-row label {
    font-weight: 600;
    min-width: 100px;
    color: var(--gray-700);
}

.detail-row span {
    flex: 1;
    color: var(--gray-900);
}

.detail-row code {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
}

.edit-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.edit-row input {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        height: auto;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .navbar-menu {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-link {
        padding: 10px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    table {
        font-size: 12px;
    }
    
    table th, table td {
        padding: 8px;
    }
}

/* Stats Container */
#stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px 0;
    min-height: 280px;
}

.stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s;
    text-align: center;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.stat-card-placeholder .stat-value {
    opacity: 0.55;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
    fill: white;
    color: white;
}

.stat-content {
    flex: 1;
    width: 100%;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--gray-900);
    line-height: 1.2;
    word-break: break-word;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 8px;
}

@media (max-width: 1024px) {
    #stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    #stats-container {
        grid-template-columns: 1fr;
    }
}

/* SVG Icon sizes */
svg.icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    fill: currentColor;
}

/* Proxy Configurator Styles */
.configurator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.configurator-form, .configurator-results {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.configurator-form h2, .configurator-results h2 {
    font-size: 20px;
    margin-bottom: 30px;
    color: var(--gray-900);
}

.form-section {
    margin-bottom: 25px;
}

.form-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--gray-900);
    font-size: 14px;
}

.form-section small {
    display: block;
    color: var(--gray-500);
    margin-top: 5px;
    font-size: 12px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

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

.form-control-sm {
    padding: 8px 10px;
    font-size: 13px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.radio-option:hover {
    background-color: var(--gray-100);
}

.radio-option input[type="radio"] {
    cursor: pointer;
    margin-right: 12px;
    width: 16px;
    height: 16px;
}

.radio-option span {
    font-size: 14px;
    user-select: none;
}

.config-group {
    margin-bottom: 15px;
}

.config-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    padding: 4px 0;
}

.error-message::before {
    content: "";
}

.config-group input.error {
    border-color: #dc3545 !important;
    background-color: #fff5f5;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
}

.suggestion-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #f5f5f5;
}

.suggestion-item-selected {
    background-color: #e3f2fd;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item-login {
    font-weight: 500;
    color: #333;
}

.suggestion-item-email {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.suggestion-item-text {
    font-weight: 500;
    color: #333;
}

.suggestion-item-normalized {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
    font-family: monospace;
}

.suggestion-item-empty {
    padding: 10px 12px;
    color: #999;
    text-align: center;
    font-style: italic;
}

.btn-large {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    margin-top: 10px;
}

.btn-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

.icon-small {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    fill: currentColor;
}

/* Results Panel */
.result-info {
    background: var(--gray-100);
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.result-info-item {
    font-size: 14px;
    margin-bottom: 8px;
}

.result-info-item:last-child {
    margin-bottom: 0;
}

.result-info-item strong {
    color: var(--gray-900);
    font-weight: 600;
}

.result-text-container {
    margin-bottom: 20px;
}

.result-textarea {
    width: 100%;
    height: 400px;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    resize: vertical;
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.result-actions button {
    flex: 1;
    min-width: 120px;
}

.copy-feedback {
    background: var(--success);
    color: white;
    padding: 12px;
    border-radius: 4px;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
}

/* Edit group for inline editing */
.edit-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.telegram-view {
    display: flex;
    gap: 10px;
    align-items: center;
}

.telegram-edit {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
    flex-direction: column;
}

.telegram-edit > div:first-of-type {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.email-view {
    display: flex;
    gap: 10px;
    align-items: center;
}

.email-edit {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-wrap: wrap;
    flex-direction: column;
}

.edit-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 14px;
}

.edit-input:disabled {
    background-color: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

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

.edit-input::placeholder {
    color: var(--gray-400);
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    height: auto;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status message for inline feedback */
.status-message {
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
}

.status-message.status-success {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
}

.status-message.status-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.status-message.status-loading {
    background: #eff6ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

/* Responsive */
@media (max-width: 1200px) {
    .configurator-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .configurator-form, .configurator-results {
        padding: 20px;
    }
    
    .radio-group {
        gap: 10px;
    }
    
    .radio-option {
        padding: 8px;
    }
    
    .result-textarea {
        height: 300px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions button {
        flex: none;
        width: 100%;
    }
}

/* Copy Button Styles */
.proxy-url-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-copy-icon {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-copy-icon.copied {
    opacity: 1;
}

.proxy-url-container:hover .btn-copy-icon {
    opacity: 1;
}

.copy-icon {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.btn-copy-icon:hover .copy-icon {
    color: var(--primary-dark);
}

.grant-unlimited-modal {
    max-width: 720px;
    width: min(720px, 94vw);
}

.grant-trial-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    background: rgba(59, 130, 246, 0.08);
    font-size: 13px;
    color: var(--gray-700);
}

.grant-trial-banner code {
    font-size: 12px;
}

.grant-trial-quota {
    margin-left: auto;
    font-weight: 600;
}

.grant-trial-note {
    margin-top: 4px;
}

.grant-configurator-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.grant-data-plan-section {
    margin-bottom: 16px;
}

.grant-data-plan-group .grant-data-plan-btn {
    min-width: 140px;
}

.grant-config-field label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
}

.grant-configurator-section {
    margin-bottom: 16px;
}

.grant-config-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.grant-period-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.grant-period-btn {
    flex: 1 1 0;
    min-width: 72px;
    border: 1px solid var(--gray-300);
    background: var(--gray-50);
    color: var(--gray-700);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.grant-period-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary-dark);
}

.grant-period-btn.active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-dark);
}

.grant-period-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.grant-quantity-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.grant-qty-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.grant-stock-badge {
    margin-left: auto;
    font-size: 12px;
    color: var(--gray-500);
}

.grant-quantity-slider {
    width: 100%;
    accent-color: var(--primary);
}

.grant-qty-hint-error {
    color: #b91c1c;
    font-weight: 600;
}

.grant-data-cap-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: #b45309;
}

.grant-configurator-footer {
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

.grant-price-block {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.grant-price-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-900);
}

.grant-price-period {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 600;
}

.grant-provider-cost {
    width: 100%;
    margin-top: 2px;
}

.grant-unlimited-footer {
    justify-content: space-between;
}

@media (max-width: 720px) {
    .grant-configurator-filters {
        grid-template-columns: 1fr;
    }
}
