:root {
    --primary-color: #4a6bff;
    --primary-hover: #3a5bef;
--sidebar-width: 180px;
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
    --sidebar-active: var(--primary-color);
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --text-color: #333;
    --light-gray: #f8f9fa;
    --border-color: #e0e0e0;
}
/* Стили для страницы авторизации */

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%),
        url('./login-bg.jpg') center/cover;
    z-index: 0;
}
.background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

.background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('./login-bg.jpg') no-repeat;
    background-size: cover;
    z-index: -1;
}

.login-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    width: 400px;
    max-width: 90vw;
    animation: slideUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    opacity: 0;
    transform: translate(-50%, -40%);
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.login-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, 
        rgba(74, 107, 255, 0.6), 
        rgba(58, 91, 239, 0.3), 
        transparent 70%);
    border-radius: 22px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.login-container:hover::before {
    opacity: 1;
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2d3748;
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #4a6bff, #3a5bef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#loginForm label {
    position: relative;
    display: block;
}

#loginForm input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    background: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

#loginForm input:focus {
    outline: none;
    border-color: #4a6bff;
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.1),
                0 4px 12px rgba(74, 107, 255, 0.1);
    transform: translateY(-2px);
}

#loginForm input::placeholder {
    color: #a0aec0;
    transition: all 0.3s ease;
}

#loginForm input:focus::placeholder {
    transform: translateX(10px);
    opacity: 0;
}

/* Анимированные placeholder */
#loginForm label {
    position: relative;
}

.floating-label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 16px;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
    padding: 0 8px;
}

#loginForm input:focus + .floating-label,
#loginForm input:not(:placeholder-shown) + .floating-label {
    top: 0;
    font-size: 12px;
    color: #4a6bff;
    font-weight: 600;
}

#loginForm button {
    padding: 16px 32px;
    background: linear-gradient(135deg, #4a6bff, #3a5bef);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(74, 107, 255, 0.3);
    position: relative;
    overflow: hidden;
}

#loginForm button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left 0.6s ease;
}

#loginForm button:hover::before {
    left: 100%;
}

#loginForm button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 107, 255, 0.4);
}

#loginForm button:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(74, 107, 255, 0.3);
}

#loginForm button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.3),
                0 4px 15px rgba(74, 107, 255, 0.3);
}

.error {
    background: #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #feb2b2;
    text-align: center;
    font-weight: 500;
    margin-top: 15px;
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

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

/* Дополнительные декоративные элементы */
.login-decoration {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(74, 107, 255, 0.1), rgba(58, 91, 239, 0.05));
    animation: float 6s ease-in-out infinite;
}

.decoration-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.decoration-2 {
    bottom: 10%;
    right: 10%;
    animation-delay: -2s;
}

.decoration-3 {
    top: 50%;
    right: 15%;
    width: 100px;
    height: 100px;
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Адаптивность */
@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px;
        width: 85vw;
    }
    
    .login-container h2 {
        font-size: 24px;
    }
    
    #loginForm input {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    #loginForm button {
        padding: 14px 24px;
        font-size: 14px;
    }
}

/* Темная тема для формы авторизации */
@media (prefers-color-scheme: dark) {
    .login-container {
        background: rgba(26, 32, 44, 0.95);
        color: #f7fafc;
    }
    
    .login-container h2 {
        color: #f7fafc;
    }
    
    #loginForm input {
        background: #2d3748;
        border-color: #4a5568;
        color: #f7fafc;
    }
    
    #loginForm input:focus {
        border-color: #4a6bff;
    }
    
    .floating-label {
        background: #2d3748;
    }
}

/* Анимация появления элементов формы */
#loginForm label {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

#loginForm label:nth-child(1) {
    animation-delay: 0.2s;
}

#loginForm label:nth-child(2) {
    animation-delay: 0.4s;
}

