/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* App Loader */
.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.app-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-text {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Tool Lock Styles */
.tool-locked-message {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.tool-locked-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
}

.tool-locked-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.tool-locked-content h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 12px;
    font-weight: 600;
}

.tool-locked-content p {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
}

.sidebar-item.locked {
    cursor: not-allowed !important;
}

.sidebar-item .lock-icon {
    margin-left: auto;
    font-size: 14px;
    opacity: 0.6;
}

/* Modal Overlay Styles */
.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: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-dialog {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.modal-close:hover {
    background-color: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.form-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-info {
    background-color: #e7f3ff;
    color: #0066cc;
    border: 1px solid #b3d9ff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    margin: 0;
}

/* Reset body for app-layout */
body:has(.app-layout) {
    padding: 0;
    overflow-x: hidden;
}

.container {
    max-width: 1900px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Красивые выпадающие списки */
.custom-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    color: #2d3748;
    font-size: 14px;
    padding: 12px 40px 12px 12px;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%232d3748" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
}

.custom-select:hover {
    border-color: #667eea;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

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

.custom-select option {
    background-color: #ffffff;
    color: #2d3748;
    padding: 10px;
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 100%;
    margin: 0 auto;
}

/* Sections */
section {
    margin-bottom: 30px;
}

/* Connection Status */
.connection-status-section {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.connection-status.disconnected {
    background: rgba(255, 82, 82, 0.2);
    border: 2px solid #ff5252;
    color: #c62828;
}

.connection-status.connected {
    background: rgba(76, 175, 80, 0.2);
    border: 2px solid #4caf50;
    color: #2e7d32;
}

.connection-status.connecting {
    background: rgba(255, 193, 7, 0.2);
    border: 2px solid #ffc107;
    color: #f57f17;
}

.status-icon {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.connection-status.connected .status-icon {
    animation: none;
}

/* Profiles Section */
.profiles-section {
    background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.profiles-section h2 {
    color: #333;
    margin-bottom: 20px;
}

.profile-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: flex-end;
}

.profile-controls .form-group {
    flex: 1;
    margin-bottom: 0;
}

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

.profile-buttons .btn {
    white-space: nowrap;
}

/* Army Config Section */
.army-config-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    color: white;
}

.army-config-section h2 {
    color: white;
    margin-bottom: 20px;
}

.army-info-box {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.army-info-box p {
    margin: 0;
    font-size: 0.95rem;
}

/* Precision Mode Checkbox */
.precision-mode-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
}

.precision-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
}

.precision-checkbox input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.precision-checkbox .checkbox-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.precision-checkbox .checkbox-label strong {
    color: #856404;
    font-size: 1rem;
}

.precision-checkbox .checkbox-label small {
    color: #856404;
    opacity: 0.8;
    font-size: 0.85rem;
}

.search-section {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.search-section h2 {
    color: white;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.search-section .form-group label {
    color: white;
}

.search-section input[type="number"],
.search-section input[type="text"] {
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.9);
}

.btn-search {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    width: 100%;
    font-size: 1.2rem;
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(56, 239, 125, 0.5);
}

section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.85rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex: 1;
    font-size: 1.1rem;
}

.btn-full-scan {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff0000 100%);
    color: white;
    flex: 2;
    font-size: 1.1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.btn-full-scan:hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 5px 20px rgba(255, 0, 0, 0.5);
}

.btn-danger {
    background: #dc3545;
    color: white;
    width: 100%;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    margin-left: 10px;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    flex: 1;
    font-size: 1rem;
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(23, 162, 184, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #333;
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    flex: 1;
    font-size: 1rem;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

/* Status Section */
.status-section {
    min-height: 50px;
}

.status-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.status-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.hidden {
    display: none !important;
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-weight: 600;
    color: #667eea;
}

/* Stats Section */
.stats-section {
    margin-bottom: 30px;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.stat-value {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Filters Panel */
.filters-panel {
    margin-bottom: 20px;
}

.filters-content {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
    border: 2px solid #667eea;
}

.filters-content h3 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.filters-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.filters-section h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 10px;
}

.filters-section .filter-group label {
    color: white;
}

.filters-section .filter-group input,
.filters-section .filter-group select {
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.95);
}

.filters-section .filter-group input:focus,
.filters-section .filter-group select:focus {
    border-color: rgba(255, 255, 255, 0.8);
    background: white;
}

.filters-section .checkbox-group-compact label {
    color: white;
}

.filters-section .checkbox-group-compact label:hover {
    color: rgba(255, 255, 255, 0.9);
}

.filters-section .checkbox-group label {
    color: white;
}

.filters-section .filter-group-wide > label {
    color: white;
}

.filters-section .range-inputs span {
    color: white;
    font-weight: 600;
}

.filters-section .filter-actions .btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group-compact {
    grid-column: span 1;
}

.filter-group-wide {
    grid-column: 1 / -1;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
    font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
    padding: 6px 8px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.range-inputs input {
    flex: 1;
    min-width: 0;
    max-width: 80px;
}

.range-inputs span {
    font-weight: bold;
    color: #667eea;
    font-size: 0.85rem;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
    margin-top: 4px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 0.85rem;
    white-space: nowrap;
    min-width: 0;
}

.checkbox-group label:hover {
    background: rgba(102, 126, 234, 0.1);
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Специальные стили для секции типов оазисов */
.checkbox-group-oasis-types {
    grid-template-columns: repeat(4, 1fr);
}

.checkbox-group-oasis-types label {
    white-space: nowrap;
}

/* Компактная группа чекбоксов */
.checkbox-group-compact {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.checkbox-group-compact label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
}

.checkbox-group-compact label:hover {
    color: #333;
}

.checkbox-group-compact input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Обеспечиваем видимость иконок */
.checkbox-group .resource-icon,
.checkbox-group .animal-filter-icon {
    flex-shrink: 0;
    display: inline-block;
}

.filter-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin-right: 6px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.filter-actions .btn {
    flex: 1;
    max-width: 200px;
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Results Section */
.results-section {
    animation: fadeIn 0.5s;
}

.results-section h2 {
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Fresh data highlight */
tbody tr.fresh-data {
    background: #d4edda !important;
    border-left: 4px solid #28a745;
    height: 65px !important;
    max-height: 65px !important;
    min-height: 65px !important;
}

tbody tr.fresh-data:hover {
    background: #c3e6cb !important;
}

.old-data {
    opacity: 0.7;
}

/* Стили для оазисов под атакой */
.under-attack {
    background: #f8f9fa !important;
    opacity: 0.6;
    position: relative;
}

.under-attack:hover {
    background: #e9ecef !important;
    opacity: 0.75;
}

.attack-timer {
    display: inline-block;
    color: #dc3545;
    font-weight: bold;
    padding: 4px 8px;
    background: #fff3cd;
    border-radius: 4px;
    font-size: 0.85rem;
}

.btn-attack {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-attack:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-attack:active {
    transform: translateY(0);
}

.btn-cancel-attack {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 8px;
    transition: all 0.3s ease;
}

.btn-cancel-attack:hover {
    background: #c82333;
    transform: scale(1.1);
}

.btn-cancel-attack:active {
    transform: scale(0.95);
}

.actions-cell {
    text-align: center;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.updated-time {
    font-size: 0.9rem;
    color: #666;
}

.updated-time.fresh {
    color: #28a745;
    font-weight: 600;
}

/* Selection Panel */
.selection-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-height: 50px;
    transition: opacity 0.3s ease, min-height 0.3s ease;
    flex-wrap: wrap;
    gap: 10px;
}

/* Когда ничего не выбрано - делаем панель менее заметной, но видимой */
.selection-panel.hidden {
    opacity: 0.3;
    min-height: 40px;
    padding: 8px 15px;
}

.selection-panel.hidden .selection-actions {
    pointer-events: none;
}

.selection-panel.hidden .selection-info {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Army Settings Panel */
.army-settings-panel {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.army-settings-panel h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.army-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.army-inputs .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.army-inputs input {
    width: 100%;
    padding: 10px;
    border: 2px solid white;
    border-radius: 5px;
    font-size: 1rem;
}

.army-info {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.selection-info {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
}

.selection-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.selection-panel .btn {
    margin-top: 0;
    padding: 6px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Checkbox column */
.checkbox-col {
    width: 50px;
    text-align: center;
}

.checkbox-col input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Selected row */
tr.selected {
    background: #e3f2fd !important;
    border-left: 4px solid #2196f3;
}

tr.selected:hover {
    background: #bbdefb !important;
}

/* Checkbox in table */
td input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Reward cell */
.reward-cell {
    font-weight: 600;
    text-align: right;
}

.reward-cell.high-reward {
    color: #28a745;
    background: #d4edda;
}

.reward-cell.medium-reward {
    color: #856404;
    background: #fff3cd;
}

/* Efficiency cell */
.efficiency-cell {
    font-size: 0.8rem;
    vertical-align: middle;
    line-height: 1.2;
    height: 65px;
    padding: 2px 15px;
}

.efficiency-score {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0;
    line-height: 1;
}

.efficiency-score.profit {
    color: #28a745;
}

.efficiency-score.loss {
    color: #dc3545;
}

.efficiency-details {
    font-size: 0.65rem;
    color: #666;
    line-height: 1;
    margin-top: 1px;
}

.losses-cell {
    color: #dc3545;
    font-size: 0.75rem;
    line-height: 1.2;
    height: 65px;
    padding: 2px 15px;
    vertical-align: middle;
}

.losses-cell br {
    display: none;
}

.losses-cell > * {
    display: block;
    line-height: 1.1;
    margin: 0;
}

.no-losses {
    height: 65px;
    padding: 2px 15px;
    vertical-align: middle;
}

.loss-cost {
    font-size: 0.8rem;
    color: #856404;
}

.no-losses {
    color: #28a745;
    font-weight: 600;
}

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

#oasis-count {
    color: #667eea;
    font-weight: bold;
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.table-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #ddd;
}

/* Table */
table {
    width: 100%;
    min-width: 1600px;
    border-collapse: collapse;
    background: white;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

td {
    padding: 8px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    height: 65px;
    max-height: 65px;
    min-height: 65px;
    box-sizing: border-box;
    overflow: hidden;
    line-height: 1.2;
}

td:last-child {
    padding-right: 30px;
}

tbody tr {
    height: 65px;
    max-height: 65px;
    display: table-row;
    line-height: 1;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr.weak-oasis {
    background: #d4edda;
    height: 65px !important;
    max-height: 65px !important;
    min-height: 65px !important;
}

tbody tr.weak-oasis:hover {
    background: #c3e6cb;
}


.coords {
    font-weight: 600;
    color: #667eea;
}

.bonus-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.bonus-wood { background: #8b4513; color: white; }
.bonus-clay { background: #cd853f; color: white; }
.bonus-iron { background: #708090; color: white; }
.bonus-crop { background: #228b22; color: white; }

.troops-total {
    font-weight: 600;
}

.troops-total.low { color: #28a745; }
.troops-total.medium { color: #ffc107; }
.troops-total.high { color: #dc3545; }

.troops-detail {
    font-size: 0.9rem;
    color: #666;
}

/* Footer */
footer {
    margin-top: 30px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.footer-stats {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

#footer-oasis-count {
    font-weight: bold;
    color: #667eea;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-content h2 {
    margin: 10px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.loading-content p {
    margin: 10px 0;
    font-size: 1rem;
    opacity: 0.9;
}

/* Fix status-section overlap */
.status-section {
    margin: 20px 0;
    min-height: 50px;
    clear: both;
}

/* Fix oasis count visibility */
#oasis-count {
    color: #ffffff !important;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Profile Gear Button (Minimal UI) */
.profiles-section-minimal {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 20px 0;
    padding-right: 20px;
}

.profile-gear-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.profile-gear-btn:hover {
    opacity: 0.7;
}

.profile-gear-btn:active {
    opacity: 0.5;
}

/* Modal Window */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.3rem;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
    background: white;
    border-radius: 0 0 12px 12px;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.modal-actions .btn {
    flex: 1;
    min-width: 120px;
}

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

#page-info {
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
    min-width: 150px;
    text-align: center;
}

.pagination .btn {
    min-width: 120px;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    min-width: 300px;
}

.toast.success {
    border-left: 4px solid #27ae60;
}

.toast.error {
    border-left: 4px solid #e74c3c;
}

.toast.info {
    border-left: 4px solid #3498db;
}

.toast.warning {
    border-left: 4px solid #f39c12;
}

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

.toast-content {
    flex: 1;
    color: #2c3e50;
}

.toast-message {
    font-size: 0.95rem;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #95a5a6;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #2c3e50;
}

/* Toast Progress Bar */
.toast-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.toast-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Анимированный прогресс для неопределённого состояния */
.progress-toast .toast-progress-fill[style*="width: 0%"] {
    width: 100% !important;
    animation: indeterminateProgress 1.5s ease-in-out infinite;
    background: linear-gradient(90deg, transparent 0%, #667eea 50%, transparent 100%);
    background-size: 200% 100%;
}

@keyframes indeterminateProgress {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-secondary {
        margin-left: 0;
        width: 100%;
    }
}

/* ========================================
   TABS NAVIGATION (Main + Sub-tabs)
   ======================================== */

/* Главные вкладки */
.main-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid transparent;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-shadow: none;
}

/* Подвкладки (для Attack Manager) */
.sub-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px;
    border-radius: 8px;
}

.sub-tab-btn {
    flex: 1;
    padding: 10px 15px;
    font-size: 1rem;
    font-weight: 500;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 6px;
    color: #667eea;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sub-tab-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

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

/* Контент вкладок */
.tab-content {
    display: none;
    max-width: 1900px;
    margin: 0 auto;
}

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

.subtab-content {
    display: none;
}

.subtab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ========================================
   ELEPHANT SCANNER STYLES
   ======================================== */

#tab-elephant-scanner {
    min-height: 400px;
}

#tab-elephant-scanner h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

#tab-elephant-scanner .subtitle {
    color: #666;
    margin-bottom: 20px;
}

#elephant-results-section h2 {
    color: #2c3e50;
}

/* ========================================
   ATTACK MANAGER STYLES
   ======================================== */

#tab-attack-manager {
    min-height: 400px;
}

#tab-attack-manager h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

#tab-attack-manager .subtitle {
    color: #666;
    margin-bottom: 20px;
}

#tab-attack-manager h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

/* Форма добавления атаки */
.attack-form {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.attack-form textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.attack-form textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Таблицы атак */
#active-attacks-table,
#attack-history-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#active-attacks-table thead,
#attack-history-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#active-attacks-table th,
#attack-history-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

#active-attacks-table td,
#attack-history-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

#active-attacks-table tbody tr:hover,
#attack-history-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* Таймер обратного отсчёта */
.countdown-timer {
    font-weight: bold;
    font-size: 1.1em;
    color: #667eea;
}

.countdown-timer.urgent {
    color: #e74c3c;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Пустые сообщения */
.empty-message {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1rem;
}

.empty-message.hidden {
    display: none;
}

/* Кнопки действий в таблице */
.action-btn {
    padding: 6px 12px;
    font-size: 0.9rem;
    margin-right: 5px;
}

.action-btn.complete {
    background: #27ae60;
}

.action-btn.complete:hover {
    background: #229954;
}

.action-btn.delete {
    background: #e74c3c;
}

.action-btn.delete:hover {
    background: #c0392b;
}

/* Стили для плашек расстояния (унифицированный синий цвет) */
.distance-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
    font-size: 0.9em;
    background: #3498db;
    color: white;
    min-width: 45px;
    text-align: center;
}

/* Стили для плашек неактивности (4 градации) */
.inactive-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
    font-size: 0.9em;
    color: white;
    min-width: 45px;
    text-align: center;
}

.inactive-less-24 {
    background: #3498db; /* Синий - меньше 24ч */
}

.inactive-24-48 {
    background: #f1c40f; /* Желтый - 24-48ч */
}

.inactive-48-72 {
    background: #e67e22; /* Оранжевый - 48-72ч */
}

.inactive-more-72 {
    background: #e74c3c; /* Красный - больше 72ч */
}

/* Стили для ссылок на координаты */
.coords-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.coords-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* ========================================
   Timers Section Styles
   ======================================== */

.timer-form-container {
    transition: all 0.3s ease;
    overflow: hidden;
}

.quick-time-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #f97316 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.quick-time-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 25px rgba(168, 85, 247, 0.5);
}

.quick-time-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.quick-task-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.quick-task-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.5);
}

.quick-task-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.timer-item {
    position: relative;
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #f97316 100%);
    padding: 1px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.15);
}

.timer-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

.timer-item.alert {
    animation: pulse-glow 1s infinite;
}

.timer-item-inner {
    background: white;
    border-radius: 7px;
    padding: 10px 12px;
    position: relative;
    overflow: hidden;
}

.timer-item-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.03) 0%, rgba(236, 72, 153, 0.03) 50%, rgba(249, 115, 22, 0.03) 100%);
    pointer-events: none;
}

.timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.timer-task-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.timer-controls {
    display: flex;
    gap: 4px;
}

.timer-control-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.timer-control-btn:hover {
    transform: scale(1.15);
}

.timer-control-btn:active {
    transform: scale(0.95);
}

.timer-control-btn.pause {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: white;
}

.timer-control-btn.pause:hover {
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}

.timer-control-btn.play {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: white;
}

.timer-control-btn.play:hover {
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}

.timer-control-btn.reset {
    background: white;
    color: #a855f7;
    border: 2px solid #a855f7;
}

.timer-control-btn.reset:hover {
    background: #a855f7;
    color: white;
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.3);
}

.timer-control-btn.delete {
    background: white;
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

.timer-control-btn.delete:hover {
    background: #e74c3c;
    color: white;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
}

.timer-progress-container {
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.timer-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.timer-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #a855f7 0%, #ec4899 50%, #f97316 100%);
    transition: width 1s linear;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.4);
}

.timer-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

.timer-progress-fill.alert {
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
    animation: pulse-progress 0.5s infinite;
}

.timer-time-display {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #1a202c;
    margin: 6px 0;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

.timer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #6b7280;
    position: relative;
    z-index: 1;
}

.timer-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
    font-weight: 600;
    font-size: 10px;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(231, 76, 60, 0.3);
    }
    50% {
        box-shadow: 0 15px 50px rgba(231, 76, 60, 0.6);
    }
}

@keyframes pulse-progress {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* ========================================
   SIDEBAR NAVIGATION (New Layout)
   ======================================== */

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Background extends full height even if content is short */
.app-layout::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: -1;
}

/* Sidebar */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Sidebar Header */
.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
}

.sidebar-logo-icon {
    font-size: 1.8rem;
}

.sidebar-logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 15px 0;
    overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-section {
    margin-bottom: 10px;
}

.sidebar-section-title {
    padding: 10px 20px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    position: relative;
}

.sidebar-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    border-radius: 0 4px 4px 0;
    transition: all 0.2s ease;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.sidebar-item:hover::before {
    background: rgba(102, 126, 234, 0.5);
}

.sidebar-item.active {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.3) 0%, rgba(118, 75, 162, 0.15) 100%);
    color: white;
}

.sidebar-item.active::before {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.sidebar-item-icon {
    font-size: 1.3rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-item-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-item-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-footer-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.sidebar.collapsed + .main-wrapper {
    margin-left: 0;
}

/* Top Header Bar */
.top-header {
    background: transparent;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
}

.top-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.burger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: #667eea;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.4rem;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.burger-btn:hover {
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.burger-btn:active {
    transform: translateY(0);
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.page-title-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.top-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.header-select {
    padding: 10px 14px;
    border-radius: 12px;
    border: none;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.95);
    color: #2d3748;
    min-width: 160px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    font-weight: 500;
}

.header-select:hover {
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.header-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3), 0 4px 15px rgba(0, 0, 0, 0.2);
    background: white;
}

.header-select option {
    background: white;
    color: #2d3748;
}

.header-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.settings-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.settings-btn:hover {
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

/* Content Container */
.content-container {
    flex: 1;
    padding: 25px;
}

/* Sidebar Overlay (for mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive Sidebar */
/* Desktop: sidebar can be collapsed */
.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar.collapsed + .sidebar-overlay + .main-wrapper,
.sidebar.collapsed ~ .main-wrapper {
    margin-left: 0;
}

/* Mobile: sidebar is overlay style */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        display: block;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 10px 15px;
    }
    
    .page-title {
        font-size: 1.1rem;
    }
    
    .content-container {
        padding: 15px;
    }
    
    .header-select {
        min-width: 120px;
        font-size: 0.85rem;
    }
    
    .top-header-right {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        min-width: 100%;
    }
    
    .page-title-text {
        display: none;
    }
    
    .header-label {
        display: none;
    }
}

/* Hide old main-tabs on new layout */
.app-layout .main-tabs {
    display: none;
}

/* Fix container in new layout */
.app-layout .container {
    max-width: 100%;
    padding: 0;
    margin: 0;
}

/* Hide old header inside container, but not new top-header */
.app-layout .container > header {
    display: none;
}

.app-layout .profiles-section-minimal {
    display: none;
}

/* Tab content in new layout */
.app-layout .tab-content {
    max-width: 1900px;
    margin: 0 auto;
}

.app-layout .tab-content.active {
    display: block;
}

 
 / *   U p d a t e   t i m e   i n d i c a t o r s   * /  
 . u p d a t e - f r e s h   {  
         c o l o r :   # 2 7 a e 6 0 ;  
         f o n t - w e i g h t :   5 0 0 ;  
 }  
  
 . u p d a t e - o l d   {  
         c o l o r :   # e 7 4 c 3 c ;  
         f o n t - w e i g h t :   5 0 0 ;  
 }  
  
 / *   A n i m a l   i c o n s   i n   t a b l e   c e l l s   * /  
 t d   . a n i m a l - i c o n   {  
         v e r t i c a l - a l i g n :   m i d d l e ;  
         m a r g i n - r i g h t :   4 p x ;  
 }  
 