/* Registro Horario - Metronic-inspired Theme */
/* Built on Bootstrap 5 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --kt-primary: #3e97ff;
    --kt-primary-active: #2884ef;
    --kt-primary-light: #f1faff;
    --kt-success: #50cd89;
    --kt-success-light: #e8fff3;
    --kt-warning: #ffc700;
    --kt-warning-light: #fff8dd;
    --kt-danger: #f1416c;
    --kt-danger-light: #fff5f8;
    --kt-info: #7239ea;
    --kt-info-light: #f8f5ff;
    --kt-dark: #181c32;
    --kt-gray-100: #f9f9f9;
    --kt-gray-200: #f1f1f2;
    --kt-gray-300: #e1e3ea;
    --kt-gray-400: #b5b5c3;
    --kt-gray-500: #a1a5b7;
    --kt-gray-600: #7e8299;
    --kt-gray-700: #5e6278;
    --kt-gray-800: #3f4254;
    --kt-gray-900: #181c32;
    --kt-sidebar-bg: #1e1e2d;
    --kt-sidebar-width: 265px;
    --kt-sidebar-mini: 75px;
    --kt-header-height: 65px;
    --kt-radius: 0.475rem;
}

/* ---- Base ---- */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--kt-gray-100);
    color: var(--kt-gray-800);
    font-size: 0.925rem;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--kt-gray-900);
}

a {
    color: var(--kt-primary);
    text-decoration: none;
}
a:hover {
    color: var(--kt-primary-active);
}

/* ---- App Layout (Sidebar + Content) ---- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.app-sidebar {
    width: var(--kt-sidebar-width);
    background: var(--kt-sidebar-bg);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar-brand {
    height: var(--kt-header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    flex-shrink: 0;
}

.sidebar-brand a {
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.sidebar-brand a:hover { color: white; }
.sidebar-brand .brand-sub {
    font-size: 0.7rem;
    color: var(--kt-gray-500);
    font-weight: 400;
    display: block;
    margin-top: -2px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.menu-section {
    padding: 0.75rem 1.5rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--kt-gray-500);
}

.menu-item {
    padding: 0 0.75rem;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    border-radius: var(--kt-radius);
    color: var(--kt-gray-500);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    gap: 0.75rem;
}

.menu-link:hover {
    background: rgba(255,255,255,0.04);
    color: var(--kt-gray-300);
}

.menu-link.active {
    background: rgba(62, 151, 255, 0.1);
    color: var(--kt-primary);
}

.menu-link .menu-icon {
    width: 22px;
    height: 22px;
    opacity: 0.6;
    flex-shrink: 0;
}

.menu-link.active .menu-icon {
    opacity: 1;
}

.menu-link .menu-badge {
    margin-left: auto;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.04);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--kt-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user-info {
    overflow: hidden;
}

.sidebar-user-name {
    color: var(--kt-gray-300);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: var(--kt-gray-500);
    font-size: 0.75rem;
}

/* ---- Main Content ---- */
.app-main {
    flex: 1;
    margin-left: var(--kt-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---- Top Header Bar ---- */
.app-header {
    height: var(--kt-header-height);
    background: white;
    border-bottom: 1px solid var(--kt-gray-200);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--kt-gray-600);
}

.btn-sidebar-toggle svg { width: 20px; height: 20px; }

.header-user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--kt-radius);
    background: var(--kt-gray-100);
    color: var(--kt-gray-700);
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.header-user-btn:hover { background: var(--kt-gray-200); color: var(--kt-gray-800); }

/* ---- Page Content ---- */
.app-content {
    flex: 1;
    padding: 2rem;
}

/* ---- Page Toolbar ---- */
.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
}

.page-toolbar h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--kt-dark);
}

.page-toolbar .breadcrumb {
    margin: 0;
    font-size: 0.8rem;
}

.page-toolbar .breadcrumb-item a { color: var(--kt-gray-500); }
.page-toolbar .breadcrumb-item.active { color: var(--kt-gray-700); }

/* ---- Cards (Metronic style) ---- */
.card {
    border: 0;
    border-radius: var(--kt-radius);
    box-shadow: 0 0 20px 0 rgba(76, 87, 125, 0.02);
    background: white;
}

.card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--kt-gray-200);
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.card .card-header .card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    color: var(--kt-gray-900);
}

.card .card-body {
    padding: 1.75rem;
}

.card .card-footer {
    background: transparent;
    border-top: 1px solid var(--kt-gray-200);
    padding: 1.25rem 1.75rem;
}

