:root {
    --color-principal: #82bdcf;
    --color-hover: #5389A6;
    --color-fondo: #FAFAF0;
    --color-card: #DEF4FA;
    --color-borde: rgba(224, 163, 0, 0.25);
    --color-glow: rgba(130, 189, 207, 0.35);
    --color-texto-s: #5C5959;
    --font-main: 'Inter', sans-serif;
    --transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-main);
    background-color: var(--color-fondo);
    color: #000;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── HEADER ── */
.portal-header {
    background: #fff;
    border-bottom: 1px solid rgba(130, 189, 207, 0.3);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.hulme-logo-svg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    flex-shrink: 0;
}

.header-text .brand-name {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #000;
    line-height: 1.2;
}

.header-text .brand-sub {
    font-size: 0.7rem;
    color: var(--color-texto-s);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portal-badge {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-card);
    border: 1px solid var(--color-borde);
    color: var(--color-hover);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    letter-spacing: 0.5px;
}

/* ── MAIN ── */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.25rem;
    gap: 2.5rem;
}

/* ── GLOW BG ── */
.bg-glow {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(95vw, 700px);
    height: min(95vw, 700px);
    background: radial-gradient(circle, rgba(207, 229, 255, 0.55) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── DIVIDER ── */
.divider {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 560px;
    color: var(--color-texto-s);
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(130, 189, 207, 0.35);
}

/* ── EMAIL BUTTONS ── */
.email-section {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 560px;
    text-align: center;
}

.email-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.875rem;
}

.email-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    background: var(--color-card);
    border: 1px solid rgba(130, 189, 207, 0.4);
    border-radius: 18px;
    padding: 1.4rem 1rem;
    text-decoration: none;
    color: #000;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.email-btn:hover {
    background: #fff;
    border-color: var(--color-principal);
    color: var(--color-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(130, 189, 207, 0.25);
}

.email-btn .btn-icon {
    width: 44px;
    height: 44px;
    background: #fff;
    border: 1px solid var(--color-borde);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-principal);
    transition: var(--transition);
}

.email-btn:hover .btn-icon {
    background: var(--color-principal);
    color: #000;
    border-color: var(--color-principal);
}

.email-btn .btn-icon svg {
    width: 20px;
    height: 20px;
}

.email-btn .email-address {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--color-texto-s);
    margin-top: -0.2rem;
}

.email-btn:hover .email-address {
    color: var(--color-hover);
}

/* ── FOOTER ── */
.portal-footer {
    text-align: center;
    padding: 1.25rem;
    font-size: 0.75rem;
    color: #aaa;
    border-top: 1px solid rgba(130, 189, 207, 0.2);
    background: #fff;
}

/* ── HEADER ACTIONS (portal.php) ── */
.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logout-btn {
    font-size: 0.75rem;
    font-weight: 600;
    background: transparent;
    border: 1px solid rgba(220, 53, 69, 0.4);
    color: #dc3545;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 0.08);
    color: #dc3545;
}