#loginForm button {
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.6s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Виджет следующего звонка */
.next-call-widget {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-left: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

.next-call-item {
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
}

.next-call-item:hover {
    background: #e9ecef;
}

.next-call-time {
    font-size: 14px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 5px;
}

.next-call-client {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

.next-call-client:hover {
    color: var(--primary-color);
}

.next-call-actions {
    display: flex;
    gap: 5px;
}
.comment-badge {
    background-color: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.8em;
    margin-left: 3px;
}
.next-call-actions button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
}

.next-call-actions button:hover {
    color: var(--primary-color);
}

.no-calls {
    color: #666;
    text-align: center;
    padding: 15px;
}

.no-calls i {
    margin-right: 8px;
}

.error {
    color: var(--danger-color);
}

@media (max-width: 1200px) {
    .next-call-widget {
        display: none;
    }
}
:root {
  /* Светлая тема (по умолчанию) */
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --text-primary: #333333;
  --text-secondary: #666666;
  --accent-color: #4a6bff;
  --border-color: #e0e0e0;
}

[data-theme="dark"] {
  /* Тёмная тема */
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --text-primary: #f0f0f0;
  --text-secondary: #cccccc;
  --accent-color: #6b8cff;
  --border-color: #444444;
}

/* Применяем переменные к элементам */
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background 0.3s ease, color 0.3s ease;
}

.sidebar {
  background-color: var(--bg-secondary);
}

button, input, textarea {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-primary);
  padding: 0.5rem;
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: #f5f7fa;
    color: var(--text-color);
    display: flex;
    line-height: 1.6;width:100%;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    height: 100vh;
    position: fixed;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.logo {
 padding: 15px; /* Уменьшили отступы */
    font-size: 1rem; /* Уменьшили размер шрифта */
    display: flex;
    align-items: center;
  
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo svg {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    fill: none;
    stroke: var(--sidebar-text);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

nav li {
    margin: 5px 0;
}

nav a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

nav a:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: rgba(255,255,255,0.3);
}

nav a.active {
    background: rgba(255,255,255,0.1);
    border-left-color: var(--sidebar-active);
}

.icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.motivation {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.motivation svg {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
    stroke: #4CAF50;
}

.motivation p {
    font-size: 0.9rem;
    color: #bdc3c7;
    font-style: italic;
}

.main-content {
  margin-left: var(--sidebar-width);
    padding: 15px;
    flex: 1;
    max-width: 100%;
    overflow-x: auto;
}

.container {
   max-width: none;
    width: 100%;
    margin: 0;
    padding: 0 15px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.actions-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.filters-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
    border: 1px solid var(--border-color);
}

#clientsTable {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

#clientsTable th, #clientsTable td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

#clientsTable th {
    background: var(--light-gray);
    color: #555;
    font-weight: 600;
    position: sticky;
    top: 0;
    white-space: nowrap;
}

#clientsTable tr:hover {
    background: #f5f7fa;
}

#clientsTable tr td:last-child {
    white-space: nowrap;
}

button, .modal-cancel {
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 16px;
    margin: 4px;
    border: none;
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

button.main-action, #addClientBtn {
    background: var(--primary-color);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(74, 107, 255, 0.2);
}

button.main-action:hover, #addClientBtn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

button.mini-btn {
    background: #fff;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    font-size: 18px;
    padding: 5px 10px;
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button.mini-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.modal-cancel {
    background: #f8f9fa;
    color: #555;
    border: 1px solid #ddd;
}

.modal-cancel:hover {
    background: #e9ecef;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    margin: 8px 0 12px 0;
    border: 1.5px solid #e3e8ee;
    border-radius: 6px;
    font-size: 15px;
    background: #f8fafc;
    color: var(--text-color);
    transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.1);
}

label {
    font-weight: 500;
    color: var(--text-color);
    display: block;
}

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

.compact-form .form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.compact-form .form-row label {
    flex: 1 1 0;
}

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

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    animation: fadeInBg 0.3s;
}

@keyframes fadeInBg {
    from { background: rgba(0,0,0,0); }
    to   { background: rgba(0,0,0,0.5); }
}

.modal-content {
    background: #fff;
    margin: 5% auto;
    padding: 25px;
    border-radius: 10px;
    width: 600px;
    max-width: 95vw;
    box-shadow: 0 8px 32px 0 rgba(0,0,0,0.2);
    position: relative;
    animation: modalPop 0.3s;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes modalPop {
    from { transform: scale(0.9); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s;
    font-weight: bold;
}

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

.entity-list {
    margin-top: 25px;
}

.entity-list div {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 6px;
    background: var(--light-gray);
}

.entity-list button {
    padding: 5px 10px;
    font-size: 14px;
    margin-left: 5px;
}

.filters-row select,
.filters-row input[type="date"] {
    width: auto;
    min-width: 150px;
    padding: 8px 12px;
    font-size: 15px;
    border-radius: 6px;
    border: 1.5px solid #e3e8ee;
    background: #f8fafc;
}

#logoutBtn {
    background: var(--danger-color);
}

#logoutBtn:hover {
    background: #c82333;
}