/* ---- Stat Widget Cards (Metronic KPI style) ---- */
.stat-card {
    border: 0;
    border-radius: var(--kt-radius);
    box-shadow: 0 0 20px 0 rgba(76, 87, 125, 0.02);
    background: white;
    padding: 1.5rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--kt-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.stat-card .stat-icon.bg-primary-light { background: var(--kt-primary-light); color: var(--kt-primary); }
.stat-card .stat-icon.bg-success-light { background: var(--kt-success-light); color: var(--kt-success); }
.stat-card .stat-icon.bg-warning-light { background: var(--kt-warning-light); color: var(--kt-warning); }
.stat-card .stat-icon.bg-danger-light { background: var(--kt-danger-light); color: var(--kt-danger); }
.stat-card .stat-icon.bg-info-light { background: var(--kt-info-light); color: var(--kt-info); }

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--kt-dark);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--kt-gray-500);
    margin-top: 0.25rem;
}

/* ---- Tables (Metronic style) ---- */
.table {
    color: var(--kt-gray-700);
    font-size: 0.875rem;
}

.table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--kt-gray-500);
    border-bottom: 1px solid var(--kt-gray-200);
    padding: 0.85rem 1rem;
    background: transparent;
}

.table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--kt-gray-200);
}

.table tbody tr:last-child td { border-bottom: 0; }

.table-hover tbody tr:hover {
    background: var(--kt-gray-100);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: transparent;
}

/* ---- Forms (Metronic style) ---- */
.form-control, .form-select {
    border: 1px solid var(--kt-gray-300);
    border-radius: var(--kt-radius);
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: var(--kt-gray-800);
    background-color: var(--kt-gray-100);
    transition: border-color 0.2s, background-color 0.2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--kt-primary);
    background-color: white;
    box-shadow: none;
}

.form-control::placeholder { color: var(--kt-gray-400); }

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--kt-gray-800);
    margin-bottom: 0.35rem;
}

.form-check-input:checked {
    background-color: var(--kt-primary);
    border-color: var(--kt-primary);
}

/* ---- Buttons (Metronic style) ---- */
.btn {
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.55rem 1.25rem;
    border-radius: var(--kt-radius);
    transition: all 0.2s;
}

.btn-primary {
    background: var(--kt-primary);
    border-color: var(--kt-primary);
}
.btn-primary:hover {
    background: var(--kt-primary-active);
    border-color: var(--kt-primary-active);
}

.btn-success { background: var(--kt-success); border-color: var(--kt-success); }
.btn-danger { background: var(--kt-danger); border-color: var(--kt-danger); }

.btn-light {
    background: var(--kt-gray-100);
    border-color: var(--kt-gray-100);
    color: var(--kt-gray-700);
}
.btn-light:hover {
    background: var(--kt-gray-200);
    border-color: var(--kt-gray-200);
    color: var(--kt-gray-800);
}

.btn-outline-secondary {
    border-color: var(--kt-gray-300);
    color: var(--kt-gray-700);
}
.btn-outline-secondary:hover {
    background: var(--kt-gray-100);
    border-color: var(--kt-gray-300);
    color: var(--kt-gray-800);
}

.btn-sm {
    font-size: 0.8rem;
    padding: 0.35rem 0.85rem;
}

.btn-icon {
    width: 35px;
    height: 35px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---- Badges (Metronic light style) ---- */
.badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: var(--kt-radius);
}

.badge-light-primary { background: var(--kt-primary-light); color: var(--kt-primary); }
.badge-light-success { background: var(--kt-success-light); color: var(--kt-success); }
.badge-light-warning { background: var(--kt-warning-light); color: var(--kt-warning); }
.badge-light-danger { background: var(--kt-danger-light); color: var(--kt-danger); }
.badge-light-info { background: var(--kt-info-light); color: var(--kt-info); }