/* ── LOGIN ── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-fondo);
    padding: 2rem 1.25rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border: 1px solid rgba(130, 189, 207, 0.4);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    box-shadow: 0 8px 32px rgba(130, 189, 207, 0.15);
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
    justify-content: center;
    text-align: center;
}

.login-logo .hulme-logo-svg {
    width: 120px;
    height: 120px;
    box-shadow: 0 0 28px rgba(130, 189, 207, 0.4);
}

.login-logo .header-text .brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #000;
    display: block;
    line-height: 1.2;
}

.login-logo .header-text .brand-sub {
    font-size: 0.7rem;
    color: var(--color-texto-s);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #000;
    text-align: center;
    margin-bottom: 0.35rem;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 0.82rem;
    color: var(--color-texto-s);
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-input-group {
    position: relative;
    margin-bottom: 1rem;
}

.login-input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-principal);
    pointer-events: none;
}

.login-input-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.login-input {
    width: 100%;
    background: var(--color-card);
    border: 1px solid rgba(130, 189, 207, 0.5);
    border-radius: 12px;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: #000;
    outline: none;
    transition: var(--transition);
}

.login-input:focus {
    border-color: var(--color-principal);
    background: #fff;
    box-shadow: 0 0 12px rgba(130, 189, 207, 0.25);
}

.login-input::placeholder {
    color: var(--color-texto-s);
}

.login-btn {
    width: 100%;
    background: var(--color-principal);
    color: #000;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.875rem;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
    box-shadow: 0 0 20px var(--color-glow);
}

.login-btn:hover {
    background: var(--color-hover);
    transform: scale(1.02);
}

.login-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #dc3545;
    margin-bottom: 1rem;
    text-align: center;
}

/* ── ADMIN PANEL ── */
.admin-main {
    flex: 1;
    max-width: 1060px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
    width: 100%;
    position: relative;
    z-index: 1;
}

.admin-page-title {
    margin-bottom: 1.75rem;
}

.admin-page-title h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.2rem;
}

.admin-page-title p {
    color: var(--color-texto-s);
    font-size: 0.9rem;
}

/* Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: #fff;
    border: 1px solid rgba(130, 189, 207, 0.35);
    border-radius: 18px;
    padding: 1.2rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(130, 189, 207, 0.18);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg { width: 24px; height: 24px; }

.stat-icon--total   { background: rgba(130, 189, 207, 0.18); color: var(--color-hover); }
.stat-icon--active  { background: rgba(34, 197, 94, 0.14);   color: #16a34a; }
.stat-icon--inactive{ background: rgba(100, 100, 100, 0.1);  color: #888; }

.stat-info { display: flex; flex-direction: column; }

.stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: #000;
    line-height: 1;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--color-texto-s);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Flash */
