/* ============================================
   Базовые стили
   ============================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', 'Roboto', system-ui, sans-serif;
    background: #1e3a5f;
    padding: 24px;
    color: #1e293b;
}

a { color: #60a5fa; }
h1 { color: #f1f5f9; font-weight: 400; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #1e3a5f; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

.container, .dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    background: #2a4b78;
    border-radius: 24px;
    border: 1px solid #334155;
    padding: 30px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.header h1 { color: #f1f5f9; font-weight: 400; margin: 0; }
.header a { color: #60a5fa; text-decoration: none; }

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #60a5fa;
    text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: 24px;
    margin-top: 30px;
}
.project-card {
    background: #1e3a5f;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 20px;
    transition: 0.2s;
}
.project-card:hover { border-color: #3b82f6; }
.project-card h3 { color: #f1f5f9; margin: 0 0 8px 0; }
.project-card p { color: #94a3b8; margin: 0 0 16px 0; }
.project-card .link {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 6px 18px;
    border-radius: 40px;
    text-decoration: none;
    font-size: 13px;
}
.project-card .link:hover { background: #2563eb; }

.last-update { color: #94a3b8; font-size: 12px; margin: 4px 0 12px 0; }
.no-projects { color: #94a3b8; text-align: center; padding: 40px 0; }

.mini-dashboard {
    margin-top: 16px;
    background: #0f172a;
    border-radius: 12px;
    padding: 10px 12px;
}
.mini-dashboard table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mini-dashboard th, .mini-dashboard td {
    padding: 6px 4px;
    text-align: center;
    border-bottom: 1px solid #1e293b;
    color: #e2e8f0;
}
.mini-dashboard th {
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
}
.mini-dashboard td:first-child { text-align: left; color: #cbd5e1; font-weight: 500; }
.mini-dashboard .no-data { color: #64748b; text-align: center; padding: 20px 0; }

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #334155;
    background: #fff;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
th, td {
    border: 1px solid #cbd5e1;
    padding: 8px 10px;
    text-align: center;
    vertical-align: middle;
}
th {
    background: #1e293b;
    color: #f1f5f9;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
}
td:first-child {
    background: #f8fafc;
    font-weight: 500;
    text-align: left;
    padding-left: 15px;
    white-space: nowrap;
}
.col-total { background: #dbeafe !important; font-weight: 600; }
.no-data { color: #94a3b8; font-style: italic; }

.control-block {
    background: #0f172a;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    border: 1px solid #334155;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}
.control-status-label { color: #94a3b8; font-size: 14px; }
.control-status {
    font-weight: 600;
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 20px;
    background: #1e293b;
}
.control-btn {
    border: none;
    color: white;
    padding: 6px 18px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s;
}
.control-btn:hover { opacity: 0.9; }
.control-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-green { background: #22c55e; }
.btn-red   { background: #ef4444; }
.btn-blue  { background: #3b82f6; }
.btn-gray  { background: #334155; }

.log-block {
    background: #0f172a;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    border: 1px solid #334155;
}
.log-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.log-title { color: #94a3b8; font-size: 14px; font-weight: 500; }
.log-timer { color: #64748b; font-size: 11px; }
.log-output {
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid #1e293b;
    margin: 0;
}

.login-box {
    background: #2a4b78;
    padding: 40px;
    border-radius: 20px;
    border: 1px solid #334155;
    width: 360px;
}
.login-box h2 { color: #f1f5f9; text-align: center; margin-bottom: 30px; font-weight: 400; }
.login-box input[type="text"], .login-box input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    box-sizing: border-box;
}
.login-box button {
    width: 100%;
    padding: 12px;
    background: #3b82f6;
    border: none;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
}
.login-box button:hover { background: #2563eb; }
.error { color: #f87171; margin-top: 10px; text-align: center; }
.logo { text-align: center; margin-bottom: 20px; }
.logo img { max-height: 60px; }

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}
.modal-content {
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 20px;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    color: #e2e8f0;
}
.modal-content .close {
    color: #94a3b8;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.modal-content .close:hover { color: #f1f5f9; }

select, input[type="text"], input[type="email"], input[type="password"] {
    background: #3b82f6;
    border: 1px solid #334155;
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
}
input[type="text"]:focus, input[type="email"]:focus,
input[type="password"]:focus, select:focus {
    outline: none;
    border-color: #60a5fa;
}

/* ============================================
   Сворачиваемый блок ответственных
   ============================================ */
.authors-section {
    width: 340px;
    max-width: 100%;
    background: #1e293b;
    border-radius: 10px;
    padding: 10px 14px;
    border: 1px solid #334155;
}
.authors-toggle {
    color: #cbd5e1;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.authors-toggle:hover { color: #60a5fa; }
.authors-toggle #authors-toggle-icon {
    display: inline-block;
    width: 12px;
    text-align: center;
    font-size: 11px;
}
.authors-block { margin-top: 10px; }
.authors-list {
    max-height: 160px;
    overflow-y: auto;
    background: #0f172a;
    border-radius: 6px;
    padding: 8px 10px;
    border: 1px solid #1e293b;
}
.authors-list label {
    display: block;
    color: #cbd5e1;
    font-size: 13px;
    margin: 4px 0;
    cursor: pointer;
}
.authors-list label:hover { color: #60a5fa; }
.authors-actions {
    margin-top: 8px;
    font-size: 12px;
}
.authors-actions a {
    color: #94a3b8;
    text-decoration: underline;
    margin-right: 12px;
    cursor: pointer;
}
.authors-actions a:hover { color: #60a5fa; }
