/* ===== ВСЕ СТИЛИ (включая ранее инлайновые из index.html) ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    background: #f5f7fa;
    color: #1e2a3a;
}
a { color: #0066b3; text-decoration: none; }
a:hover { text-decoration: underline; }

header {
    background: #0b2b4a;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.logo {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    flex: 1;
}
.logo small {
    font-size: 16px;
    font-weight: 400;
    display: block;
    opacity: 0.8;
}
nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    align-items: center;
}
nav a {
    color: #fff;
    font-size: 18px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.2s;
    cursor: pointer;
}
nav a:hover {
    background: rgba(255,255,255,0.15);
    text-decoration: none;
}
nav a.active {
    background: #1e6da0;
}
#user-status {
    font-size: 16px;
    color: #b0d4f0;
}
#user-status span {
    color: #fff;
    font-weight: 600;
}

.container {
    max-width: 1200px;
    margin: 25px auto;
    padding: 0 20px;
}

.page {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.page.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.card h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #0b2b4a;
    border-bottom: 3px solid #e6edf5;
    padding-bottom: 10px;
}
.card h3 {
    font-size: 22px;
    margin: 20px 0 10px;
}

.news-item {
    border-bottom: 1px solid #eef2f6;
    padding: 15px 0;
}
.news-item:last-child { border: none; }
.news-date {
    color: #6b7a8a;
    font-size: 16px;
    margin-right: 15px;
}
.news-title {
    font-weight: 600;
    font-size: 20px;
}

.doc-list {
    list-style: none;
}
.doc-list li {
    padding: 12px 0;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    gap: 15px;
}
.doc-list li:last-child { border: none; }
.doc-icon {
    font-size: 28px;
    width: 40px;
    text-align: center;
}

.contact-row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px 40px;
    margin: 15px 0;
}
.contact-row div { font-size: 20px; }
#map {
    width: 100%;
    height: 350px;
    border-radius: 12px;
    border: none;
    margin-top: 15px;
}
.map-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 18px;
}

.login-form input {
    display: block;
    width: 100%;
    max-width: 400px;
    padding: 14px 18px;
    font-size: 20px;
    margin: 10px 0;
    border: 2px solid #ced8e3;
    border-radius: 8px;
}
.login-form button, .btn {
    background: #0b2b4a;
    color: #fff;
    border: none;
    padding: 14px 30px;
    font-size: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: inline-block;
    margin: 5px 5px 5px 0;
    position: relative;
}
.login-form button:hover, .btn:hover { background: #1e4f73; }
.login-form button:active, .btn:active { transform: scale(0.97); }
.btn-outline {
    background: transparent;
    color: #0b2b4a;
    border: 2px solid #0b2b4a;
}
.btn-outline:hover {
    background: #0b2b4a;
    color: #fff;
}
.btn-danger { background: #b33c3c; }
.btn-danger:hover { background: #8f2a2a; }
.btn-success { background: #2a7a4a; }
.btn-success:hover { background: #1d5f38; }
.btn-primary { background: #1e6da0; }
.btn-primary:hover { background: #0b4a6f; }
.btn-sm {
    padding: 8px 16px;
    font-size: 16px;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.flex-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}
.profile-info {
    font-size: 20px;
}
.profile-info strong {
    display: inline-block;
    width: 180px;
}
.profile-info .address-field {
    width: 100%;
    max-width: 500px;
}
.debt { color: #b33c3c; font-weight: 700; }
.paid { color: #2a7a4a; }

.cabinet-layout {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}
.cabinet-sidebar {
    flex: 0 0 240px;
    background: #f0f4fa;
    border-radius: 12px;
    padding: 15px 0;
    display: flex;
    flex-direction: column;
}
.cabinet-sidebar button {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 12px 20px;
    border: none;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    color: #1e2a3a;
    transition: background 0.2s, border-color 0.2s;
    border-left: 3px solid transparent;
}
.cabinet-sidebar button:hover {
    background: #e2e9f2;
}
.cabinet-sidebar button.active {
    background: #fff;
    border-left-color: #0b2b4a;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.datetime-widget {
    background: #eef4f9;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 10px 15px;
    text-align: center;
    font-size: 18px;
    color: #0b2b4a;
}
.datetime-widget .date {
    font-weight: 600;
    font-size: 20px;
}
.datetime-widget .time {
    font-size: 28px;
    font-weight: 700;
    color: #0b2b4a;
    letter-spacing: 1px;
}

.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.cabinet-content {
    flex: 1;
    min-width: 280px;
}

.app-form label {
    display: block;
    margin: 15px 0 5px;
    font-weight: 600;
}
.app-form select, .app-form textarea, .app-form input {
    width: 100%;
    max-width: 600px;
    padding: 12px 16px;
    font-size: 18px;
    border: 2px solid #ced8e3;
    border-radius: 8px;
}
.app-form textarea { height: 120px; }

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}
.status-new { background: #d9edf7; color: #1a4f6b; }
.status-processing { background: #fcf8e3; color: #8a6d3b; }
.status-done { background: #dff0d8; color: #2a6b3a; }
.status-rejected { background: #f8d7da; color: #8a2a2a; }

.admin-member {
    background: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1px solid #dce3ed;
}
.admin-member .member-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;
    cursor: pointer;
    padding: 8px 4px;
}
.admin-member .member-header strong {
    font-size: 20px;
}
.admin-member .member-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding-top: 0;
}
.admin-member .member-details.open {
    max-height: 2000px;
    padding-top: 12px;
    border-top: 1px solid #e6edf5;
    margin-top: 10px;
}
.admin-member .member-details .field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0;
}
.admin-member .member-details .field-row label {
    font-weight: 600;
    min-width: 80px;
}
.admin-member .member-details .garage-block {
    background: #f8fafc;
    padding: 10px;
    border-radius: 6px;
    margin: 8px 0;
}
.admin-member .member-details .garage-block .garage-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.admin-member .member-details .garage-block .garage-fields label {
    font-weight: normal;
    min-width: 60px;
    font-size: 16px;
}
.admin-member .member-details .garage-block .garage-fields input {
    width: 100px;
    padding: 4px 8px;
    font-size: 15px;
    border: 1px solid #ced8e3;
    border-radius: 4px;
}

.admin-search {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}
.admin-search input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    font-size: 18px;
    border: 2px solid #ced8e3;
    border-radius: 8px;
}

.admin-news-item {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 8px 0;
    border-left: 4px solid #0b2b4a;
}
.admin-news-item .news-actions {
    margin-top: 8px;
    display: flex;
    gap: 10px;
}

.garage-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 15px;
    border-left: 4px solid #0b2b4a;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.garage-card:hover {
    background: #eef4f9;
}
.garage-card.selected {
    border-left-color: #2a7a4a;
    background: #e6f4e6;
}
.garage-card strong {
    font-size: 20px;
}

.electricity-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 15px 20px;
    margin: 10px 0;
}
.electricity-card .meter-number {
    font-size: 22px;
    font-weight: 700;
    color: #0b2b4a;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}
.table th, .table td {
    padding: 12px;
    border-bottom: 1px solid #e6edf5;
    text-align: left;
}
.table th {
    background: #f0f4fa;
    font-weight: 600;
}
.table .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.badge-new {
    background: #b33c3c;
    color: #fff;
    border-radius: 50%;
    padding: 2px 8px;
    font-size: 14px;
    margin-left: 8px;
}

.user-file-card {
    background: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1px solid #dce3ed;
}
.user-file-card .user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
}
.user-file-card .user-header strong {
    font-size: 20px;
}
.user-file-card .file-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding-top: 0;
}
.user-file-card .file-list.open {
    max-height: 2000px;
    padding-top: 12px;
}
.user-file-card .file-item {
    padding: 6px 0;
    border-bottom: 1px solid #f0f4fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.user-file-card .file-item:last-child {
    border-bottom: none;
}
.user-file-card .upload-area {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.user-file-card .upload-area input[type="text"] {
    flex: 1;
    min-width: 150px;
    padding: 6px 10px;
    border: 1px solid #ced8e3;
    border-radius: 4px;
    font-size: 16px;
}
.user-file-card .upload-area input[type="file"] {
    flex: 1;
}

.energy-member {
    background: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1px solid #dce3ed;
}
.energy-member .energy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
}
.energy-member .energy-header strong {
    font-size: 20px;
}
.energy-member .energy-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding-top: 0;
}
.energy-member .energy-details.open {
    max-height: 2000px;
    padding-top: 12px;
}

.payment-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
}
.payment-column .payment-item {
    background: #f0f4fa;
    padding: 2px 8px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.payment-column .payment-item .paid {
    color: #2a7a4a;
}
.payment-column .payment-item .debt {
    color: #b33c3c;
}
.payment-column .payment-item .pay-actions {
    display: flex;
    gap: 5px;
}
.payment-column .payment-item .pay-actions button {
    font-size: 14px;
    padding: 2px 6px;
}

.reading-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 5px 0;
}
.reading-list .reading-item {
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.reading-list .reading-item .reading-actions {
    display: flex;
    gap: 5px;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    width: 100%;
}
.toast {
    background: #fff;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-left: 5px solid #0b2b4a;
    animation: slideIn 0.4s ease, fadeOut 0.4s ease 2.8s forwards;
    display: flex;
    align-items: center;
    gap: 12px;
}
.toast.success { border-left-color: #2a7a4a; }
.toast.error { border-left-color: #b33c3c; }
.toast.info { border-left-color: #1e6da0; }
.toast .toast-icon { font-size: 24px; }
.toast .toast-message { flex: 1; font-size: 16px; }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateX(40px); }
}

.text-muted { color: #6b7a8a; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.hidden { display: none; }
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
}
.alert-success { background: #dff0d8; color: #2a6b3a; }
.alert-danger { background: #f8d7da; color: #8a2a2a; }
.alert-info { background: #d9edf7; color: #1a4f6b; }

.modal-overlay {
    display: none;
    position: fixed;
    top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}
.modal-overlay.active { display: flex; }
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-box {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    text-align: left;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-box h3 { margin-bottom: 15px; }
.modal-box .password-display {
    font-size: 28px;
    font-weight: 700;
    color: #0b2b4a;
    background: #f0f4fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    letter-spacing: 2px;
    text-align: center;
}
.modal-box button { margin-top: 10px; }
.modal-box label { display: block; margin: 10px 0 5px; font-weight: 600; }
.modal-box input, .modal-box textarea {
    width: 100%;
    padding: 10px;
    font-size: 18px;
    border: 2px solid #ced8e3;
    border-radius: 8px;
}
.modal-box textarea { height: 120px; }

.doc-item {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 8px 0;
    border-left: 4px solid #0b2b4a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.doc-item .doc-info {
    flex: 1;
}
.doc-item .doc-actions {
    display: flex;
    gap: 10px;
}

.clickable-password {
    cursor: pointer;
    user-select: all;
    background: #f0f4fa;
    padding: 4px 12px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 20px;
}
.clickable-password:hover {
    background: #e2e9f2;
}

.check-btn {
    font-size: 14px;
    padding: 2px 10px;
    margin-left: 8px;
    background: #2a7a4a;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
}
.check-btn:hover {
    background: #1d5f38;
}

footer {
    background: #0b2b4a;
    color: #b0cbd8;
    padding: 25px 20px;
    text-align: center;
    font-size: 16px;
    margin-top: 40px;
}
footer a { color: #b0d4f0; }
footer .footer-links { margin: 10px 0; }
footer .footer-links a { margin: 0 12px; }

.main-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
}

.price-setting {
    background: #f0f7ff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}
.price-setting label {
    font-weight: 600;
}
.price-setting input {
    width: 120px;
    padding: 8px 12px;
    font-size: 18px;
    border: 2px solid #ced8e3;
    border-radius: 6px;
}
.price-setting .btn {
    padding: 8px 20px;
    font-size: 16px;
}

#admin-player {
    background: #1e3a5f;
    padding: 8px 20px;
    text-align: center;
    border-bottom: 1px solid #2a4a7a;
}
#admin-player select {
    background: #0b2b4a;
    color: #fff;
    border: 1px solid #4a7a9a;
    padding: 5px;
    border-radius: 4px;
}
#admin-player button {
    background: #2a7a4a;
    border: none;
    padding: 5px 15px;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
}
#admin-player button:hover {
    background: #1d5f38;
}

.mb-10 { margin-bottom: 10px; }
.mb-10 label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}
.mb-10 input, .mb-10 textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #ced8e3;
    border-radius: 8px;
    font-size: 16px;
}

#certificate-request-modal .modal-box label,
#approve-modal .modal-box label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}
#approve-modal .modal-box .label {
    font-weight: 600;
    color: #1e2a3a;
}
#approve-modal .modal-box input,
#approve-modal .modal-box textarea {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ced8e3;
    border-radius: 4px;
    font-size: 15px;
}
#approve-modal .modal-box textarea {
    min-height: 50px;
    resize: vertical;
}
.edit-hint {
    font-size: 14px;
    color: #6b7a8a;
    margin: 5px 0 15px;
}
#cert-request-btn {
    background: #1e6da0;
    color: #fff;
}
#cert-request-btn:hover {
    background: #0b4a6f;
}

#upload-modal .modal-box input[type="file"] {
    padding: 12px;
    border: 2px solid #ced8e3;
    border-radius: 8px;
    width: 100%;
    font-size: 16px;
}

.notification-badge {
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 8px;
    display: inline-block;
    min-width: 20px;
    text-align: center;
    line-height: 1.4;
    animation: pulse 1s ease-in-out 2;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@media (max-width: 700px) {
    #approve-modal .modal-box {
        padding: 15px;
    }
    #approve-modal .modal-box .data-grid {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    #certificate-request-modal .modal-box {
        padding: 15px;
        max-width: 100%;
    }
    #upload-modal .modal-box {
        padding: 15px;
        max-width: 100%;
    }
}

@media (max-width: 700px) {
    header { flex-direction: column; align-items: stretch; gap: 10px; }
    nav { justify-content: center; }
    .logo { font-size: 24px; text-align: center; }
    .card { padding: 18px 16px; }
    .card h2 { font-size: 24px; }
    .flex-row { flex-direction: column; align-items: stretch; }
    .profile-info strong { width: 120px; }
    .contact-row { flex-direction: column; gap: 12px; }
    #map { height: 250px; }
    .cabinet-layout { flex-direction: column; }
    .cabinet-sidebar { flex: 1; }
    .admin-member .member-header { flex-direction: column; gap: 10px; }
    .admin-search { flex-direction: column; }
    .table { font-size: 14px; }
    .table th, .table td { padding: 8px; }
    .table .actions { flex-direction: column; }
    .toast-container { max-width: 90%; right: 5%; }
    .price-setting { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) {
    body { font-size: 16px; }
    .logo { font-size: 20px; }
    nav a { font-size: 16px; padding: 4px 10px; }
    .btn, .login-form button { font-size: 18px; padding: 12px 20px; width: 100%; }
}