:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --border: #dee2e6;
    --card-bg: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f5f7fb;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 900px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.4rem;
}

nav {
    background: white;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow-x: auto;
    white-space: nowrap;
}

nav a {
    display: inline-block;
    margin: 0.4rem 0.6rem 0.4rem 0;
    padding: 0.6rem 1rem;
    background: var(--light);
    color: var(--primary);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

nav a:hover {
    background: #eef2ff;
    transform: translateY(-1px);
}

main, .container {
    padding: 1.5rem 0;
}

h2 {
    margin-bottom: 1.5rem;
    color: var(--dark);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

input, select, textarea, button {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

button, .btn {
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    border-radius: 6px;
    transition: background 0.2s;
}

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

.btn-cancel, .btn-back {
    background: #6c757d;
    width: fit-content;
}

.btn-cancel:hover, .btn-back:hover {
    background: #5a6268;
}

.btn.small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.alert {
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 6px;
}

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

.login-container {
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.requests-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.request-card {
    background: white;
    border-radius: 10px;
    padding: 1.2rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.request-card.closed {
    opacity: 0.7;
    border-left-color: #95a5a6;
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.request-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--dark);
}

.priority {
    font-size: 0.85rem;
    font-weight: bold;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    background: #e0e0e0;
    color: var(--gray);
}

.priority.urgent {
    background: #ffebee;
    color: var(--danger);
}

.status span {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 500;
}

.status-new { background: #e3f2fd; color: #1976d2; }
.status-in-progress { background: #fff8e1; color: #f57f17; }
.status-closed { background: #e8f5e9; color: #2e7d32; }

.description, .response {
    margin: 0.8rem 0;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 6px;
    white-space: pre-wrap;
}

.form-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

/* Адаптив */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
    }

    nav a {
        margin: 0.3rem 0.4rem 0.3rem 0;
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }

    .request-header {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions {
        flex-direction: column;
    }
}

footer {
    background: var(--light);
    padding: 1rem;
    text-align: center;
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--gray);
    font-size: 0.9rem;
}

.main-content {
    padding: 1.5rem 1rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.filters-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.filters-card form {
    gap: 1rem;
    flex-wrap: wrap;
}

.filters-card label {
    font-size: 0.95rem;
    color: var(--gray);
}

.filters-card input,
.filters-card select {
    margin-top: 0.3rem;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.btn-icon {
    transition: transform 0.2s, opacity 0.2s;
}
.btn-icon:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

a[title] {
    transition: transform 0.2s, opacity 0.2s;
}
a[title]:hover {
    transform: scale(1.1);
    opacity: 0.95;
}