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

:root {
    /* Светлая тема (по умолчанию) */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9fafb;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
    --navbar-gradient: #ffffff;
}

/* Темная тема отключена */

html {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 17px; /* Увеличен на 1px с базового 16px */
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Navbar */
.navbar {
    background: #ffffff !important;
    color: var(--text-primary);
    padding: 1rem 0;
    box-shadow: 0 2px 4px var(--shadow);
    width: 100%;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
    gap: 2rem;
}

.navbar h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-menu a:hover {
    opacity: 0.8;
}

.nav-logout {
    margin-left: auto;
}

.nav-logout a {
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-logout a:hover {
    opacity: 0.8;
}

/* Стили для переключения темы удалены */

/* Main content */
main {
    flex: 1;
    padding: 2rem 0;
    width: 100%;
    max-width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

main.full-width-main {
    padding: 0;
    height: 100%;
    overflow: hidden;
}

/* Dashboard */
.dashboard {
    width: 100%;
}

.dashboard h2 {
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.recent-licenses {
    margin-top: 2rem;
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    transition: background-color 0.3s ease;
}

.recent-licenses h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.recent-licenses .data-table {
    margin-top: 1rem;
}

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

.stat-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    transition: background-color 0.3s ease;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.stat-number.active {
    color: #10b981;
}

.stat-number.expired {
    color: #ef4444;
}

.actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

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

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

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

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-small:hover {
    background: #5568d3;
}

.btn-small.btn-delete {
    background: #dc2626;
    border: 1px solid #991b1b;
}

.btn-small.btn-delete:hover {
    background: #991b1b;
    border-color: #7f1d1d;
}

.btn-extend {
    background: #10b981;
}

.btn-extend:hover {
    background: #059669;
}

.btn-activate {
    background: #10b981;
    color: white;
}

.btn-activate:hover {
    background: #059669;
}

.btn-delete {
    background: #dc2626;
    color: white;
    border: 2px solid #991b1b;
}

.btn-delete:hover {
    background: #991b1b;
    border-color: #7f1d1d;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.btn-icon {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 0.5rem;
}

/* Tables */
.data-table {
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px var(--shadow);
    transition: background-color 0.3s ease;
}

.data-table thead {
    background: var(--bg-tertiary);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tr:hover {
    background: var(--bg-tertiary);
}

.data-table tr.expired-row {
    background: #fef2f2;
}

.data-table tr.inactive-row {
    background: #fffbeb;
}

.data-table tr.blocked-row {
    background: #f3e8ff;
    opacity: 0.85;
}

.api-key {
    font-family: 'Courier New', monospace;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Forms */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    width: 100%;
    transition: background-color 0.3s ease;
}

.form-container h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.license-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s, background-color 0.3s, color 0.3s;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group select {
    cursor: pointer;
}

/* Стили для полей редактирования в карточке клиента */
.form-input {
    width: auto;
    min-width: 250px;
    max-width: 350px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s, background-color 0.3s, color 0.3s;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    display: inline-block;
    margin-bottom: 0.5rem;
    margin-right: 0.5rem;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input select {
    cursor: pointer;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Result container */
.result-container {
    background: #f0fdf4;
    border: 2px solid #10b981;
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
}

.result-container h3 {
    color: #065f46;
    margin-bottom: 1.5rem;
}

.license-result {
    margin-bottom: 1.5rem;
}

.api-key-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.api-key-display code {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    color: var(--text-primary);
}

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.alert-warning {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.alert-danger {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
    margin-bottom: 1rem;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

/* Search */
.search-container {
    margin-bottom: 1.5rem;
    padding: 0 2rem;
    flex-shrink: 0;
}

.search-form {
    width: 100%;
}

.search-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-search {
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

.btn-search:hover {
    background: #5568d3;
}

.btn-clear {
    padding: 0.75rem 1.5rem;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

.btn-clear:hover {
    background: #4b5563;
}

/* Tabs */
.tabs-container {
    margin-bottom: 1.5rem;
    flex-shrink: 0;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    padding: 0 2rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s;
    margin-bottom: -2px;
    position: relative;
}

.tab-btn:hover {
    color: #667eea;
    background: #f9fafb;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: transparent;
}

.tab-btn.active:hover {
    background: transparent;
}

/* Фильтр по плагину */
.plugin-filter-container {
    margin: 1rem 0;
    padding: 0 2rem;
}

.plugin-filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.plugin-tab-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.plugin-tab-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

.plugin-tab-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.plugin-tab-btn.active:hover {
    background: #5568d3;
    border-color: #5568d3;
}

.page-header h2 {
    margin: 0;
}

/* Licenses page */
.licenses-page {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: background-color 0.3s ease;
}

.full-width-main {
    max-width: 100%;
    padding: 0;
}

.full-width-main .licenses-page {
    margin: 0;
    border-radius: 0;
    padding: 2rem 0;
    width: 100%;
    height: 100%;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.full-width-main .page-header {
    padding: 0 2rem;
    margin-bottom: 2rem;
    flex-shrink: 0;
}

.full-width-main .table-container {
    padding: 0 2rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 0;
}

main.full-width-container {
    padding: 0;
    max-width: 100%;
}

main.full-width-container .container {
    padding: 0;
    max-width: 100%;
}

.table-container {
    overflow-x: auto;
    overflow-y: auto;
    width: 100%;
    margin: 0;
    flex: 1;
    min-height: 0;
}

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

.data-table th,
.data-table td {
    white-space: nowrap;
    padding: 1rem 1.5rem;
}

.data-table th:first-child,
.data-table td:first-child {
    padding-left: 2rem;
}

.data-table th:last-child,
.data-table td:last-child {
    padding-right: 2rem;
}

.full-width-main .table-container {
    padding: 0 2rem;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.days-remaining {
    color: #10b981;
    font-weight: 600;
}

.days-expired {
    color: #ef4444;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

/* License detail */
.license-detail {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow);
    width: 100%;
    transition: background-color 0.3s ease;
}

.detail-card {
    margin-top: 2rem;
}

.detail-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

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

.detail-item label {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item p {
    color: var(--text-primary);
    font-size: 1rem;
}

.detail-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Footer */
footer {
    background: #1f2937;
    color: white;
    padding: 1.5rem 0;
    margin-top: auto;
    text-align: center;
    width: 100%;
    flex-shrink: 0;
}

footer .container {
    max-width: 100%;
}

footer p {
    margin: 0;
    color: #9ca3af;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .table-container {
        overflow-x: scroll;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-actions {
        flex-direction: column;
    }
}

/* Toast уведомления */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    pointer-events: auto;
    border-left: 4px solid;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: pre-line;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Типы Toast */
.toast-success {
    border-left-color: #10b981;
    background: var(--bg-secondary);
}

.toast-error {
    border-left-color: #ef4444;
    background: var(--bg-secondary);
}

.toast-warning {
    border-left-color: #f59e0b;
    background: var(--bg-secondary);
}

.toast-info {
    border-left-color: #667eea;
    background: var(--bg-secondary);
}

/* Адаптивность для Toast */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
}

/* Пагинация */
.pagination-container {
    margin-top: 2rem;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pagination-info-only {
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.per-page-select {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.3s;
}

.per-page-select:hover {
    border-color: #667eea;
}

.per-page-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.pagination-btn:hover:not(.disabled) {
    background: var(--bg-tertiary);
    border-color: #667eea;
    color: #667eea;
}

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

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.pagination-page {
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-page:hover {
    background: var(--bg-tertiary);
    border-color: #667eea;
}

.pagination-page.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: 600;
}

.pagination-page.active:hover {
    background: #5568d3;
    border-color: #5568d3;
}

.pagination-ellipsis {
    padding: 0 0.5rem;
    color: var(--text-secondary);
    user-select: none;
}

/* Адаптивность для пагинации */
@media (max-width: 768px) {
    .pagination-container {
        padding: 1rem;
    }
    
    .pagination-info {
        flex-direction: column;
        text-align: center;
    }
    
    .pagination {
        gap: 0.25rem;
    }
    
    .pagination-page {
        min-width: 2rem;
        height: 2rem;
        font-size: 0.85rem;
    }
    
    .pagination-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
}
