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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.container.narrow {
    max-width: 900px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 20px;
}

.header-logo {
    height: 100px;
    margin-bottom: 10px;
}

.header-title {
    color: #1e40af;
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 15px;
}

.header-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.header-controls span {
    color: #1e40af;
    font-size: 1.2em;
    font-weight: bold;
}

.title-select {
    color: #1e40af;
    font-size: 1.1em;
    font-weight: bold;
    padding: 10px 18px;
    border: 2px solid #2563eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.title-select:hover {
    background: rgba(37, 99, 235, 0.1);
}

.title-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.navbar a {
    text-decoration: none;
    color: #1e40af;
    font-weight: bold;
    padding: 10px 18px;
    border-radius: 8px;
    border: 2px solid #2563eb;
    transition: all 0.2s ease;
    font-size: 0.95em;
}

.navbar a:hover {
    background: rgba(37, 99, 235, 0.1);
}

.navbar a.active {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white;
}

/* Calendar */
.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 20px;
}

.day-header {
    background: #1e40af;
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: bold;
    border-radius: 8px;
    font-size: 0.9em;
}

.day {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px;
    min-height: 160px;
    background: white;
    transition: all 0.3s ease;
}

.day:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.25);
    border-color: #2563eb;
}

.day-number {
    font-weight: bold;
    font-size: 1.3em;
    color: #1e40af;
    margin-bottom: 8px;
    display: block;
    text-align: center;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
}

.turno {
    margin-bottom: 6px;
    font-size: 0.8em;
    line-height: 1.3;
    padding: 6px 8px;
    border-radius: 4px;
}

.turno-manha {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
}

.turno-tarde {
    background: #dbeafe;
    border-left: 3px solid #3b82f6;
}

.turno-title {
    font-weight: bold;
    color: #1d4ed8;
    display: block;
    margin-bottom: 3px;
    font-size: 0.85em;
}

.setor {
    margin-bottom: 2px;
}

.plantonista {
    color: #333;
    padding: 4px 6px;
    border: none;
    background: rgba(255,255,255,0.7);
    width: 100%;
    text-align: left;
    font-family: inherit;
    font-size: 0.9em;
    line-height: 1.2;
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 3px;
    min-height: 22px;
}

.plantonista:hover {
    background: rgba(255,255,255,0.95);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.plantonista.vazio {
    color: #aaa;
    font-style: italic;
}

.empty {
    background: #f8f9fa;
    border: 2px dashed #e0e0e0;
    min-height: 160px;
}

.weekend {
    background: #f0f9ff;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn.secondary {
    background: #f1f5f9;
    color: #1e40af;
    box-shadow: none;
    border: 2px solid #2563eb;
}

.btn.danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.btn.success {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.btn.small {
    padding: 6px 14px;
    font-size: 0.85em;
    border-radius: 6px;
}

.actions-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.save-button-container {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Legenda */
.legenda {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.legenda-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
}

.legenda-cor {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legenda-manha {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
}

.legenda-tarde {
    background: #dbeafe;
    border-left: 3px solid #3b82f6;
}

/* Tables (Radiologistas / Configuração) */
table.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

table.data-table th, table.data-table td {
    border: 1px solid #e0e0e0;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.95em;
}

table.data-table th {
    background: #1e40af;
    color: white;
}

table.data-table tr:nth-child(even) {
    background: #f8f9fa;
}

table.data-table select {
    width: 100%;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-family: inherit;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
}

.badge.ativo {
    background: #dcfce7;
    color: #15803d;
}

.badge.inativo {
    background: #fee2e2;
    color: #b91c1c;
}

.color-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    vertical-align: middle;
}

/* Form */
.form-group {
    margin-bottom: 14px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: bold;
    color: #1e40af;
    margin-bottom: 4px;
    font-size: 0.9em;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="color"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1em;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Contatos */
.contatos-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.contato-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 18px;
    transition: all 0.2s ease;
    border-left-width: 6px;
}

.contato-card:hover {
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.contato-nome {
    font-size: 1.1em;
    font-weight: bold;
    color: #1e40af;
    margin-bottom: 8px;
}

.contato-info {
    font-size: 0.95em;
    color: #444;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.contato-info a {
    color: inherit;
    text-decoration: none;
}

.contato-info a:hover {
    text-decoration: underline;
}

.whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: white !important;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: bold;
    margin-top: 6px;
}

.whatsapp-link:hover {
    background: #1ebe5a;
    text-decoration: none !important;
}

@media print {
    body {
        background: white;
        padding: 0;
    }
    .container {
        box-shadow: none;
    }
    .save-button-container, .navbar, .actions-bar {
        display: none;
    }
}

@media (max-width: 768px) {
    .calendar {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .day-header {
        display: none;
    }
    table.data-table {
        font-size: 0.85em;
    }
}
