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

:root {
    --blue: #3498db;
    --blue-dark: #2980b9;
    --ink: #2c3e50;
    --ink-soft: #546e7a;
    --line: #e0e0e0;
    --bg: #f5f7fa;
    --danger: #e74c3c;
    --ok: #27ae60;
    --warn: #f39c12;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
}

header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--ink);
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--blue);
}

.hero {
    background: linear-gradient(135deg, #ffffff 0%, #e3f2fd 100%);
    padding: 4rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #1a252f;
}

.hero p {
    font-size: 1.3rem;
    color: var(--ink-soft);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.cta-button.green {
    background: linear-gradient(135deg, var(--ok), #229954);
}

.cta-button.gray {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.cta-button.small {
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: #1a252f;
}

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

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--ink);
}

.map-section {
    background: white;
    padding: 4rem 2rem;
}

.map-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.map-wrap {
    position: relative;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    background: linear-gradient(180deg, #e3f2fd 0%, #f8fbff 100%);
}

#russia-map {
    width: 100%;
    cursor: grab;
}

#russia-map svg {
    width: 100%;
    height: auto;
    display: block;
}

#russia-map path {
    transition: fill 0.2s;
}

.region-label {
    fill: #5b7a95;
    font-size: 10px;
    font-weight: 600;
    pointer-events: none;
    text-anchor: middle;
}

.org-point {
    cursor: pointer;
}

.org-point circle {
    fill: #e74c3c;
    stroke: #fff;
    stroke-width: 2;
}

.org-point text {
    fill: #1a252f;
    font-size: 11px;
    font-weight: 600;
    pointer-events: none;
}

.map-back {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    padding: 0.5rem 1.2rem;
    background: rgba(44, 62, 80, 0.9);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.map-back:hover {
    background: #1a252f;
}

.map-legend {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--ink-soft);
    text-align: center;
}

.workshop-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.workshop-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--blue);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.workshop-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.workshop-card h4 {
    color: var(--ink);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.workshop-card p {
    color: var(--ink-soft);
    margin-bottom: 0.5rem;
}

.materials-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    padding: 4rem 2rem;
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.material-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s;
}

.material-card:hover {
    transform: translateY(-5px);
}

.material-thumbnail {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.material-content {
    padding: 1.5rem;
}

.material-content h4 {
    margin-bottom: 0.5rem;
    color: var(--ink);
}

.material-content p {
    color: var(--ink-soft);
    margin-bottom: 1rem;
}

.certificate-section {
    background: white;
    padding: 4rem 2rem;
    text-align: center;
}

.certificate-badge {
    display: inline-block;
    padding: 2rem 3rem;
    background: linear-gradient(135deg, var(--warn), #e67e22);
    color: white;
    border-radius: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.3);
    margin-bottom: 2rem;
}

footer {
    background: var(--ink);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--blue);
}

/* ---- Модальные окна ---- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    max-width: 560px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--ink-soft);
    line-height: 1;
    background: none;
    border: none;
}

/* ---- Формы ---- */
.form-group {
    margin-bottom: 1.2rem;
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--blue);
}

.submit-btn {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s;
}

.submit-btn:hover {
    transform: translateY(-2px);
}

.form-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
}

/* ---- Тосты ---- */
#toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-item {
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slidein 0.25s ease;
    max-width: 340px;
}

.toast-item.error { background: var(--danger); }
.toast-item.ok { background: var(--ok); }
.toast-item.info { background: var(--blue); }

@keyframes slidein {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ---- Личный кабинет ---- */
.lk-body {
    background: #eef1f5;
}

.lk-header {
    background: var(--ink);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.lk-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lk-header .logo {
    color: #fff;
    font-size: 1.4rem;
}

.lk-header .logo-icon {
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
}

.lk-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lk-user .role-badge {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.lk-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 64px);
}

.lk-sidebar {
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 1.2rem 0;
}

.lk-sidebar button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.8rem 1.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--ink);
    cursor: pointer;
    border-left: 3px solid transparent;
    font-family: inherit;
}

