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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

/* Header с логотипом */
.header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    width: 50px;
    height: 50px;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.3);
}

.logo-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-text {
    font-size: 20px;
    font-weight: bold;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-weight: 500;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c0392b;
}

/* Navigation */
.nav {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.nav ul {
    display: flex;
    list-style: none;
    padding: 0 20px;
}

.nav li {
    margin-right: 20px;
}

.nav a {
    display: block;
    padding: 15px 0;
    color: #2c3e50;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.nav a:hover,
.nav a.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2c3e50, #4a6491);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-logo {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    overflow: hidden;
    border: 2px solid #3498db;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-title {
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
}

.btn:hover {
    background: #2980b9;
}

.btn-primary {
    background: #3498db;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #219653;
}

.btn-danger {
    background: #e74c3c;
}

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

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Dashboard */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.card h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.card-icon {
    font-size: 40px;
    color: #3498db;
    margin-bottom: 15px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

.table-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
    border-radius: 3px;
}

/* Forms */
.form-container {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

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

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

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

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

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

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

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

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 800px;
    margin: 50px auto;
    padding: 30px;
    border-radius: 8px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

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

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

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

.status-entrepreneur {
    background: #fff3cd;
    color: #856404;
}

.status-studying {
    background: #cce5ff;
    color: #004085;
}

.status-army {
    background: #e2e3e5;
    color: #383d41;
}

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

/* Text utilities */
.text-center {
    text-align: center;
}

.text-muted {
    color: #6c757d;
}

.mt-3 {
    margin-top: 15px;
}

.mb-3 {
    margin-bottom: 15px;
}

/* Report controls */
.report-controls {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.report-controls select {
    width: 200px;
}

/* Responsive */
@media (max-width: 768px) {
    .nav ul {
        flex-direction: column;
    }
    
    .nav li {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo-container {
        flex-direction: column;
        text-align: center;
    }
    
    .report-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .report-controls select {
        width: 100%;
    }
}

.table-primary {
    background-color: #e8f4fd;
}

.table-secondary {
    background-color: #f2f2f2;
    font-weight: bold;
}

.logo-img {
    border-radius: 8px;
}

.dashboard-card-grid,
.stat-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.stat-card,
.quick-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.stat-card__label,
.quick-card__label {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-card__value,
.quick-card__value {
    font-size: 30px;
    font-weight: 700;
    color: #2c3e50;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.quick-link-card {
    display: block;
    background: white;
    border-radius: 12px;
    padding: 22px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform .2s ease, box-shadow .2s ease;
}

.quick-link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.quick-link-card h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.page-toolbar {
    background: white;
    padding: 18px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.page-toolbar__group {
    min-width: 180px;
}

.page-toolbar__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.section-card {
    background: white;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.section-card h3 {
    margin-bottom: 14px;
}

.group-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-bottom: 18px;
    color: #495057;
}

.is-disabled {
    opacity: .6;
    pointer-events: none;
}

.table td .form-control,
.table td textarea.form-control,
.table td select.form-control {
    min-width: 140px;
    font-size: 14px;
}

.table td textarea.form-control {
    resize: vertical;
}

.hero-subtitle {
    color: #6c757d;
    margin-top: 8px;
}

@media print {
    .header,
    .nav,
    .page-toolbar,
    .btn,
    .logout-btn {
        display: none !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .table-container,
    .section-card,
    .stat-card,
    .quick-link-card {
        box-shadow: none;
    }
}

@media (max-width: 768px) {
    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .page-toolbar__group {
        min-width: 100%;
    }

    .page-toolbar__actions {
        width: 100%;
    }

    .page-toolbar__actions .btn {
        width: 100%;
        text-align: center;
    }
}

.table-base-header {
    background: #f8fbff;
}

.page-hint {
    margin: 10px 0 20px;
    color: #5f6b7a;
}

.stat-card-grid--compact {
    margin-top: 10px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card--compact {
    padding: 16px;
}

.stat-card--compact .stat-card__value {
    font-size: 24px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #f3f6f9;
}

.empty-state {
    width: 100%;
    padding: 14px 16px;
    border-radius: 8px;
    background: #f8f9fb;
    color: #6c757d;
}

.empty-state--inline {
    display: block;
}

.text-muted {
    color: #6c757d;
}

.report-wide-table {
    min-width: 1700px;
}

.report-wide-table th,
.report-wide-table td {
    font-size: 13px;
}

.report-subgroup-row td,
.table-subtotal td {
    font-weight: 600;
}

.report-students-table td.text-center,
.report-summary-table td.text-center {
    white-space: nowrap;
}

@media print {
    .report-wide-table {
        min-width: 0;
    }

    .table-container {
        overflow: visible;
    }

    .report-wide-table th,
    .report-wide-table td {
        font-size: 11px;
        padding: 6px;
    }
}
