/* ============================================
   ZONIX Control Horario - Design System
   Theme: Fuchsia & Black Cyberpunk
   ============================================ */

/* === CSS Variables === */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(18, 18, 30, 0.85);
    --bg-card-hover: rgba(28, 28, 45, 0.9);
    --bg-input: rgba(15, 15, 25, 0.9);

    --fuchsia: #ff00ff;
    --fuchsia-bright: #ff2d95;
    --fuchsia-light: #ff69d2;
    --fuchsia-glow: rgba(255, 0, 255, 0.3);
    --fuchsia-soft: rgba(255, 45, 149, 0.15);

    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b5;
    --text-muted: #6a6a80;

    --success: #00e676;
    --warning: #ffab40;
    --danger: #ff5252;
    --info: #40c4ff;

    --border: rgba(255, 0, 255, 0.15);
    --border-hover: rgba(255, 0, 255, 0.4);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --shadow-glow: 0 0 20px rgba(255, 0, 255, 0.12), 0 0 60px rgba(255, 0, 255, 0.05);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --font-display: 'Orbitron', monospace;
    --font-body: 'Inter', -apple-system, sans-serif;
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* === Matrix Rain Canvas === */
#matrixRain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.06;
    pointer-events: none;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--fuchsia);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--fuchsia-bright);
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 32px;
    background: rgba(10, 10, 18, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 2px solid var(--fuchsia);
    box-shadow: 0 0 15px var(--fuchsia-glow);
    transition: var(--transition);
}

.header-logo:hover {
    box-shadow: 0 0 25px var(--fuchsia-glow), 0 0 50px rgba(255, 0, 255, 0.15);
    transform: scale(1.05);
}

.header-brand {
    display: flex;
    flex-direction: column;
}

.header-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 6px;
    background: linear-gradient(135deg, var(--fuchsia), var(--fuchsia-bright), var(--fuchsia-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    line-height: 1.2;
}

.header-subtitle {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 4px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
}

.clock-container {
    text-align: right;
}

.clock-time {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--fuchsia);
    letter-spacing: 3px;
    text-shadow: 0 0 20px var(--fuchsia-glow);
    line-height: 1.2;
}

.clock-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 32px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition);
}

.card-glow:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

/* === Dashboard === */
.dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.card-stat {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    cursor: default;
    position: relative;
    overflow: hidden;
}

.card-stat::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--fuchsia), var(--fuchsia-bright));
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: var(--transition);
}

.card-stat:hover::after {
    opacity: 1;
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--fuchsia-soft);
    color: var(--fuchsia);
    flex-shrink: 0;
}

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

.icon-present { color: var(--success); background: rgba(0, 230, 118, 0.12); }
.icon-absent { color: var(--danger); background: rgba(255, 82, 82, 0.12); }
.icon-late { color: var(--warning); background: rgba(255, 171, 64, 0.12); }

.card-info {
    display: flex;
    flex-direction: column;
}

.card-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.card-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============================================
   ACTION PANEL
   ============================================ */
.action-panel {
    margin-bottom: 28px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--fuchsia-light);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    width: 20px;
    height: 20px;
    color: var(--fuchsia);
}

.action-controls {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
}

.action-controls .input-group {
    flex: 1;
    min-width: 220px;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

/* ============================================
   FORMS & INPUTS
   ============================================ */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.input-field {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.92rem;
    padding: 12px 16px;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.input-field:focus {
    border-color: var(--fuchsia);
    box-shadow: 0 0 0 3px rgba(255, 0, 255, 0.1);
}

.input-field::placeholder {
    color: var(--text-muted);
}

select.input-field {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ff00ff' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

select.input-field option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7) sepia(1) saturate(5) hue-rotate(280deg);
    cursor: pointer;
}

input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7) sepia(1) saturate(5) hue-rotate(280deg);
    cursor: pointer;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-entry {
    background: linear-gradient(135deg, #00c853, #00e676);
    color: #0a0a0f;
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.25);
}
.btn-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 200, 83, 0.4);
}

.btn-exit {
    background: linear-gradient(135deg, #d50000, #ff5252);
    color: #fff;
    box-shadow: 0 4px 15px rgba(213, 0, 0, 0.25);
}
.btn-exit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(213, 0, 0, 0.4);
}

.btn-add {
    background: linear-gradient(135deg, var(--fuchsia), var(--fuchsia-bright));
    color: #fff;
    box-shadow: 0 4px 15px var(--fuchsia-glow);
}
.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 0, 255, 0.4);
}