@media (max-width: 992px) {
    .sidebar {
        width: 70px;
        overflow: hidden;
    }
    
    .logo span, nav span {
        display: none;
    }
    
    .logo {
        justify-content: center;
        padding: 15px;
    }
    
    .logo svg, .icon {
        margin-right: 0;
    }
    
    nav a {
        justify-content: center;
        padding: 15px 0;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .motivation {
        display: none;
    }
    
    .actions-panel {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .compact-form .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .filters-row {
        width: 100%;
    }
    
    .filters-row select,
    .filters-row input[type="date"] {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    button, .modal-cancel {
        width: 100%;
        justify-content: center;
    }
}


/* Аналитика */
.analytics-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.analytics-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    color: #666;
    font-weight: 600;
    transition: all 0.3s;
}

.analytics-tab:hover {
    color: var(--primary-color);
}

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

.tab-content {
    display: none;
}

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

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 30px;
}

.stats-table {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.stats-table div {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.stats-table div:last-child {
    border-bottom: none;
}

.stats-table span:first-child {
    display: flex;
    align-items: center;
}

.stats-table .color-badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

/* Хостинг - таблица */
#hostingTable {
    width: 100%;
    min-width: auto; /* Убираем фиксированную минимальную ширину */
    table-layout: auto; /* Автоматическое распределение ширины */
}

#hostingTable th, #hostingTable td {
    white-space: nowrap;
    padding: 12px 15px;
}

#hostingTable tr.inactive td {
    color: var(--danger-color);
    font-weight: 500;
}

/* Адаптивность таблицы */
@media (max-width: 992px) {
    #hostingTable th:nth-child(4),
    #hostingTable td:nth-child(4),
    #hostingTable th:nth-child(5),
    #hostingTable td:nth-child(5) {
        display: none;
    }
}

@media (max-width: 768px) {
    #hostingTable th:nth-child(3),
    #hostingTable td:nth-child(3),
    #hostingTable th:nth-child(6),
    #hostingTable td:nth-child(6) {
        display: none;
    }
}


/* Добавьте в конец файла style.css */
.calendar-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-period-selector {
    display: flex;
    gap: 10px;
}

.period-btn {
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

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

#calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-day:hover {
    transform: scale(1.05);
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day-header {
    font-weight: bold;
    text-align: center;
    padding: 5px;
    font-size: 12px;
    color: #666;
}

.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    font-size: 12px;
}

.legend-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 5px;
}

.legend-color.low {
    background: #d4edda;
}

.legend-color.medium {
    background: #ffeeba;
}

.legend-color.high {
    background: #f8d7da;
}

/* Цвета для дней в зависимости от количества заявок */
.calendar-day.low {
    background: #d4edda;
    color: #155724;
}

.calendar-day.medium {
    background: #ffeeba;
    color: #856404;
}

.calendar-day.high {
    background: #f8d7da;
    color: #721c24;
}

/* Добавим стили для управления календарем */
.calendar-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.calendar-controls button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--primary-color);
    padding: 5px 10px;
}

.calendar-controls button:hover {
    background: #f0f0f0;
}

.calendar-controls h3 {
    margin: 0;
    min-width: 180px;
    text-align: center;
}

/* Увеличим размер календаря в модальном окне */
#calendar {
    grid-template-columns: repeat(7, 40px);
    gap: 8px;
}

.calendar-day {
    height: 40px;
    width: 40px;
    position: relative;
    font-size: 14px;
}

.calendar-day::after {
    content: attr(data-count);
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 9px;
    background: rgba(255,255,255,0.7);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Календарь в модальном окне */
#calendarModal .calendar-container {
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    margin-bottom: 0;
}

#calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.calendar-day {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.calendar-day:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.calendar-day::after {
    content: attr(data-count);
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.calendar-day-header {
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
    color: #666;
}

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
}

.calendar-controls button {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-controls button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

#currentMonthYear {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 15px;
}
.month-total {
    font-size: 0.9em;
    color: #666;
    font-weight: normal;
    margin-left: 5px;
}