.badge-type {
    display: inline-block;
    padding: 0.35em 0.65em;
    border-radius: var(--kt-radius);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

/* ---- Alerts / Flash (Metronic style) ---- */
.alert {
    border: 0;
    border-radius: var(--kt-radius);
    font-size: 0.875rem;
    font-weight: 500;
}

.alert-success { background: var(--kt-success-light); color: #1b7a48; }
.alert-danger { background: var(--kt-danger-light); color: #c4123b; }
.alert-warning { background: var(--kt-warning-light); color: #9a7b00; }

.flash {
    animation: fadeIn 0.3s ease;
}

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

/* ---- Separator ---- */
.separator {
    border-bottom: 1px dashed var(--kt-gray-300);
    margin: 1rem 0;
}

/* ---- Auth Page ---- */
.auth-page {
    background: var(--kt-gray-100);
}

.auth-wrapper {
    width: 100%;
    max-width: 500px;
}

.auth-card {
    background: white;
    border-radius: var(--kt-radius);
    box-shadow: 0 0 50px 0 rgba(82, 63, 105, 0.05);
    padding: 2.5rem;
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--kt-dark);
}

.auth-brand p {
    color: var(--kt-gray-500);
    font-size: 0.9rem;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links a {
    display: block;
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--kt-primary);
    font-weight: 500;
}

/* ---- Clock Section (main feature) ---- */
.dashboard-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.current-time {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--kt-dark);
    font-family: 'Inter', monospace;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.current-date {
    font-size: 1rem;
    color: var(--kt-gray-500);
    font-weight: 500;
    margin-top: 0.25rem;
}

.clock-section {
    text-align: center;
    margin: 2rem 0;
}

.clock-button {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 4px solid;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    font-family: 'Inter', sans-serif;
}

.clock-button:active { transform: scale(0.95); }

.clock-in {
    background: var(--kt-success);
    border-color: #3db978;
    color: white;
}
.clock-in:hover { background: #3db978; box-shadow: 0 8px 30px rgba(80, 205, 137, 0.35); }

.clock-out {
    background: var(--kt-danger);
    border-color: #d1345e;
    color: white;
}
.clock-out:hover { background: #d1345e; box-shadow: 0 8px 30px rgba(241, 65, 108, 0.35); }

.clock-break {
    background: var(--kt-warning);
    border-color: #e6b400;
    color: var(--kt-dark);
    width: 120px;
    height: 120px;
}

.clock-break-end {
    background: var(--kt-info);
    border-color: #6331d0;
    color: white;
    width: 160px;
    height: 160px;
}

.clock-icon { font-size: 2.5rem; line-height: 1; margin-bottom: 0.5rem; }
.clock-label { font-size: 0.8rem; letter-spacing: 1.5px; }
.clock-actions { display: flex; align-items: center; justify-content: center; gap: 2rem; margin-top: 1rem; }
.clock-form.inline { display: inline-block; }

.clock-status { margin-bottom: 1rem; }
.status-text { font-size: 1.25rem; font-weight: 600; color: var(--kt-success); }
.status-since { color: var(--kt-gray-500); font-size: 0.9rem; }

.elapsed-time {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--kt-dark);
    font-family: 'Inter', monospace;
    font-variant-numeric: tabular-nums;
    margin-top: 0.5rem;
}

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .stats-grid, .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

.stat { text-align: center; padding: 1rem; }
.stat .stat-value { display: block; font-size: 1.75rem; font-weight: 700; color: var(--kt-dark); }
.stat .stat-label { display: block; font-size: 0.75rem; font-weight: 500; color: var(--kt-gray-500); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 0.25rem; }

/* ---- Schedules ---- */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.schedule-day {
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: var(--kt-radius);
    font-size: 0.8rem;
}

.schedule-day.active { background: var(--kt-primary-light); }
.schedule-day.off { background: var(--kt-gray-100); color: var(--kt-gray-500); }
.schedule-day strong { display: block; margin-bottom: 0.25rem; color: var(--kt-gray-800); }

@media (max-width: 768px) {
    .schedule-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Absence item ---- */
.absence-item {
    padding: 0.65rem 0;
    border-bottom: 1px dashed var(--kt-gray-300);
}
.absence-item:last-child { border-bottom: none; }

/* ---- Inactive row ---- */
.inactive-row { opacity: 0.45; }

/* ---- Pagination ---- */
.pagination .page-link {
    border: 0;
    border-radius: var(--kt-radius);
    color: var(--kt-gray-700);
    font-weight: 500;
    font-size: 0.85rem;
    margin: 0 0.15rem;
}
.pagination .page-item.active .page-link {
    background: var(--kt-primary);
    color: white;
}

/* ---- Fieldset (in forms) ---- */
fieldset { border: 0; padding: 0; margin: 0; }
legend.form-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--kt-gray-900);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px dashed var(--kt-gray-300);
}

/* ---- App Footer ---- */
.app-footer {
    padding: 1.25rem 2rem;
    background: white;
    border-top: 1px solid var(--kt-gray-200);
    color: var(--kt-gray-500);
    font-size: 0.8rem;
}

/* ---- Responsive (Sidebar toggle) ---- */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.3);
        z-index: 1035;
        display: none;
    }

    .sidebar-backdrop.show { display: block; }

    .app-main {
        margin-left: 0;
    }

    .btn-sidebar-toggle {
        display: inline-flex;
    }
}

/* ---- Dropdown (Metronic style) ---- */
.dropdown-menu {
    border: 0;
    border-radius: var(--kt-radius);
    box-shadow: 0 0 50px 0 rgba(82, 63, 105, 0.15);
    padding: 0.5rem;
    font-size: 0.875rem;
}

.dropdown-item {
    border-radius: var(--kt-radius);
    padding: 0.5rem 0.85rem;
    font-weight: 500;
    color: var(--kt-gray-700);
}

.dropdown-item:hover {
    background: var(--kt-gray-100);
    color: var(--kt-gray-900);
}

.dropdown-divider { border-color: var(--kt-gray-200); margin: 0.25rem 0; }

/* ---- Print ---- */
@media print {
    .app-sidebar, .app-header, .app-footer, .btn, form { display: none !important; }
    .app-main { margin-left: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
