/* =====================================
   ConsultorTrack Base CSS
   Shared layout and global styles
===================================== */

:root {
    --sidebar-width: 55px;
    --navbar-height: 56px;

    /* Paleta de marca Orbis Solutions */
    --primary: #021D49;        /* Oxford Blue */
    --accent: #F4436C;         /* Paradise Pink */
    --accent-dark: #C31C4A;    /* Bright Maroon (hover del accent) */
    --cool-grey: #8D9EBC;      /* Cool Grey */

    /* Colores funcionales UI */
    --danger: #d7263d;
    --success: #1bbf6b;
    --light: #f4f7fa;
    --border: #dbe2ef;

    /* Aliases para compatibilidad entre archivos */
    --primary-color: #021D49;
    --accent-color: #F4436C;
    --danger-color: #d7263d;
    --light-bg: #f4f7fa;
    --table-border: #dbe2ef;
    --table-header-bg: #e4e9f2;
}

/* GLOBAL RESET */

html,body{
    height:100%;
    margin:0;
    padding:0;
    font-family:'Gotham Rounded','Segoe UI',Arial,sans-serif;
}

/* BACKGROUND */

body{
    background:url("/static/core/img/fondo.jpg") no-repeat center center fixed;
    background-size:cover;
    min-height:100vh;
    min-width:100vw;
    padding-top:var(--navbar-height);
    overflow-x:hidden;
}

/* SIDEBAR */

.sidebar{
    position:fixed;
    top:var(--navbar-height);
    left:0;
    width:var(--sidebar-width);
    height:calc(100vh - var(--navbar-height));
    background:var(--primary);
    z-index:101;
    display:flex;
    flex-direction:column;
    transition:width 0.22s ease;
}

/* PAGE CONTAINER */

.tables-flex-container {
    margin-left: var(--sidebar-width);
    padding: 32px 24px;
    min-height: calc(100vh - var(--navbar-height));
    width: calc(100% - var(--sidebar-width));
    box-sizing: border-box;
    display: block;
}

/* CONTENT BOX */

.table-box{
    background:rgba(255,255,255,0.92);
    border-radius:12px;
    padding:32px 24px;
    box-shadow:0 4px 24px rgba(2,29,73,.09);
}

/* TABLE */

.table-container{
    width:100%;
    overflow-x:auto;
}

.styled-table{
    width:100%;
    border-collapse:collapse;
}

.styled-table th,
.styled-table td{
    padding:10px 14px;
    border-bottom:1px solid var(--border);
}

.styled-table th{
    background:#e4e9f2;
    color:var(--primary);
}

.styled-table tbody tr:hover{
    background:#f5fafc;
}

/* ICON BUTTON */

.icon-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:none;
    border:none;
    padding:6px;
    cursor:pointer;
}

.icon-btn:hover{
    background:#eef2f8;
    border-radius:5px;
}

.icon-svg{
    width:24px;
    height:24px;
}

/* STATUS */

.estado{
    padding:4px 12px;
    border-radius:12px;
    font-weight:bold;
}

.estado.habilitado{
    background:#e2ffe2;
    color:#1a7f1a;
}

.estado.deshabilitado{
    background:#ffe2e2;
    color:var(--danger);
}

/* ═══════════════════════════════════════
   TOAST
════════════════════════════════════════ */

#toast-container {
    position: fixed;
    top: calc(var(--navbar-height) + 16px);
    right: 20px;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px 13px 14px;
    border-radius: 10px;
    min-width: 260px;
    max-width: 400px;
    font-size: 0.88em;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 6px 24px rgba(2,29,73,0.18);
    pointer-events: auto;
    animation: toastSlideIn 0.35s cubic-bezier(.22,.68,0,1.2) both;
    background: var(--primary);
}

.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-warning { background: #e08800; }
.toast-info    { background: var(--primary); }

/* Compatibilidad con código existente que usa .toast.error */
.toast.error { background: var(--danger); }

.toast-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
}

.toast-icon svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    opacity: 0.7;
    display: flex;
    align-items: center;
    transition: opacity 0.15s;
}

.toast-close:hover { opacity: 1; }

.toast-close svg {
    width: 14px;
    height: 14px;
    stroke: #fff;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(50px); }
    to   { opacity: 1; transform: translateX(0); }
}

.toast-hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
    to { opacity: 0; transform: translateX(50px); }
}

/* ═══════════════════════════════════════
   MODAL DE CONFIRMACIÓN
════════════════════════════════════════ */

.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 29, 73, 0.50);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalOverlayIn 0.2s ease;
    backdrop-filter: blur(2px);
}