.btn-export {
    background: rgba(64, 196, 255, 0.15);
    color: var(--info);
    border: 1px solid rgba(64, 196, 255, 0.3);
}
.btn-export:hover {
    background: rgba(64, 196, 255, 0.25);
    transform: translateY(-2px);
}

.btn-save {
    background: linear-gradient(135deg, var(--fuchsia), var(--fuchsia-bright));
    color: #fff;
}
.btn-save:hover {
    box-shadow: 0 4px 20px var(--fuchsia-glow);
    transform: translateY(-1px);
}

.btn-cancel {
    background: rgba(160, 160, 181, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(160, 160, 181, 0.2);
}
.btn-cancel:hover {
    background: rgba(160, 160, 181, 0.2);
}

.btn-edit, .btn-delete {
    padding: 8px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-edit {
    background: rgba(255, 0, 255, 0.12);
    color: var(--fuchsia-light);
    border: 1px solid rgba(255, 0, 255, 0.2);
}
.btn-edit:hover {
    background: rgba(255, 0, 255, 0.25);
}

.btn-delete {
    background: rgba(255, 82, 82, 0.12);
    color: var(--danger);
    border: 1px solid rgba(255, 82, 82, 0.2);
}
.btn-delete:hover {
    background: rgba(255, 82, 82, 0.25);
}

/* ============================================
   TABS
   ============================================ */
.tabs-section {
    margin-top: 0;
}

.tabs-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    background: var(--bg-card);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    padding: 6px 6px 0;
    overflow-x: auto;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
}

.tab-btn svg {
    width: 16px;
    height: 16px;
}

.tab-btn:hover {
    color: var(--text-secondary);
    background: rgba(255, 0, 255, 0.05);
}

.tab-btn.active {
    color: var(--fuchsia);
    background: var(--bg-card);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, var(--fuchsia), var(--fuchsia-bright));
    border-radius: 1px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.35s ease;
}

.tab-content > .card {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border-top: 1px solid var(--border);
}

/* ============================================
   DATA TABLES
   ============================================ */
.table-wrapper {
    overflow-x: auto;
}

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

.data-table thead th {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 14px 16px;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 0, 255, 0.05);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover:not(.empty-row) {
    background: rgba(255, 0, 255, 0.04);
}

.empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 16px;
    font-style: italic;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.status-present {
    background: rgba(0, 230, 118, 0.12);
    color: var(--success);
    border: 1px solid rgba(0, 230, 118, 0.25);
}

.status-absent {
    background: rgba(255, 82, 82, 0.12);
    color: var(--danger);
    border: 1px solid rgba(255, 82, 82, 0.25);
}

.status-late {
    background: rgba(255, 171, 64, 0.12);
    color: var(--warning);
    border: 1px solid rgba(255, 171, 64, 0.25);
}

.status-out {
    background: rgba(160, 160, 181, 0.12);
    color: var(--text-secondary);
    border: 1px solid rgba(160, 160, 181, 0.25);
}

/* ============================================
   EMPLOYEES SECTION
   ============================================ */
.employees-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.employees-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--fuchsia-light);
    letter-spacing: 2px;
}

/* ============================================
   HISTORY SECTION
   ============================================ */
.history-filters {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.history-filters .input-group {
    min-width: 180px;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.25s ease;
}

.modal {
    width: 100%;
    max-width: 520px;
    animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--fuchsia-light);
    letter-spacing: 2px;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.2);
    border-radius: 8px;
    color: var(--danger);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-close:hover {
    background: rgba(255, 82, 82, 0.25);
    transform: rotate(90deg);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: 90px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-card);
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 280px;
    max-width: 420px;
    font-size: 0.88rem;
}

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

.toast-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info .toast-icon { color: var(--info); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-exit {
    animation: slideOutRight 0.35s ease forwards;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-title {
        font-size: 1.2rem;
        letter-spacing: 4px;
    }

    .clock-time {
        font-size: 1.3rem;
    }

    .main-content {
        padding: 16px;
    }

    .dashboard {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .action-controls {
        flex-direction: column;
    }

    .action-buttons {
        width: 100%;
    }

    .action-buttons .btn {
        flex: 1;
        justify-content: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .history-filters {
        flex-direction: column;
    }

    .tabs-nav {
        overflow-x: auto;
    }

    .tab-btn {
        padding: 12px 16px;
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .header-logo {
        width: 36px;
        height: 36px;
    }

    .card-stat {
        padding: 14px 16px;
    }

    .employees-header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* === Table action buttons container === */
.table-actions {
    display: flex;
    gap: 6px;
}
