* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', Courier, monospace;
    background-color: #ffffff;
    color: #000000;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: none;
    margin: 0;
    padding: 0;
    background: #ffffff;
    border: none;
    box-shadow: none;
    min-height: 100vh;
}

.container > header,
.container > main,
.container > .admin-main {
    padding: 30px 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.container > .admin-main-wide,
.admin-main-wide {
    max-width: min(1840px, calc(100vw - 40px));
    width: 100%;
}

/* Auth forms centered layout */
.container > .auth-form,
.container > form:not(.status-form):not(.quantity-form):not([style*="display: inline"]) {
    max-width: 500px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

header h1 {
    color: #000000;
    margin-bottom: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

header p {
    color: #666666;
}

.btn-logout {
    position: absolute;
    top: 0;
    right: 0;
    padding: 8px 16px;
    background: #000000;
    color: #ffffff;
    text-decoration: none;
    border: 2px solid #000000;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #ffffff;
    color: #000000;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #000000;
    background: #ffffff;
    color: #000000;
    font-size: 14px;
    font-family: inherit;
    border-radius: 0;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    background: #f0f0f0;
    box-shadow: 4px 4px 0px #000000;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background-color: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 0;
}

.btn-submit:hover {
    background-color: #ffffff;
    color: #000000;
    box-shadow: 4px 4px 0px #000000;
}

footer {
    margin-top: 30px;
    text-align: center;
    color: #666666;
    border-top: 2px solid #000000;
    padding-top: 20px;
}

footer a {
    color: #000000;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

.success-message {
    text-align: center;
    padding: 30px;
    background-color: #ffffff;
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px #000000;
    color: #000000;
    margin-bottom: 20px;
}

.success-message strong {
    font-size: 18px;
    text-transform: uppercase;
}

.actions {
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #000000;
    color: #ffffff;
    text-decoration: none;
    border: 2px solid #000000;
    transition: all 0.3s;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 0;
}

.btn:hover {
    background-color: #ffffff;
    color: #000000;
    box-shadow: 4px 4px 0px #000000;
}

.error-message {
    padding: 12px;
    background-color: #ffffff;
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px #000000;
    color: #000000;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

/* Shared helpers (used by “new” pages) */
.back-link {
    display: inline-block;
    margin-top: 24px;
    color: #000000;
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.dashboard-actions {
    margin-top: 24px;
    text-align: center;
}

.dashboard-actions a {
    color: #000000;
    text-decoration: none;
    font-weight: 600;
    margin: 0 10px;
}

.dashboard-actions a:hover {
    text-decoration: underline;
}

.hint {
    font-size: 0.8rem;
    color: #666666;
    margin-top: 6px;
}

.required {
    color: #000000;
    font-weight: 700;
    margin-left: 2px;
}

.data-table {
    width: 100%;
    background: #ffffff;
    border: 2px solid #000000;
    box-shadow: 8px 8px 0px #000000;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border: 1px solid #000000;
}

.data-table th {
    background-color: #000000;
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-table tr:hover {
    background-color: #f0f0f0;
}

.role-badge {
    display: inline-block;
    padding: 4px 8px;
    border: 2px solid #000000;
    color: #000000;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    background: #ffffff;
    margin: 2px 6px 2px 0;
    white-space: nowrap;
}

.signup-status {
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 10px;
}

.role-actions {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.role-action {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 2px solid #000000;
    background: #ffffff;
}

.role-action form {
    margin: 0;
}

/* Admin Styles */
.admin-container {
    min-height: 100vh;
}

.admin-nav {
    background-color: #000000;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #000000;
}

.nav-brand {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    padding: 8px 16px;
    border: 2px solid #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: #ffffff;
    color: #000000;
    box-shadow: 2px 2px 0px #ffffff;
}

.admin-main {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-main h1 {
    margin-bottom: 25px;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Calendar Styles */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 20px;
}

.calendar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.current-month {
    font-size: 20px;
    font-weight: 700;
    color: #000000;
    min-width: 200px;
    text-align: center;
    text-transform: uppercase;
}

.btn-nav {
    color: #000000;
    text-decoration: none;
    padding: 8px 16px;
    border: 2px solid #000000;
    font-weight: 600;
    transition: all 0.3s;
    text-transform: uppercase;
}

.btn-nav:hover {
    background-color: #000000;
    color: #ffffff;
    box-shadow: 2px 2px 0px #000000;
}

.btn-create {
    padding: 10px 20px;
    background-color: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-create:hover {
    background-color: #ffffff;
    color: #000000;
    box-shadow: 4px 4px 0px #000000;
}

.calendar-grid {
    background: #ffffff;
    border: 2px solid #000000;
    box-shadow: 8px 8px 0px #000000;
    overflow: hidden;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #000000;
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calendar-weekdays div {
    padding: 15px;
    text-align: center;
    border-right: 1px solid #333;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    min-height: 120px;
    padding: 10px;
    border: 1px solid #000000;
    background-color: #ffffff;
}

.calendar-day.empty {
    background-color: #f5f5f5;
}

.day-number {
    font-weight: 700;
    color: #000000;
    display: block;
    margin-bottom: 8px;
}

.day-projects {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.day-tasks {
    display: grid;
    gap: 5px;
    margin-top: 6px;
}

.project-badge {
    display: grid;
    gap: 4px;
    padding: 7px 8px;
    border: 2px solid #000000;
    font-size: 12px;
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
}

.project-badge-title,
.project-badge-meta,
.project-badge-alert,
.project-badge-ok {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-badge-title {
    font-weight: 800;
}

.project-badge-meta {
    font-size: 11px;
    opacity: 0.85;
}

.project-badge-alert,
.project-badge-ok {
    padding-top: 3px;
    border-top: 1px solid currentColor;
    font-size: 10px;
}

.status-new { background-color: #000000; color: #ffffff; }
.status-confirmed { background-color: #333333; color: #ffffff; }
.status-in_progress { background-color: #666666; color: #ffffff; }
.status-completed { background-color: #999999; color: #ffffff; }
.status-cancelled { background-color: #cccccc; color: #000000; }

.warning-overdue,
.warning-urgent {
    background-color: #ffffff;
    color: #000000;
    box-shadow: inset 0 0 0 3px #000000;
}

.warning-soon {
    background-color: #f2f2f2;
    color: #000000;
}

.warning-missing {
    background-color: #222222;
    color: #ffffff;
}

.task-badge {
    border: 2px dashed #000000;
    padding: 6px;
    background: #ffffff;
    color: #000000;
    font-size: 11px;
}

.task-deadline {
    border-style: solid;
}

.task-meeting {
    background: #f5f5f5;
}

.task-status-done,
.task-status-cancelled {
    opacity: 0.62;
}

.task-badge-main {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.task-badge-main strong,
.task-badge-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-actions {
    display: flex;
    gap: 4px;
    margin-top: 5px;
}

.task-actions form {
    margin: 0;
}

.task-actions select {
    max-width: 95px;
    border: 1px solid #000000;
    background: #ffffff;
    font-family: inherit;
    font-size: 10px;
}

.task-delete {
    width: 22px;
    height: 22px;
    border: 1px solid #000000;
    background: #000000;
    color: #ffffff;
    cursor: pointer;
    line-height: 1;
}

/* Table Styles */
.projects-table,
.equipment-table {
    width: 100%;
    background: #ffffff;
    border: 2px solid #000000;
    box-shadow: 8px 8px 0px #000000;
    border-collapse: collapse;
}

.projects-table th,
.projects-table td,
.equipment-table th,
.equipment-table td {
    padding: 15px;
    text-align: left;
    border: 1px solid #000000;
}

.projects-table th,
.equipment-table th {
    background-color: #000000;
    color: #ffffff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.projects-table tr:hover,
.equipment-table tr:hover {
    background-color: #f0f0f0;
}

.description-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    padding: 5px 12px;
    border: 2px solid #000000;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
    background: transparent;
}

.status-form select {
    padding: 8px 12px;
    border: 2px solid #000000;
    background: #ffffff;
    color: #000000;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
}

/* Warehouse specific */
.warehouse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.stock-status {
    padding: 5px 12px;
    border: 2px solid #000000;
    font-size: 12px;
    font-weight: 700;
    display: inline-block;
    text-transform: uppercase;
    background: #ffffff;
}

.in-stock {
    background-color: #ffffff;
    color: #000000;
}

.low-stock {
    background-color: #f0f0f0;
    color: #000000;
}

.out-of-stock {
    background-color: #e0e0e0;
    color: #000000;
}

.quantity-form input {
    padding: 8px;
    border: 2px solid #000000;
    background: #ffffff;
    color: #000000;
    text-align: center;
    font-weight: 600;
}

.quantity-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.quantity-form input[type="number"] {
    width: 70px;
}

.quantity-form select {
    padding: 8px;
    border: 2px solid #000000;
    background: #ffffff;
    font-family: inherit;
}

.compact-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.compact-checkbox input {
    width: auto;
}

.warehouse-section {
    margin-bottom: 36px;
}

.form-section {
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px #000000;
    padding: 20px;
    margin-bottom: 24px;
    background: #ffffff;
}

.form-section h2 {
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.request-form {
    max-width: 960px;
    margin: 0 auto;
}

.conditional-row {
    margin-top: 16px;
}

.warehouse-section h2 {
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.warehouse-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.warehouse-form {
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px #000000;
    padding: 20px;
    background: #ffffff;
}

.compact-warehouse-form {
    margin-bottom: 24px;
}

.warehouse-filters,
.warehouse-selector {
    border: 2px solid #000000;
    padding: 16px;
    margin-bottom: 18px;
    background: #ffffff;
}

.warehouse-form h3 {
    margin-bottom: 16px;
    text-transform: uppercase;
}

.equipment-name {
    position: relative;
    display: inline-block;
    font-weight: 700;
}

.equipment-preview {
    display: none;
    position: absolute;
    z-index: 20;
    top: 24px;
    left: 0;
    width: 220px;
    padding: 8px;
    border: 2px solid #000000;
    background: #ffffff;
    box-shadow: 4px 4px 0px #000000;
}

.equipment-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.equipment-name:hover .equipment-preview {
    display: block;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 30px;
    border: 2px solid #000000;
    box-shadow: 8px 8px 0px #000000;
    width: 90%;
    max-width: 500px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close,
.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: 700;
    color: #000000;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close-modal:hover {
    color: #666666;
}

.modal-content h2 {
    margin-bottom: 25px;
    color: #000000;
    text-transform: uppercase;
}

.login-form {
    max-width: 400px;
    margin: 0 auto;
}

/* User Navigation */
.user-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #000000;
}

.user-nav a {
    padding: 10px 20px;
    border: 2px solid #000000;
    text-decoration: none;
    color: #000000;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s;
}

.user-nav a:hover,
.user-nav a.active {
    background-color: #000000;
    color: #ffffff;
    box-shadow: 4px 4px 0px #000000;
}

.user-nav .btn-new {
    margin-left: auto;
}

/* Projects Grid for User Dashboard */
.projects-section {
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.projects-grid {
    display: grid;
    gap: 20px;
}

.project-card {
    border: 2px solid #000000;
    padding: 20px;
    background: #ffffff;
    box-shadow: 4px 4px 0px #000000;
    transition: all 0.3s;
}

.project-card:hover {
    box-shadow: 8px 8px 0px #000000;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #000000;
}

.project-header h3 {
    color: #000000;
    text-transform: uppercase;
    font-size: 18px;
}

.project-body {
    margin-bottom: 15px;
}

.project-body p {
    margin-bottom: 8px;
}

.project-date {
    font-weight: 700;
    text-transform: uppercase;
}

.project-footer {
    padding-top: 10px;
    border-top: 1px solid #000000;
    color: #666666;
}

.empty-state {
    text-align: center;
    padding: 40px;
    border: 2px solid #000000;
    background: #f9f9f9;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .calendar-header {
        flex-direction: column;
        align-items: stretch;
    }

    .calendar-navigation {
        justify-content: center;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .projects-table,
    .equipment-table {
        font-size: 12px;
    }

    .projects-table th,
    .projects-table td,
    .equipment-table th,
    .equipment-table td {
        padding: 10px 8px;
    }

    .user-nav {
        flex-direction: column;
    }

    .user-nav .btn-new {
        margin-left: 0;
    }
}
/* Additional styles */

/* Profile section styles */
.profile-section {
    margin-bottom: 40px;
}

.profile-section h2,
.projects-section h2,
.knowledge-section h2 {
    padding: 0 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
}

/* Big points card at top */
.points-card {
    background: #ffffff;
    border: 2px solid #000000;
    padding: 25px 30px;
    box-shadow: 6px 6px 0px #000000;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.points-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.points-label {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.points-value-large {
    font-size: 48px;
    font-weight: 700;
}

.progress-bar-large {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border: 2px solid #000000;
    position: relative;
    margin-bottom: 10px;
}

.points-remaining {
    display: block;
    text-align: right;
    color: #666666;
}

/* Small grid for level and exam */
.profile-grid-small {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 600px) {
    .profile-grid-small {
        grid-template-columns: 1fr;
    }
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.profile-card {
    background: #ffffff;
    border: 2px solid #000000;
    padding: 20px;
    box-shadow: 4px 4px 0px #000000;
    text-align: center;
}

.profile-card h3 {
    font-size: 14px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.level-display {
    font-size: 24px;
    font-weight: 700;
    padding: 15px;
    border: 2px solid #000000;
    text-transform: uppercase;
}

.level-display.level-Студент,
.level-display.level-Lvl1,
.level-display.level-Lvl2,
.level-display.level-Lvl3,
.level-display.level-Extra {
    background: #000000;
    color: #ffffff;
}

.points-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.points-value {
    font-size: 36px;
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border: 2px solid #000000;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: #000000;
    transition: width 0.3s ease;
}

.exam-status {
    font-size: 18px;
    font-weight: 700;
    padding: 10px;
    border: 2px solid #000000;
    text-transform: uppercase;
}

.exam-status.passed {
    background: #000000;
    color: #ffffff;
}

.exam-status.not-passed {
    background: #ffffff;
    color: #000000;
}

.events-section {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.events-section h2 {
    padding: 0 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
}

.knowledge-section {
    margin-top: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.kb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.kb-card {
    background: #ffffff;
    border: 2px solid #000000;
    padding: 20px;
    box-shadow: 4px 4px 0px #000000;
}

.kb-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.kb-card p {
    font-size: 14px;
    margin-bottom: 15px;
}

.kb-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.kb-card-large {
    background: #ffffff;
    border: 2px solid #000000;
    padding: 30px;
    box-shadow: 6px 6px 0px #000000;
}

.kb-card-large h2 {
    font-size: 20px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.kb-content {
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.8;
}

.kb-date {
    display: block;
    margin-top: 15px;
    color: #666666;
    font-size: 12px;
}

.level-info {
    margin-top: 40px;
    padding: 20px;
    border: 2px solid #000000;
    background: #f9f9f9;
}

.level-info h3 {
    margin-bottom: 15px;
    text-transform: uppercase;
}

.level-info ul {
    list-style: none;
    padding-left: 0;
}

.level-info li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.level-info li:last-child {
    border-bottom: none;
}

.note {
    margin-top: 15px;
    font-style: italic;
    color: #666666;
}

.small-input {
    width: 80px;
    padding: 5px;
    border: 2px solid #000000;
    font-family: inherit;
    font-size: 14px;
}

.small-select {
    padding: 5px;
    border: 2px solid #000000;
    font-family: inherit;
    font-size: 14px;
    background: #ffffff;
}

.btn-small {
    padding: 5px 10px;
    font-size: 14px;
}

.btn-danger {
    background: #ffffff;
    color: #000000;
    border-color: #000000;
    box-shadow: inset 0 0 0 2px #000000;
}

.file-state {
    display: block;
    margin-top: 6px;
    color: #555555;
    font-size: 12px;
    font-weight: 700;
}

.setup-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
    gap: 20px;
    align-items: start;
}

.setup-layout > .form-group {
    margin-bottom: 20px;
}

.setup-preview-card {
    grid-column: 2;
    grid-row: 1 / span 3;
    min-height: 260px;
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px #000000;
    padding: 14px;
    background: #ffffff;
}

.setup-preview-card h3 {
    margin-bottom: 12px;
    text-transform: uppercase;
    font-size: 14px;
}

.setup-preview-card img {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    border: 2px solid #000000;
    background: #ffffff;
}

.setup-preview-card a {
    display: inline-block;
    color: #000000;
    border-bottom: 2px solid #000000;
    text-decoration: none;
    font-weight: 700;
}

.setup-preview-empty {
    min-height: 180px;
    display: grid;
    place-items: center;
    border: 2px dashed #000000;
    padding: 16px;
    color: #666666;
    text-align: center;
    font-weight: 700;
}

#setup-preview-notes {
    margin-top: 10px;
    color: #555555;
    font-size: 13px;
}

.modal-content-wide {
    max-width: 900px;
}

.toolbar-panel {
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px #000000;
    padding: 20px;
    margin-bottom: 24px;
    background: #ffffff;
}

.filters-form,
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: end;
}

.filters-form .form-group,
.student-form .form-group {
    margin-bottom: 0;
}

.checkbox-group {
    margin: 20px 0;
    padding: 16px;
    border: 2px solid #000000;
}

.checkbox-group legend {
    padding: 0 8px;
    font-weight: 700;
    text-transform: uppercase;
}

.checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 20px;
    font-weight: 700;
}

.checkbox-group input {
    width: auto;
}

.profile-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    border: 2px solid #000000;
    padding: 16px;
    margin-bottom: 20px;
    background: #ffffff;
}

.profile-details > div {
    min-width: 0;
}

.profile-label {
    display: block;
    color: #666666;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    padding: 0 8px 8px 0;
    max-width: 100%;
}

.table-scroll .data-table,
.table-scroll .projects-table,
.table-scroll .equipment-table {
    min-width: 100%;
}

.table-scroll-users {
    max-height: calc(100vh - 260px);
    overflow: auto;
}

.users-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 12px;
}

.users-table th,
.users-table td {
    padding: 8px 9px;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.users-table .role-badge,
.users-table .status-badge {
    font-size: 10px;
    padding: 3px 5px;
}

.users-table .small-select,
.users-table .small-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 11px;
}

.users-table .actions-cell {
    min-width: 0;
}

.users-table .inline-form {
    margin-bottom: 6px;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) {
    width: 16%;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2),
.users-table th:nth-child(4),
.users-table td:nth-child(4),
.users-table th:nth-child(5),
.users-table td:nth-child(5),
.users-table th:nth-child(6),
.users-table td:nth-child(6),
.users-table th:nth-child(7),
.users-table td:nth-child(7) {
    width: 8%;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3),
.users-table th:nth-child(8),
.users-table td:nth-child(8),
.users-table th:nth-child(9),
.users-table td:nth-child(9),
.users-table th:nth-child(11),
.users-table td:nth-child(11) {
    width: 7%;
}

.users-table th:nth-child(10),
.users-table td:nth-child(10) {
    width: 5%;
}

.users-table th:nth-child(12),
.users-table td:nth-child(12) {
    width: 11%;
}

.table-scroll-projects .projects-table {
    min-width: 1480px;
}

.table-scroll-projects .role-badge {
    display: block;
    width: max-content;
    max-width: 100%;
}

.muted {
    color: #666666;
    font-size: 12px;
    margin-top: 4px;
}

.empty-cell {
    text-align: center;
    color: #666666;
    font-weight: 700;
    text-transform: uppercase;
}

.actions-cell {
    min-width: 190px;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 2px 0;
}

.alert {
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px #000000;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-weight: 700;
    background: #ffffff;
}

.alert-error {
    background: #000000;
    color: #ffffff;
}

.alert-success {
    background: #ffffff;
    color: #000000;
}

.import-preview-table td {
    vertical-align: top;
}

.row-error {
    background: #f2f2f2;
}

.row-error td:last-child {
    font-weight: 700;
}

.confirm-import-form {
    margin-top: 20px;
}

.hidden-textarea {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
}

.table-link {
    color: #000000;
    text-decoration: none;
    border-bottom: 2px solid #000000;
}

.table-link:hover {
    background: #000000;
    color: #ffffff;
}

.student-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.student-detail-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.4fr);
    gap: 24px;
}

.role-detail-list {
    display: grid;
    gap: 12px;
}

.role-detail-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    border: 2px solid #000000;
    padding: 12px;
    background: #ffffff;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stats-grid > div {
    border: 2px solid #000000;
    padding: 12px;
    background: #ffffff;
}

.stats-grid strong {
    display: block;
    font-size: 24px;
}

.compact-points-card {
    margin-top: 0;
}

.knowledge-editor-form textarea {
    resize: vertical;
}

.kb-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.kb-card-large .role-badge {
    margin-left: 0;
}

@media (max-width: 900px) {
    .student-detail-grid {
        grid-template-columns: 1fr;
    }

    .setup-layout {
        grid-template-columns: 1fr;
    }

    .setup-preview-card {
        grid-column: 1;
        grid-row: auto;
    }
}

.level-badge {
    display: inline-block;
    padding: 4px 8px;
    border: 2px solid #000000;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.level-badge.level-Студент,
.level-badge.level-Lvl1,
.level-badge.level-Lvl2,
.level-badge.level-Lvl3,
.level-badge.level-Extra {
    background: #000000;
    color: #ffffff;
}

.hero {
    text-align: center;
    padding: 40px 0;
}

.hero h2 {
    font-size: 28px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero-text {
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.info-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.info-block {
    background: #ffffff;
    border: 2px solid #000000;
    padding: 30px 20px;
    box-shadow: 6px 6px 0px #000000;
}

.info-block h3 {
    font-size: 18px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.info-block p {
    font-size: 14px;
    line-height: 1.6;
}

.cta-section {
    margin-top: 60px;
    padding: 40px;
    border: 2px solid #000000;
    background: #000000;
    color: #ffffff;
}

.cta-text {
    font-size: 18px;
    margin-bottom: 25px;
    text-transform: uppercase;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
}

.btn-secondary:hover {
    background: #000000;
    color: #ffffff;
}

/* Main Navigation - Unified for all users */
.main-nav {
    background-color: #000000;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #000000;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.main-nav .nav-brand a {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
}

.main-nav .nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.main-nav .nav-links a {
    color: #ffffff;
    text-decoration: none;
    padding: 8px 14px;
    border: 2px solid #ffffff;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    white-space: nowrap;
}

.theme-toggle {
    padding: 8px 14px;
    border: 2px solid #ffffff;
    background: #000000;
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main-nav .nav-links a:hover,
.main-nav .nav-links a.active {
    background-color: #ffffff;
    color: #000000;
    box-shadow: 2px 2px 0px #ffffff;
}

.main-nav .nav-links .nav-logout {
    background-color: #ffffff;
    color: #000000;
}

.main-nav .nav-links .nav-logout:hover {
    background-color: #000000;
    color: #ffffff;
    box-shadow: 2px 2px 0px #ffffff;
}

@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        margin: -30px -30px 20px -30px;
    }
    
    .main-nav .nav-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main-nav {
        margin: -20px -20px 20px -20px;
        padding: 10px;
    }
    
    .main-nav .nav-brand a {
        font-size: 16px;
    }
    
    .main-nav .nav-links {
        gap: 8px;
    }
    
    .main-nav .nav-links a {
        padding: 6px 10px;
        font-size: 11px;
        letter-spacing: 0.5px;
    }
    
    .container > header,
    .container > main,
    .container > .admin-main {
        padding: 20px;
    }
}

body.theme-dark {
    background: #0f0f0f;
    color: #f2f2f2;
}

body.theme-dark .container,
body.theme-dark .admin-main,
body.theme-dark .form-section,
body.theme-dark .warehouse-form,
body.theme-dark .toolbar-panel,
body.theme-dark .warehouse-filters,
body.theme-dark .warehouse-selector,
body.theme-dark .profile-card,
body.theme-dark .profile-details,
body.theme-dark .knowledge-section,
body.theme-dark .kb-card,
body.theme-dark .kb-card-large,
body.theme-dark .project-card,
body.theme-dark .info-block,
body.theme-dark .empty-state,
body.theme-dark .modal-content,
body.theme-dark .setup-preview-card,
body.theme-dark .alert,
body.theme-dark .stats-grid > div,
body.theme-dark .role-action,
body.theme-dark .role-detail-item {
    background: #181818;
    color: #f2f2f2;
    border-color: #f2f2f2;
    box-shadow: 4px 4px 0px #f2f2f2;
}

body.theme-dark header h1,
body.theme-dark .admin-main h1,
body.theme-dark .form-group label,
body.theme-dark .warehouse-section h2,
body.theme-dark .form-section h2,
body.theme-dark .profile-card h3,
body.theme-dark .kb-card h3,
body.theme-dark .kb-card-large h2,
body.theme-dark .hero h2,
body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3 {
    color: #f2f2f2;
}

body.theme-dark header p,
body.theme-dark .muted,
body.theme-dark .file-state,
body.theme-dark .profile-label,
body.theme-dark .setup-preview-empty,
body.theme-dark #setup-preview-notes,
body.theme-dark footer {
    color: #b8b8b8;
}

body.theme-dark .form-group input,
body.theme-dark .form-group textarea,
body.theme-dark .form-group select,
body.theme-dark .small-select,
body.theme-dark .quantity-form select,
body.theme-dark .task-actions select,
body.theme-dark .status-form select {
    background: #101010;
    color: #f2f2f2;
    border-color: #f2f2f2;
}

body.theme-dark .form-group input:focus,
body.theme-dark .form-group textarea:focus,
body.theme-dark .form-group select:focus {
    background: #202020;
    box-shadow: 4px 4px 0px #f2f2f2;
}

body.theme-dark .projects-table,
body.theme-dark .equipment-table,
body.theme-dark .data-table {
    background: #181818;
    color: #f2f2f2;
    border-color: #f2f2f2;
    box-shadow: 8px 8px 0px #f2f2f2;
}

body.theme-dark .projects-table th,
body.theme-dark .equipment-table th,
body.theme-dark .data-table th {
    background: #f2f2f2;
    color: #101010;
}

body.theme-dark .projects-table td,
body.theme-dark .equipment-table td,
body.theme-dark .data-table td {
    border-color: #f2f2f2;
}

body.theme-dark .projects-table tr:hover,
body.theme-dark .equipment-table tr:hover,
body.theme-dark .data-table tr:hover {
    background: #252525;
}

body.theme-dark .btn,
body.theme-dark .btn-submit,
body.theme-dark .btn-create,
body.theme-dark .btn-nav,
body.theme-dark .btn-secondary,
body.theme-dark .btn-logout,
body.theme-dark .task-delete {
    background: #f2f2f2;
    color: #101010;
    border-color: #f2f2f2;
}

body.theme-dark .btn:hover,
body.theme-dark .btn-submit:hover,
body.theme-dark .btn-create:hover,
body.theme-dark .btn-nav:hover,
body.theme-dark .btn-secondary:hover,
body.theme-dark .btn-logout:hover {
    background: #101010;
    color: #f2f2f2;
    box-shadow: 4px 4px 0px #f2f2f2;
}

body.theme-dark .main-nav,
body.theme-dark .admin-nav {
    background: #050505;
    border-color: #f2f2f2;
}

body.theme-dark .main-nav .nav-links a,
body.theme-dark .theme-toggle,
body.theme-dark .admin-nav .nav-links a {
    background: #050505;
    color: #f2f2f2;
    border-color: #f2f2f2;
}

body.theme-dark .main-nav .nav-links a:hover,
body.theme-dark .main-nav .nav-links a.active,
body.theme-dark .theme-toggle:hover,
body.theme-dark .admin-nav .nav-links a:hover,
body.theme-dark .admin-nav .nav-links a.active {
    background: #f2f2f2;
    color: #101010;
    box-shadow: 2px 2px 0px #f2f2f2;
}

body.theme-dark .main-nav .nav-links .nav-logout {
    background: #f2f2f2;
    color: #101010;
}

body.theme-dark .setup-preview-card img,
body.theme-dark .setup-preview-empty,
body.theme-dark .equipment-preview,
body.theme-dark .checkbox-group,
body.theme-dark .role-badge,
body.theme-dark .level-badge,
body.theme-dark .status-badge {
    border-color: #f2f2f2;
}

body.theme-dark .role-badge,
body.theme-dark .status-badge.status-new,
body.theme-dark .status-badge.status-confirmed,
body.theme-dark .status-badge.status-in_progress,
body.theme-dark .status-badge.status-completed,
body.theme-dark .status-badge.status-cancelled {
    background: #f2f2f2;
    color: #101010;
}

body.theme-dark .setup-preview-card a,
body.theme-dark .table-link,
body.theme-dark footer a {
    color: #f2f2f2;
    border-color: #f2f2f2;
}

body.theme-dark .status-new,
body.theme-dark .level-badge.level-РЎС‚СѓРґРµРЅС‚,
body.theme-dark .level-badge.level-Lvl1,
body.theme-dark .level-badge.level-Lvl2,
body.theme-dark .level-badge.level-Lvl3,
body.theme-dark .level-badge.level-Extra {
    background: #f2f2f2;
    color: #101010;
}