.confirm-modal-hidden {
    display: none !important;
}

.confirm-modal-box {
    background: #fff;
    border-radius: 18px;
    padding: 40px 40px 32px;
    max-width: 400px;
    width: 92%;
    text-align: center;
    box-shadow: 0 12px 56px rgba(2,29,73,0.22);
    animation: modalBoxIn 0.28s cubic-bezier(.22,.68,0,1.2);
}

.confirm-modal-icon {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #fff0f3;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
}

.confirm-modal-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--accent);
}

.confirm-modal-title {
    font-size: 1.12em;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 8px;
}

.confirm-modal-subtitle {
    font-size: 0.87em;
    color: var(--cool-grey);
    margin: 0 0 30px;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-modal-btn {
    padding: 10px 30px;
    border-radius: 8px;
    font-size: 0.92em;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s, transform 0.1s;
    font-family: inherit;
}

.confirm-modal-btn:active {
    transform: scale(0.97);
}

.confirm-modal-cancel {
    background: #f0f4fb;
    color: var(--primary);
    border: 1.5px solid var(--border);
}

.confirm-modal-cancel:hover {
    background: #e4e9f2;
}

.confirm-modal-confirm {
    background: var(--danger);
    color: #fff;
}

.confirm-modal-confirm:hover {
    background: #b01e2e;
}

@keyframes modalOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes modalBoxIn {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ═══════════════════════════════════════
   SISTEMA DE BOTONES DE ACCIÓN (tablas)
   Reemplaza icon-btn en columnas de acción
════════════════════════════════════════ */

/* Contenedor de botones en celda de acciones */
.action-buttons {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* Base del botón de acción */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
    padding: 0;
    vertical-align: middle;
    flex-shrink: 0;
}

.action-btn .icon-svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* Editar — azul suave */
.action-btn.btn-edit,
.action-btn.edit-btn,
.action-btn.edit-projectuser-btn {
    background: #eef2f8;
    border-color: #c8d8f0;
}
.action-btn.btn-edit:hover,
.action-btn.edit-btn:hover,
.action-btn.edit-projectuser-btn:hover {
    background: #dce6f5;
    border-color: var(--primary);
}

/* Eliminar — rojo suave */
.action-btn.btn-delete,
.action-btn.delete-btn,
.action-btn.delete-user-btn {
    background: #fff0f0;
    border-color: #f5c8cc;
}
.action-btn.btn-delete:hover,
.action-btn.delete-btn:hover,
.action-btn.delete-user-btn:hover {
    background: #ffe0e0;
    border-color: var(--danger);
}

/* Aprobar — verde suave */
.action-btn.btn-approve,
.action-btn.accept-btn {
    background: #e8f9f0;
    border-color: #b8edcf;
}
.action-btn.btn-approve:hover,
.action-btn.accept-btn:hover {
    background: #d0f2e4;
    border-color: var(--success);
}

/* Rechazar — rojo rosado */
.action-btn.btn-reject,
.action-btn.reject-btn {
    background: #fff4f4;
    border-color: #f5c8cc;
}
.action-btn.btn-reject:hover,
.action-btn.reject-btn:hover {
    background: #ffe4e4;
    border-color: var(--danger);
}

/* Gestión (admin usuarios, admin tiempos) — azul neutro */
.action-btn.btn-manage {
    background: #f0f4fb;
    border-color: #c8d8f0;
}
.action-btn.btn-manage:hover {
    background: #e0eaf8;
    border-color: var(--cool-grey);
}

/* Notificar — mismo tono que gestión */
.action-btn.notificar-btn {
    background: #f0f4fb;
    border-color: #c8d8f0;
}
.action-btn.notificar-btn:hover {
    background: #e0eaf8;
    border-color: var(--primary);
}

/* Formulario inline dentro de celda de acciones */
.form-action-inline {
    display: inline;
    margin: 0;
    padding: 0;
}

/* Fila de tabla vacía */
.empty-row td {
    text-align: center;
    color: var(--cool-grey);
    padding: 32px 0 !important;
    font-size: 0.93em;
    font-style: italic;
}

/* FILTRER */

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    background: #f4f7fa;
    padding: 10px 16px;
    border-radius: 8px;
    align-items: center;
}

    .filter-bar input,
    .filter-bar select {
        padding: 8px 10px;
        border: 1px solid #bfcbe2;
        border-radius: 5px;
        font-size: 1em;
        background: #fff;
    }

        .filter-bar input:focus,
        .filter-bar select:focus {
            border: 1.5px solid #021D49;
            outline: none;
        }