/* ============================================
   DARK THEME - Panel Empresa Profesional
   Palette: GitHub Dark Style
   ============================================ */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --border-color: #30363d;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-purple: #a371f7;
    --accent-orange: #f0883e;
    --accent-red: #f85149;
}

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

body {
    font-family: 'Inter', 'Roboto', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background-color: #0d1117;
    line-height: 1.6;
}

.header {
    background: linear-gradient(135deg, #161b22 0%, #21262d 100%);
    color: #e6edf3;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.logo-main {
    font-size: 2.5rem;
    font-weight: bold;
    color: #e6edf3;
    margin-bottom: -5px;
}

.logo-sub {
    font-size: 1rem;
    color: #8b949e;
    font-weight: 500;
}

.server-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.status-indicator {
    font-size: 1.2rem;
}

.status-text {
    font-weight: 500;
}

.container {
    margin: 30px auto;
    padding: 0 20px;
    width: 100%;
    max-width: 100%;
}

.tabs {
    display: flex;
    background: #161b22;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
    overflow: hidden;
    flex-wrap: wrap;
}

.tab {
    flex: 1;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    border: none;
    background: #161b22;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-right: 1px solid #30363d;
    min-width: 120px;
}

.tab:last-child { 
    border-right: none; 
}

.tab:hover { 
    background: #21262d; 
}

.tab.active {
    background: linear-gradient(135deg, #1f6feb 0%, #58a6ff 100%);
    color: white;
}

.tab-content { 
    display: none; 
}

.tab-content.active { 
    display: block; 
}

.card {
    background: #161b22;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
}

.card h2 {
    color: #e6edf3;
    margin-bottom: 20px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h3 {
    color: #c9d1d9;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #c9d1d9;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #30363d;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    margin: 8px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #1f6feb 0%, #58a6ff 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #0099f7 0%, #f11712 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.4); 
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
    margin: 4px;
}

.btn-mini {
    padding: 4px 8px;
    font-size: 12px;
    margin: 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
    text-decoration: none;
    color: white;
    min-width: 28px;
    text-align: center;
}

.btn-mini:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.btn-mini.btn-primary { background: #007bff; }
.btn-mini.btn-success { background: #28a745; }
.btn-mini.btn-warning { background: #ffc107; color: #212529; }
.btn-mini.btn-danger { background: #dc3545; }
.btn-mini.btn-info { background: #17a2b8; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 20px 0;
}

.stat-item {
    background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-card {
    background: #161b22;
    border: 1px solid #30363d;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    min-height: 140px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: bold;
    color: #58a6ff;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

.server-info {
    background: #21262d;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    font-family: monospace;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.table-container {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid #30363d;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #161b22;
}

.data-table th {
    background: linear-gradient(135deg, #1f6feb 0%, #238636 100%);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #30363d;
    font-size: 0.85rem;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: #21262d;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.success {
    background: #1a2e1a;
    color: #3fb950;
}

.status-badge.warning {
    background: #3d2e0f;
    color: #d29922;
}

.status-badge.error {
    background: #3d1f1f;
    color: #f85149;
}

.loading-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #4CAF50;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 10000;
}

.version-indicator {
    position: fixed;
    top: 10px;
    left: 10px;
    background: #2196F3;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 10000;
}

/* Medical Config Styles */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.config-section {
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 25px;
}

.config-section h3 {
    color: #495057;
    margin-bottom: 20px;
    font-size: 1.2rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.doctors-list, .certificate-types {
    margin-top: 15px;
}

.doctor-item, .certificate-type-item {
    background: #161b22;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.doctor-info, .certificate-info {
    flex-grow: 1;
}

.doctor-actions, .certificate-actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    padding: 6px 8px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #6c757d;
    color: white;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    transform: scale(1.05);
}

.specialty {
    display: block;
    font-size: 0.9rem;
    color: #8b949e;
    margin-top: 5px;
}

.license {
    display: block;
    font-size: 0.8rem;
    color: #495057;
    font-weight: 500;
    margin-top: 3px;
}

.duration {
    display: block;
    font-size: 0.9rem;
    color: #8b949e;
    margin-top: 5px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-actions {
    display: flex;
    gap: 10px;
}

/* Medical Dashboard Styles */
.medical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.medical-employee-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.medical-employee-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.employee-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.employee-header h4 {
    color: #e6edf3;
    margin: 0;
}

.employee-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.employee-info {
    margin-bottom: 15px;
    font-size: 14px;
    color: #8b949e;
}

.employee-info div {
    margin-bottom: 5px;
}

.medical-stats {
    margin-bottom: 15px;
}

.medical-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stat-label {
    font-weight: bold;
    color: #495057;
}

.stat-values {
    display: flex;
    gap: 10px;
}

.stat-good { color: #28a745; font-weight: bold; }
.stat-warning { color: #ffc107; font-weight: bold; }
.stat-danger { color: #dc3545; font-weight: bold; }

.employee-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.alerts-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    border-left: 4px solid;
}

.alert-warning {
    background-color: #3d2e0f;
    border-color: #ffc107;
    color: #d29922;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.alert-danger {
    background-color: #3d1f1f;
    border-color: #dc3545;
    color: #f85149;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 { font-size: 2rem; }
    .container { padding: 0 10px; }
    .tabs { flex-direction: column; }
    .tab { padding: 15px; }
    .card { padding: 20px; }
    .stats-grid { grid-template-columns: 1fr; }
    .quick-actions { flex-direction: column; }
    .data-table { font-size: 0.75rem; }
    .data-table th, .data-table td { padding: 8px 4px; }
    .config-grid { grid-template-columns: 1fr; }
    .section-header { flex-direction: column; gap: 15px; }
    .section-actions { width: 100%; justify-content: center; }
}

/* Medical Dashboard Advanced Styles */
.employee-medical-card-improved {
    border: 2px solid #30363d;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: #161b22;
    box-shadow: 0 3px 15px rgba(0,0,0,0.3);
    cursor: default;
    transition: all 0.3s ease;
}

.employee-medical-card-improved:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.15);
}

.clickable-metric {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-metric:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.medical-employees-container {
    max-height: none;
    overflow: visible;
}

.employee-header-improved {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #21262d;
}

.medical-visual-summary {
    background: linear-gradient(135deg, #21262d 0%, #ffffff 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.metric-card {
    background: #161b22;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.employee-quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 15px;
    border-top: 1px solid #30363d;
}