.admin-flash {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.flash-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.flash-icon svg { width: 16px; height: 16px; }

.admin-flash--ok {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #15803d;
}

.admin-flash--ok .flash-icon {
    background: rgba(34, 197, 94, 0.18);
    color: #16a34a;
}

.admin-flash--err {
    background: rgba(220, 53, 69, 0.07);
    border: 1px solid rgba(220, 53, 69, 0.28);
    color: #dc3545;
}

.admin-flash--err .flash-icon {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

/* Layout */
.admin-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Section cards */
.admin-section {
    background: #fff;
    border: 1px solid rgba(130, 189, 207, 0.35);
    border-radius: 22px;
    padding: 1.75rem 2rem;
    border-top: 3px solid var(--color-principal);
}

.admin-form-card {
    border-top-color: var(--color-hover);
}

.admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-title-group {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.section-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(130, 189, 207, 0.15);
    color: var(--color-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-icon-box svg { width: 20px; height: 20px; }

.icon-box--create { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.icon-box--edit   { background: rgba(83, 137, 166, 0.15); color: var(--color-hover); }

.admin-section-header h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.1rem;
    color: #000;
}

.admin-section-header p {
    font-size: 0.78rem;
    color: var(--color-texto-s);
    margin: 0;
}

/* New account button — centered */
.admin-new-btn-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.admin-btn-new {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--color-principal);
    color: #000;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.75rem 2rem;
    border-radius: 999px;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 0 22px var(--color-glow);
    white-space: nowrap;
}

.admin-btn-new:hover {
    background: var(--color-hover);
    color: #fff;
    transform: scale(1.04);
    box-shadow: 0 0 28px rgba(83, 137, 166, 0.4);
}

.admin-btn-new svg { width: 17px; height: 17px; }

.admin-btn-cancel {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-texto-s);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(130, 189, 207, 0.3);
}

.admin-btn-cancel:hover {
    color: #dc3545;
    border-color: rgba(220, 53, 69, 0.35);
    background: rgba(220, 53, 69, 0.05);
}

.admin-btn-cancel svg { width: 13px; height: 13px; }

/* Table */
.admin-table-wrap { overflow-x: auto; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.admin-table th {
    text-align: left;
    padding: 0.55rem 1rem;
    color: var(--color-texto-s);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 2px solid rgba(130, 189, 207, 0.2);
    background: rgba(222, 244, 250, 0.5);
}

.admin-table th:first-child { border-radius: 10px 0 0 10px; }
.admin-table th:last-child  { border-radius: 0 10px 10px 0; }

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(130, 189, 207, 0.1);
    vertical-align: middle;
}

.admin-table tbody tr {
    transition: var(--transition);
}

.admin-table tbody tr:hover { background: rgba(222, 244, 250, 0.4); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.row-inactive { opacity: 0.4; }

/* Avatar + nombre */
.td-empleado {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.td-nombre {
    font-weight: 600;
    color: #000;
    font-size: 0.9rem;
}

/* Usuario pill */
.td-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(130, 189, 207, 0.12);
    border: 1px solid rgba(130, 189, 207, 0.3);
    color: var(--color-hover);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-family: monospace;
}

.td-user-pill svg { width: 12px; height: 12px; }

/* Date */
.td-date {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--color-texto-s);
    font-size: 0.8rem;
    white-space: nowrap;
}

.td-date svg { width: 13px; height: 13px; }

/* Badges */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-on {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-on .badge-dot { background: #16a34a; }

.badge-off {
    background: rgba(100, 100, 100, 0.08);
    color: #777;
    border: 1px solid rgba(100, 100, 100, 0.18);
}

.badge-off .badge-dot { background: #aaa; }

/* Action buttons */
.admin-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    transition: var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
}

.action-btn svg { width: 13px; height: 13px; }

.btn-edit {
    background: var(--color-hover);
    color: #fff;
    border-color: var(--color-hover);
}

.btn-edit:hover {
    background: #2c6a8a;
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(83, 137, 166, 0.45);
}

.btn-delete {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.btn-delete:hover {
    background: #b91c2c;
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(220, 53, 69, 0.45);
}

/* Form */
.admin-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.admin-field { display: flex; flex-direction: column; gap: 0.5rem; }

.admin-field label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-texto-s);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-field label svg { width: 14px; height: 14px; color: var(--color-principal); }

.admin-input {
    width: 100%;
    background: rgba(222, 244, 250, 0.5);
    border: 1.5px solid rgba(130, 189, 207, 0.4);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: #000;
    outline: none;
    transition: var(--transition);
}

.admin-input:focus {
    border-color: var(--color-principal);
    background: #fff;
    box-shadow: 0 0 14px rgba(130, 189, 207, 0.25);
}

.admin-input::placeholder { color: #bbb; }

.label-opt {
    font-weight: 400;
    color: #bbb;
    font-size: 0.72rem;
    text-transform: none;
    letter-spacing: 0;
}

.admin-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--color-principal);
    color: #000;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 0 20px var(--color-glow);
    align-self: flex-start;
}

.admin-submit-btn:hover {
    background: var(--color-hover);
    color: #fff;
    transform: scale(1.03);
    box-shadow: 0 0 28px rgba(83, 137, 166, 0.4);
}

.admin-submit-btn svg { width: 17px; height: 17px; }

/* Empty state */
.admin-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1rem;
    color: var(--color-texto-s);
    font-size: 0.9rem;
    gap: 0.5rem;
}

.empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(130, 189, 207, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-principal);
    margin-bottom: 0.5rem;
}

.empty-icon svg { width: 28px; height: 28px; }

/* Responsive admin */
@media (max-width: 768px) {
    .admin-stats { grid-template-columns: 1fr; }
    .form-grid   { grid-template-columns: 1fr; }
    .admin-actions { flex-direction: column; }
    .action-btn { justify-content: center; }
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    .email-grid {
        grid-template-columns: 1fr 1fr;
    }
}
