/* assets/css/style.css - Dark Glassmorphic Modern UI para ConectRRHH */
:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-card-hover: rgba(30, 41, 59, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.4);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #38bdf8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(56, 189, 248, 0.08) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 1.5rem;
    line-height: 1.5;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
}

/* Header & Topbar */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #6366f1, #38bdf8);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
}

.logo-text h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(51, 65, 85, 0.9);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.card-device {
    border-left: 4px solid var(--primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-online {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-offline {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-sede {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Filters Bar */
.filters-bar {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

input[type="text"], input[type="date"], select {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s ease;
}

input[type="text"]:focus, input[type="date"]:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Data Table */
.table-responsive {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

th {
    background: rgba(15, 23, 42, 0.75);
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    vertical-align: middle;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Toast Alerts */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.25rem;
    color: #ffffff;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    max-width: 400px;
    animation: slideIn 0.3s ease forwards;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--accent); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
    body { padding: 1rem; }
    .header { flex-direction: column; align-items: flex-start; }
    .header-actions { width: 100%; justify-content: flex-start; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filter-group { flex-direction: column; align-items: stretch; }
}

/* User Menu & Badges */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.35rem 0.75rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-primary);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
}

/* Modal Dialog */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 7, 15, 0.75);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-backdrop.show {
    display: flex;
    opacity: 1;
}

.modal-dialog {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card), 0 0 35px rgba(99, 102, 241, 0.2);
    width: 100%;
    max-width: 780px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.25s ease;
}

.modal-backdrop.show .modal-dialog {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #ffffff;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.4);
    padding: 0 1.5rem;
    gap: 0.5rem;
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.tab-btn:hover {
    color: #ffffff;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.modal-body {
    padding: 1.5rem 1.75rem;
    overflow-y: auto;
    flex: 1;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.75rem;
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
}

/* Form Styles inside Modal */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.form-group-modal {
    margin-bottom: 1.25rem;
}

.form-group-modal label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group-modal .input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.form-group-modal input, .form-group-modal select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-group-modal input:focus, .form-group-modal select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.4;
}

.input-copy-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.input-copy-btn:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Device Manager in Modal */
.device-card-modal {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.device-card-modal.inactive {
    opacity: 0.6;
    border-style: dashed;
}

/* Employee & Table Badges (Desktop View Style) */
.emp-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.emp-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #38bdf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
}

.emp-avatar-lg {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #38bdf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
    flex-shrink: 0;
}

.badge-pin {
    background: rgba(99, 102, 241, 0.18);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.35);
    font-family: monospace;
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}

.badge-day {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

.badge-day.lunes { border-color: rgba(56, 189, 248, 0.3); color: #38bdf8; }
.badge-day.martes { border-color: rgba(99, 102, 241, 0.3); color: #818cf8; }
.badge-day.miercoles, .badge-day.miércoles { border-color: rgba(168, 85, 247, 0.3); color: #c084fc; }
.badge-day.jueves { border-color: rgba(236, 72, 153, 0.3); color: #f472b6; }
.badge-day.viernes { border-color: rgba(16, 185, 129, 0.3); color: #34d399; }
.badge-day.sabado, .badge-day.sábado { border-color: rgba(245, 158, 11, 0.3); color: #fbbf24; }
.badge-day.domingo { border-color: rgba(239, 68, 68, 0.3); color: #f87171; }

.badge-verify {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-sede {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    padding: 0.18rem 0.55rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
}

tr.punch-row {
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

tr.punch-row:hover td {
    background: rgba(99, 102, 241, 0.08) !important;
}

/* SweetAlert2 Custom Dark Glassmorphism */
div:where(.swal2-container).swal2-backdrop-show {
    backdrop-filter: blur(8px) !important;
    background: rgba(4, 7, 15, 0.75) !important;
}

div:where(.swal2-popup) {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 35px rgba(99, 102, 241, 0.2) !important;
    color: #f8fafc !important;
    font-family: inherit !important;
}

div:where(.swal2-title) {
    color: #ffffff !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
}

div:where(.swal2-html-container) {
    color: #cbd5e1 !important;
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
}

div:where(.swal2-actions) button {
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    padding: 0.65rem 1.4rem !important;
}

div:where(.swal2-confirm) {
    background: #6366f1 !important;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4) !important;
}

div:where(.swal2-confirm):hover {
    background: #4f46e5 !important;
}

div:where(.swal2-cancel) {
    background: rgba(51, 65, 85, 0.8) !important;
    color: #cbd5e1 !important;
}

div:where(.swal2-cancel):hover {
    background: rgba(71, 85, 105, 1) !important;
}