.lk-sidebar button:hover {
    background: #f2f6fa;
}

.lk-sidebar button.active {
    background: #eef6fc;
    border-left-color: var(--blue);
    color: var(--blue-dark);
    font-weight: 600;
}

.lk-content {
    padding: 2rem;
    overflow: hidden;
}

.lk-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #1a252f;
}

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h3 {
    margin-bottom: 1rem;
    color: var(--ink);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .grid-2 { grid-template-columns: 1fr; }
    .lk-layout { grid-template-columns: 1fr; }
    .lk-sidebar { border-right: none; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; }
    .lk-sidebar button { width: auto; border-left: none; border-bottom: 3px solid transparent; padding: 0.6rem 1rem; }
    .lk-sidebar button.active { border-bottom-color: var(--blue); }
}

/* ---- Таблицы ---- */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.table th,
.table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.table th {
    background: #f8fafc;
    color: var(--ink-soft);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.table tr:last-child td { border-bottom: none; }

.table .actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.45rem 0.9rem;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.2s;
}

.btn:hover { border-color: var(--blue); color: var(--blue-dark); }

.btn.primary {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

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

.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }

.btn.ghost {
    border: none;
    background: none;
    color: var(--ink-soft);
    padding: 0.3rem;
}

.btn.ghost:hover { color: var(--danger); }

/* ---- Бейджи статусов ---- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.new { background: #fdecea; color: #c0392b; }
.badge.in_progress { background: #fef3e2; color: #d68910; }
.badge.closed { background: #e8f8ef; color: #1e8449; }

.badge.role-admin { background: #f3e8fd; color: #7d3c98; }
.badge.role-manager { background: #e8f0fe; color: #1a56a0; }
.badge.role-support { background: #fef3e2; color: #d68910; }
.badge.role-user { background: #e8f8ef; color: #1e8449; }

.verified { color: var(--ok); font-weight: 600; }
.unverified { color: var(--warn); font-weight: 600; }

/* ---- Чат ---- */
.chat-box {
    display: flex;
    flex-direction: column;
    height: 480px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
    overflow: hidden;
}

.chat-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.msg {
    max-width: 75%;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    font-size: 0.95rem;
    word-break: break-word;
}

.msg.mine {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    color: #fff;
    border-bottom-right-radius: 3px;
}

.msg.theirs {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--line);
    border-bottom-left-radius: 3px;
}

.msg .meta {
    font-size: 0.75rem;
    opacity: 0.75;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.msg .file-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.06);
    padding: 0.3rem 0.7rem;
    border-radius: 8px;
    margin-top: 0.35rem;
    text-decoration: none;
    color: inherit;
    font-size: 0.9rem;
}

.msg.mine .file-link { background: rgba(255, 255, 255, 0.2); }

.chat-input {
    display: flex;
    gap: 0.5rem;
    padding: 0.7rem;
    border-top: 1px solid var(--line);
    background: #fff;
}

.chat-input input[type=text] {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--line);
    border-radius: 8px;
    font-size: 0.95rem;
}

.chat-input input[type=text]:focus { outline: none; border-color: var(--blue); }

.msg-actions {
    display: inline-flex;
    gap: 0.3rem;
    margin-left: 0.4rem;
    vertical-align: middle;
}

.ticket-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.ticket-head .subject { font-size: 1.25rem; font-weight: 600; }

.empty {
    color: var(--ink-soft);
    text-align: center;
    padding: 3rem 1rem;
}

.muted { color: var(--ink-soft); }
.small { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

.login-screen {
    max-width: 420px;
    margin: 8vh auto;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
}

.login-screen h1 { margin-bottom: 1.5rem; color: #1a252f; text-align: center; }

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .section-title { font-size: 2rem; }
    .container { padding: 2rem 1rem; }
    .lk-content { padding: 1rem; }
}