/* Стили для хостинга */
.expiring-soon {
    background-color: #fff3f3;
    border-left: 3px solid #ff6b6b;
}

.expiring-soon td {
    color: #dc3545;
    font-weight: 500;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* Стили для таблицы обслуживания */
#maintenanceTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#maintenanceTable th, 
#maintenanceTable td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

#maintenanceTable th {
    background: var(--light-gray);
    color: #555;
    font-weight: 600;
    position: sticky;
    top: 0;
}

#maintenanceTable tr:hover {
    background-color: rgba(74, 107, 255, 0.05);
}

#maintenanceTable tr.inactive {
    opacity: 0.8;
}

#maintenanceTable tr.inactive:hover {
    background-color: rgba(220, 53, 69, 0.05);
}

/* Компактные стили для мобильных устройств */
@media (max-width: 768px) {
    #maintenanceTable {
        font-size: 13px;
    }
    
    #maintenanceTable th, 
    #maintenanceTable td {
        padding: 8px 10px;
    }
    
    #maintenanceTable th:nth-child(5),
    #maintenanceTable td:nth-child(5) {
        display: none;
    }
}

/* Еще более компактно для очень маленьких экранов */
@media (max-width: 576px) {
    #maintenanceTable {
        font-size: 12px;
    }
    
    #maintenanceTable th, 
    #maintenanceTable td {
        padding: 6px 8px;
    }
    
    #maintenanceTable th:nth-child(4),
    #maintenanceTable td:nth-child(4) {
        display: none;
    }
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    min-width: 70px;
    text-align: center;
}

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

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

/* Кнопки действий в таблице */
#maintenanceTable button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    color: var(--primary-color);
    transition: all 0.2s;
}

#maintenanceTable button:hover {
    color: var(--primary-hover);
    transform: scale(1.1);
}

#maintenanceTable button:first-child {
    margin-right: 5px;
}
/* Добавьте в конец файла */
#trafficSourceModal .modal-content {
    max-width: 500px;
}

#trafficSourceList div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 5px;
    background: #f8f9fa;
    border-radius: 4px;
}

#trafficSourceList button {
    padding: 5px 10px;
    margin-left: 5px;
}

#clientsTable th:nth-child(8),
#clientsTable td:nth-child(8) {
    white-space: nowrap;
}

@media (max-width: 1200px) {
    #clientsTable th:nth-child(8),
    #clientsTable td:nth-child(8) {
        display: none;
    }
}

.traffic-stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.traffic-stats-table th, 
.traffic-stats-table td {
    padding: 12px 15px;
    border: 1px solid #eee;
    text-align: left;
}

.traffic-stats-table th {
    background-color: #f5f5f5;
    position: sticky;
    top: 0;
}

.traffic-stats-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.percentage-bar {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    margin-top: 5px;
    overflow: hidden;
}

.percentage-bar-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 10px;
}

.stats-table-container {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.date-range {
    font-weight: 500;
    color: #666;
}

.period-selector {
    display: flex;
    gap: 10px;
}

.period-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* Стили для аналитики трафика */
.traffic-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.period-selector {
    display: flex;
    gap: 10px;
}

.period-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.source-filter {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
    min-width: 200px;
}

#trafficLeadsTable {
    width: 100%;
    border-collapse: collapse;
}

#trafficLeadsTable th, #trafficLeadsTable td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

#trafficLeadsTable th {
    background-color: #f5f5f5;
    position: sticky;
    top: 0;
}

