:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #f8fafc;
    --text: #1e293b;
    --border: #e2e8f0;
    --white: #ffffff;
}

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

body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

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

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}

.badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 8px;
}

.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
    transition: 0.2s;
}

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: #f1f5f9;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1.1rem;
}

.info-box {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.card {
    max-width: 900px;
    margin: 20px auto;
    background: var(--white);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

input,
select {
    padding: 10px;
    margin: 6px 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 100%;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px auto;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
}

.back {
    display: block;
    margin: 20px auto 0;
    max-width: 900px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
}

.err {
    color: #b91c1c;
    background: #fee2e2;
    padding: 10px;
    border-radius: 6px;
    margin: 10px auto;
    max-width: 1100px;
}

.success {
    color: #047857;
    background: #d1fae5;
    padding: 10px;
    border-radius: 6px;
    margin: 10px auto;
    max-width: 1100px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pg-btn {
    padding: 8px 14px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: 0.2s;
}

.pg-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

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

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.booked {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.completed {
    background: #d1fae5;
    color: #047857;
}

.status-badge.cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

/* Общая сетка услуг (используется врачом и пациентом) */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.service-item {
    background: #f8fafc;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.service-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.service-item.selected {
    background: #eff6ff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.service-name {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.service-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.8rem;
}

.service-duration {
    color: #64748b;
    font-size: 0.85rem;
}

.service-price {
    color: var(--primary);
    font-weight: 700;
}

.service-badge {
    display: inline-block;
    font-size: 0.7rem;
    color: #64748b;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Утилиты */
.inline-form {
    display: inline;
}

.full-width {
    width: 100%;
}

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

.mt-20 {
    margin-top: 20px;
}

.mt-25 {
    margin-top: 25px;
}

.mb-20 {
    margin-bottom: 20px;
}

.m-0 {
    margin: 0;
}

.text-muted {
    color: #64748b;
    opacity: 0.7;
}

.text-bold {
    font-weight: 600;
}

.link-primary {
    color: var(--primary);
    text-decoration: none;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.9rem;
    background: #f1f5f9;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
}

.btn-back:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}