/* ============================================================
   Comarch MedNote Sync — Frontend Styles
   Dopasowane do projektu Figma
   ============================================================ */

.cms-no-results { color: #888; font-style: italic; padding: 16px 0; }

/* ============================================================
   1. USŁUGI — TABELA (Figma screen 1)
   ============================================================ */

.cms-services-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.cms-services-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    color: #1a1a1a;
    background: #fff;
    border: 1px solid #ddd;
}

.cms-services-table thead tr { background: #f0f0f0; }
.cms-services-table thead th {
    padding: 14px 20px;
    text-align: left;
    font-weight: 500;
    font-size: 14px;
    color: #333;
    border: 1px solid #ddd;
    white-space: nowrap;
}

.cms-services-table .col-name  { width: 42%; }
.cms-services-table .col-code  { width: 12%; }
.cms-services-table .col-notes { width: 32%; }
.cms-services-table .col-price { width: 14%; text-align: right; }
.cms-services-table thead th.col-price { text-align: right; }

.cms-services-table tbody tr { border-bottom: 1px solid #e0e0e0; transition: background .15s; }
.cms-services-table tbody tr:last-child { border-bottom: 1px solid #ddd; }
.cms-services-table tbody tr:hover { background: #f8f9ff; }
.cms-services-table tbody td {
    padding: 18px 20px;
    vertical-align: middle;
    border: 1px solid #e8e8e8;
    font-size: 15px;
    color: #222;
}

/* Blue link name */
.cms-svc-name-cell { color: #2f54d0; font-weight: 400; text-decoration: none; cursor: default; }
.cms-svc-name-cell:hover { color: #1a3aad; text-decoration: underline; }

.cms-svc-code  { color: #333; font-size: 14px; }
.cms-svc-notes { color: #444; font-size: 14px; }
.cms-svc-price { text-align: right; font-weight: 400; color: #1a1a1a; white-space: nowrap; }

/* ============================================================
   2. LEKARZE (Figma screen 2)
   ============================================================ */

.cms-doctors-wrap { width: 100%; }

/* Category tabs */
.cms-doctors-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 28px;
}
.cms-doctors-tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 400;
    color: #888;
    cursor: pointer;
    transition: color .2s, border-color .2s, background .2s;
    white-space: nowrap;
    margin-bottom: -1px;
}
.cms-doctors-tab-btn:hover { color: #333; background: #f8f8f8; }
.cms-doctors-tab-btn.active { color: #1a1a1a; font-weight: 600; border-bottom-color: #1a1a1a; background: #fff; }

/* Specialization filter pills */
.cms-doctors-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.cms-filter-pill {
    background: #fff;
    border: 1.5px solid #d0d0d0;
    border-radius: 99px;
    padding: 7px 18px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    font-family: inherit;
}
.cms-filter-pill:hover { border-color: #1a3aad; color: #1a3aad; background: #f0f4ff; }
.cms-filter-pill.active { background: #1e3a6e; border-color: #1e3a6e; color: #fff; font-weight: 600; }

/* Doctor grid */
.cms-doctors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Doctor card */
.cms-doctor-card { background: #fff; border-radius: 12px; overflow: hidden; text-align: center; transition: transform .2s, box-shadow .2s; }
.cms-doctor-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.10); }

/* Photo */
.cms-doctor-photo-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #e3e3e3;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
}
.cms-doctor-photo-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cms-doctor-photo-placeholder {
    width: 100%; height: 100%;
    background: #e3e3e3;
    display: flex; align-items: center; justify-content: center;
}
.cms-doctor-photo-placeholder svg { width: 52px; height: 52px; opacity: .3; }

/* Name & spec */
.cms-doctor-name { font-size: 14px; font-weight: 700; color: #1a1a1a; margin: 0 0 5px; line-height: 1.3; }
.cms-doctor-spec { font-size: 13px; color: #555; margin: 0; line-height: 1.4; }

/* Filter hidden state */
.cms-doctor-card.cms-hidden { display: none; }

/* ── Responsive ── */
@media (max-width: 1024px) { .cms-doctors-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  {
    .cms-doctors-grid { grid-template-columns: repeat(2, 1fr); }
    .cms-doctors-tab-btn { padding: 10px 14px; font-size: 13px; }
    .cms-services-table thead th, .cms-services-table tbody td { padding: 12px 14px; }
}
@media (max-width: 480px) {
    .cms-doctors-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .cms-services-table .col-notes { display: none; }
}

/* ============================================================
   3. KARTA LEKARZA — link wrapper
   ============================================================ */

a.cms-doctor-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
a.cms-doctor-card-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    text-decoration: none;
}
a.cms-doctor-card-link .cms-doctor-name,
a.cms-doctor-card-link .cms-doctor-spec {
    color: inherit;
}

/* ============================================================
   4. PROFIL LEKARZA (widget-doctor-profile)
   ============================================================ */

.cms-profile {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}
.cms-profile.cms-profile-vertical {
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.cms-profile.cms-profile-vertical .cms-profile-specjalizacje,
.cms-profile.cms-profile-vertical .cms-profile-list,
.cms-profile.cms-profile-vertical .cms-profile-tags {
    justify-content: center;
}

/* Photo */
.cms-profile-photo-wrap {
    width: 220px;
    min-width: 220px;
    height: 220px;
    border-radius: 16px;
    overflow: hidden;
    background: #e3e3e3;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cms-profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cms-profile-photo-placeholder svg {
    width: 64px;
    height: 64px;
    opacity: .3;
}
.cms-profile-initials {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    background: #1e3a6e;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: .05em;
}

/* Info */
.cms-profile-info {
    flex: 1;
    min-width: 0;
}
.cms-profile-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 4px;
    line-height: 1.2;
    color: #1a1a1a;
}
.cms-profile-typ {
    font-size: 1rem;
    color: #555;
    margin: 0 0 12px;
    font-weight: 500;
}

/* Specialization badges */
.cms-profile-specjalizacje {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.cms-profile-spec {
    display: inline-block;
    background: #e8f0fe;
    color: #1a56db;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: .85rem;
    font-weight: 600;
}

/* Bio */
.cms-profile-bio {
    font-size: .95rem;
    color: #444;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* Meta */
.cms-profile-meta {
    font-size: .85rem;
    color: #666;
    margin: 0 0 8px;
}
.cms-meta-label { font-weight: 600; color: #333; }

/* Sections */
.cms-profile-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}
.cms-profile-section-title {
    font-size: .9rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.cms-profile-list {
    margin: 0;
    padding: 0 0 0 18px;
    font-size: .9rem;
    color: #444;
    line-height: 1.8;
}

/* Tags (languages) */
.cms-profile-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cms-tag {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: .82rem;
    color: #444;
}

/* Button */
.cms-profile-actions { margin-top: 24px; }
.cms-profile-btn {
    display: inline-block;
    background: #1e3a6e;
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, transform .15s;
}
.cms-profile-btn:hover {
    background: #16305c;
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

/* Editor notice */
.cms-editor-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 16px 20px;
    font-size: .9rem;
    color: #664d03;
}

/* ============================================================
   5. PROCEDURY LEKARZA (widget-doctor-procedures)
   ============================================================ */

.cms-proc-grouped { display: flex; flex-direction: column; gap: 32px; }

.cms-proc-group-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Lokalizacje cen pod nazwą usługi */
.cms-svc-loki {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}
.cms-svc-loki small {
    font-size: .78rem;
    color: #777;
}

/* List view */
.cms-proc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cms-proc-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
}
.cms-proc-list-item .cms-svc-name-cell { flex: 1; }
.cms-proc-list-item .cms-svc-price { margin-left: auto; font-weight: 700; white-space: nowrap; }
.cms-proc-kanal {
    font-size: .8rem;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    color: #555;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .cms-profile { flex-direction: column; align-items: center; text-align: center; }
    .cms-profile-photo-wrap { width: 160px; min-width: 160px; height: 160px; }
    .cms-profile-specjalizacje { justify-content: center; }
    .cms-profile-list { padding-left: 0; list-style: none; }
}

/* ── Lekarze pod nazwą procedury w tabeli ── */
.cms-svc-personel {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 5px;
}
.cms-svc-personel-link {
    font-size: .78rem;
    color: #1e3a6e;
    text-decoration: none;
    background: #eef2fb;
    border-radius: 3px;
    padding: 1px 7px;
    white-space: nowrap;
    transition: background .15s;
}
a.cms-svc-personel-link:hover {
    background: #d5e0f8;
    text-decoration: none;
}

/* ============================================================
   6. PERSONEL PROCEDURY — nagłówek procedury na stronie listy
   ============================================================ */

.cms-proc-page-header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e0e0e0;
}
.cms-proc-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    flex: 1;
    min-width: 200px;
}
.cms-proc-page-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e3a6e;
    white-space: nowrap;
}
.cms-proc-page-kanal {
    font-size: .85rem;
    background: #f0f4ff;
    color: #1a3aad;
    border-radius: 20px;
    padding: 3px 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* service name as link */
a.cms-svc-name-cell {
    text-decoration: none;
    transition: color .15s;
}
a.cms-svc-name-cell:hover {
    text-decoration: underline;
}