#trafficLeadsTable tr:hover {
    background-color: rgba(74, 107, 255, 0.05);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.chart-container {
    height: 400px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.stats-table-container {
    max-height: 400px;
    overflow-y: auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

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

.stats-table th, .stats-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.stats-table th {
    background-color: #f5f5f5;
    position: sticky;
    top: 0;
}

.percentage-bar {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    margin-top: 5px;
    overflow: hidden;
}

.percentage-bar-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 10px;
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Стили для комментариев */
.comment {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    background: #f8f9fa;
    position: relative;
    border-left: 4px solid #4a6bff;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.comment-author {
    font-weight: 600;
    color: var(--primary-color);
}

.comment-date {
    color: #666;
    font-size: 0.85em;
}

.comment-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-today {
    border-left-color: #28a745;
}

.comment-yesterday {
    border-left-color: #ffc107;
}

.comment-older {
    border-left-color: #6c757d;
}

#commentsContainer {
    display: flex;
    flex-direction: column-reverse;
}

/* Стили для переключения представлений */
.view-toggle {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.view-toggle button.active {
    background: var(--primary-color);
    color: white;
}

/* Канбан-доска */
.kanban-container {
    margin-top: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
}

.kanban-columns {
    display: flex;
    gap: 15px;
    min-width: fit-content;
}

.kanban-column {
    min-width: 280px;
    width: 280px;
    background: #f5f7fa;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid var(--border-color);
}

.kanban-column-header {
    padding: 10px;
    font-weight: 600;
    color: #555;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.kanban-column-count {
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 100px;
}

.kanban-card {
    background: white;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid var(--primary-color);
}

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

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}

.kanban-card-body {
    font-size: 13px;
    color: #666;
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    color: #888;
}

/* Компактный вид таблицы */
.compact-table-view #clientsTable th:nth-child(4),
.compact-table-view #clientsTable td:nth-child(4),
.compact-table-view #clientsTable th:nth-child(5),
.compact-table-view #clientsTable td:nth-child(5),
.compact-table-view #clientsTable th:nth-child(7),
.compact-table-view #clientsTable td:nth-child(7),
.compact-table-view #clientsTable th:nth-child(8),
.compact-table-view #clientsTable td:nth-child(8) {
    display: none;
}

.compact-table-view #clientsTable th,
.compact-table-view #clientsTable td {
    padding: 8px 10px;
    font-size: 13px;
}

/* Кнопка компактного вида */
#compactViewBtn {
    margin-left: 10px;
}

/* Компактный дизайн */
:root {
    --sidebar-width: 60px;
    --sidebar-expanded-width: 180px;
    --sidebar-transition: all 0.3s ease;
}

/* Сворачиваемое боковое меню */
.sidebar {
    width: var(--sidebar-width);
    transition: var(--sidebar-transition);
    overflow: hidden;
}

.sidebar.expanded {
    width: var(--sidebar-expanded-width);
}

.sidebar .logo span,
.sidebar nav span {
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.sidebar.expanded .logo span,
.sidebar.expanded nav span {
    opacity: 1;
}

/* Иконка для сворачивания/разворачивания */
.sidebar-toggle {
    position: absolute;
    right: 10px;
    top: 15px;
    cursor: pointer;
    color: var(--sidebar-text);
    z-index: 101;
}

/* Основной контент на всю ширину */
.main-content {
    margin-left: var(--sidebar-width);
    transition: var(--sidebar-transition);
}

.sidebar.expanded + .main-content {
    margin-left: var(--sidebar-expanded-width);
}

/* Компактная таблица */
.compact-table {
    font-size: 13px;
}

.compact-table th, 
.compact-table td {
    padding: 8px 10px !important;
}

/* Скрытие неважных колонок в компактном режиме */
.compact-mode .secondary-column {
    display: none;
}

/* Адаптивные стили */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
    }
    
    .sidebar.expanded {
        width: 100%;
        z-index: 1000;
    }
    
    .main-content {
        margin-left: 0;
    }
}


/* Компактная таблица клиентов */
#clientsTable {
    font-size: 13px;
}

#clientsTable th, 
#clientsTable td {
    padding: 8px 10px !important;
    white-space: nowrap;
}

/* Скрываем только колонку с примечанием */
#clientsTable td:nth-child(4),
#clientsTable th:nth-child(4) {
    display: none;
}

/* Иконка примечания */
.note-icon {
    color: var(--primary-color);
    cursor: pointer;
    margin-left: 5px;
    font-size: 14px;
    display: inline-block;
}

/* Стили для даты (делаем более компактной) */
.compact-date {
    font-size: 12px;
    color: #666;
}

/* Стили для источников (делаем более компактными) */
.compact-source {
    font-size: 12px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* Модальное окно примечания */
#noteModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

#noteModal .modal-content {
    background: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

#noteModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

#noteModal .modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

#noteModal .close {
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}

#noteModal .close:hover {
    color: var(--primary-color);
}

#noteModal .note-content {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

@media (max-width: 768px) {
    /* На очень маленьких экранах скрываем email */
    #clientsTable td:nth-child(3),
    #clientsTable th:nth-child(3) {
        display: none;
    }
    
    /* Делаем источники еще компактнее */
    .compact-source {
        max-width: 80px;
    }
}