
/* css/style.css */
/* ------------------------------
   BASE
------------------------------ */

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background: #ffffff;
}

/* Contenedor principal (Sidebar + contenido) */
.dasboard {
    display: flex;
    min-height: 100vh;
}

/* ------------------------------
   LOGIN
------------------------------ */

.login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Tarjeta central */
.login-container {
    width: 350px;
    text-align: left;
}

/* Título simple */
.login-title {
    font-size: 1.7rem;
    color: #1a1a1a;
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
}

/* Inputs */
.input-group {
    margin-bottom: 18px;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #333;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #9d9c9c;
    background: #c9c9cf;
    font-size: 0.95rem;
    box-sizing: border-box;
}


.login-btn {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: none;
    background: #5a7bd8;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
}

.login-btn:hover {
    background: #6e8ff5;
}

/* Error */
.login-error {
    color: red;
    background: #ffe6e6;
    padding: 8px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.logo {
    text-align: center;
    margin-bottom: 0;
}

.logo img {
    width: 200px;
    height: auto;
}

/* ------------------------------
   SIDEBAR
------------------------------ */
.sidebar {
    width: 240px;
    background: #5a7bd8;
    color: white;
    display: flex;
    flex-direction: column;
    /*position: relative;*/
    padding: 20px 0;
    min-height: 100vh;
    height: auto;
    flex-shrink: 0;
}

/* seccion del usuario */
.sidebar-user {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 10px;
    border-radius: 10px;
    width: calc(100% - 40px);
    margin: 0 auto 25px;
    text-align: center;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    /*color: #ffffff;*/
    margin: 0;
}

.user-role {
    font-size: 0.8rem;
    color: #e4e4f9;
    margin-top: 3px;
}
/**************************/
.sidebar-menu a {
    display: block;
    padding: 12px 15px;
    margin-bottom: 8px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #6e8ff5;
}

.sidebar-menu .logout {
    margin-top: auto;
    background: #4a64c2;
}

.sidebar-menu .logout:hover {
    background: #4056b0;
}

.no-sidebar-click .sidebar a {
    pointer-events: none;
    opacity: 0.4;
}


.overlay-mode::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55); /* negro con transparencia */
    z-index: 10;
}

/* ---- Bloquear clics en el fondo ---- */

.overlay-mode .sidebar,
.overlay-mode .main-content {
    pointer-events: none;
}

/* ---- El formulario debe estar encima ---- */

.overlay-mode .form-card {
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin: 40px auto;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 0 25px rgba(0,0,0,0.25);
}

/* ------------------------------
   CONTENIDO PRINCIPAL
------------------------------ */
.main-content {
    flex: 1;
    padding: 30px;
    background: #f4f6fc;
}

.info h1 {
    margin-bottom: 0;
    font-size: 2rem;
}

.info p {
    margin-top: 4px;
    font-style: italic;
    color: #555;
}

/* ------------------------------
   CARDS
------------------------------ */
.cards-container {
    display: flex;
    gap: 20px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    flex: 1 1 200px;
}

.card h2 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 10px;
}

.card-number {
    font-size: 2rem;
    font-weight: bold;
    color: #5a7bd8;
}

/* Próximas citas */
.next-appointments {
    margin-top: 40px;
}

.next-appointments h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.next-appointments ul {
    list-style: none;
    padding-left: 0;
}

.next-appointments ul li {
    background: white;
    margin-bottom: 10px;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* --- Reutilizando tu LI existente, solo se agrega este badge --- */

.app-item {
    display: flex;
    justify-content: space-between;
}

.app-info strong {
    font-size: 1rem;
    color: #333;
}

.app-diagnostico {
    font-size: 0.85rem;
    color: #666;
}


/* contenedor del lado derecho */
.app-meta {
    display: flex;
    align-items: center;        /* estado se centra respecto a la columna */
    gap: 20px;
}

/* Fecha + Estado en la fila superior */
.fecha-hora {
    display: flex;
    flex-direction: column;  /* <-- Hace que la hora quede centrado verticalmente */
    align-items: flex-end;
}

.app-date {
    font-size: 0.9rem;
    color: #4a4646;
    font-weight: 600;
}

/* Hora debajo */
.app-time {
    font-size: 0.9rem;
    color: #555;
}


/* Badges mínimos */
.estado-badge {
    padding: 4px 11px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.estado-badge.pendiente {
    background: #fff3cd;
    color: #856404;
}

.estado-badge.confirmado {
    background: #cce5ff;
    color: #004085;
}

.estado-badge.atendido {
    background: #d4edda;
    color: #155724;
}
.estado-badge.cancelado {
    background: #f66f6f;
    color: #e52a33;
}


/* ------------------------------
   TABLAS
------------------------------ */
.table-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
}

.styled-table thead tr {
    background: #5a7bd8;
    color: white;
}

.styled-table th, .styled-table td {
    padding: 12px;
    text-align: left;
}

.styled-table tbody tr:nth-child(even) {
    background: #f2f4fa;
}

.empty {
    text-align: center;
    font-style: italic;
}

/* ------------------------------
   FORMULARIOS
------------------------------ */

.form-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    margin-top: 25px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group.full {
    width: 100%;
}

.form-group input,
.form-group textarea{
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #bfbfbf;
    background: #eef0f6;
}

.btn-save {
    background: #5a7bd8;
    color: white;
    padding: 12px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.btn-save:hover {
    background: #6e8ff5;
}

/* ----------------------
   LISTA DE PACIENTES
----------------------- */

.top-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.btn-new {
    background: #5a7bd8;
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
}

.btn-new:hover {
    background: #6e8ff5;
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-form input {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.search-form button {
    padding: 8px 12px;
    border: none;
    background: #5a7bd8;
    border-radius: 6px;
    color: white;
    cursor: pointer;
}

.search-form button:hover {
    background: #6e8ff5;
}


/* Botones */
.actions a {
    font-size: 1.1rem;
    margin-right: 10px;
    text-decoration: none;
}


.btn-edit:hover {
    color: #4a64c2;
}

.btn-delete:hover {
    color: red;
}

/* ------------------------------------
   ACCIONES - MENU DE 3 PUNTOS
--------------------------------------- */

.actions {
    position: relative;
    text-align: center;
}

/* Botón de 3 puntos */
.action-menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 22px;
    padding: 4px 10px;
    border-radius: 6px;
}

.action-menu-btn:hover {
    background: #eef0f6;
}

/* Contenedor del menú */
.action-menu {
    display: none;
    position: absolute;
    right: 0;
    margin-top: 5px;
    background: #fff;
    border-radius: 8px;
    min-width: 160px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    z-index: 10;
    overflow: hidden;
}

/* Mostrar el menú SOLO con hover */
.actions:hover .action-menu {
    display: block;
}

/* Links del menú */
.action-menu a {
    display: block;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: #333;
    text-decoration: none;
}

.action-menu a:hover {
    background: #eef0f6;
}

.alert-success, .alert-error {
    padding: 12px 18px;
    margin: 15px 0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    animation: fadeInDown 0.4s ease;
}

.alert-success {
    background: #d1f5e0;
    color: #0f683e;
    border-left: 5px solid #2ecc71;
}

.alert-error {
    background: #ffe0e0;
    color: #a40000;
    border-left: 5px solid #e74c3c;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
