:root {
      --primary-color: #0078d4;
      --primary-hover: #106ebe;
      --secondary-color: #50e6ff;
      --success-color: #16a316;
      --success-ligth: #04d104;
      --warning-color: #ffaa44;
      --danger-color: #d13438;
      --dark-bg: #1a1a1a;
      --card-bg: #ffffff;
      --card-hover: #f5f5f5;
      --text-primary: #242424;
      --text-secondary: #605e5c;
      --border-color: #edebe9;
      --gray-color: #effaff;
      --shadow-sm: 0 1.6px 3.6px rgba(0,0,0,0.13), 0 0.3px 0.9px rgba(0,0,0,0.11);
      --shadow-md: 0 3.2px 7.2px rgba(0,0,0,0.13), 0 0.6px 1.8px rgba(0,0,0,0.11);
      --shadow-lg: 0 6.4px 14.4px rgba(0,0,0,0.13), 0 1.2px 3.6px rgba(0,0,0,0.11);
      --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
      background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
      color: var(--text-primary);
      min-height: 100vh;
      padding-bottom: 80px;
    }

    /* Modern Navigation */
    .modern-nav {
      background: var(--card-bg);
      box-shadow: var(--shadow-sm);
      padding: 1rem 0;
      position: sticky;
      top: 0;
      z-index: 1000;
      backdrop-filter: blur(10px);
      border-bottom: 1px solid var(--border-color);
    }

    .logo-container {
      display: flex;
      align-items: center;
      gap: 12px;
      text-decoration: none;
      transition: var(--transition);
    }

    .logo-container:hover {
      transform: scale(1.02);
    }

    .logo-img {
      height: 40px;
      width: auto;
    }

    .logo-text {
      
      font-size: 1.5rem;
      font-weight: 600;
      color: #0039ba;
    }

    .logo-text span {
      
      color: #c80028;
      font-weight: 500;
    }

   /* Hero Card */
.hero-card {
   
    border-radius: 16px;
    padding: 2rem;
    color: #1a1a1a;
    box-shadow: var(--shadow-lg);
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
    animation: slideDown 0.6s ease-out;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

    @keyframes slideDown {
      from {
        opacity: 0;
        transform: translateY(-30px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .employee-photo-hero {
      width: 100px;
      height: 100px;
      border-radius: 50%;
      border: 4px solid rgba(255,255,255,0.3);
      object-fit: cover;
      box-shadow: var(--shadow-md);
      transition: var(--transition);
    }

    .employee-photo-hero:hover {
      transform: scale(1.1) rotate(5deg);
    }

    .hero-info {
      flex: 1;
    }

    .hero-info h2 {
      font-size: 1.75rem;
      font-weight: 600;
      margin-bottom: 1rem;
      text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    }

    .info-badge {
      background: rgba(255,255,255,0.2);
      backdrop-filter: blur(10px);
      padding: 0.5rem 1rem;
      border-radius: 8px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-right: 1rem;
      margin-bottom: 0.5rem;
      transition: var(--transition);
    }

    .info-badge:hover {
      background: rgba(255,255,255,0.3);
      transform: translateY(-2px);
    }

    .live-time {
      font-size: 1.5rem;
      font-weight: 700;
      font-family: 'Courier New', monospace;
      text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    }

    /* Action Button */
    .btn-action {
      background: var(--success-color);
      color: white;
      border: none;
      padding: 1rem 2rem;
      border-radius: 8px;
      font-weight: 600;
      font-size: 1.1rem;
      box-shadow: var(--shadow-md);
      transition: var(--transition);
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .btn-action:hover:not(:disabled) {
      transform: translateY(-3px);
      box-shadow: var(--shadow-lg);
      background: var(--success-ligth);
      color: white;
    }

    .btn-action:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }

    .btn-action i {
      font-size: 1.3rem;
    }

    /* Birthday Alert */
    .birthday-alert {
      background: linear-gradient(135deg, #fc266d 0%, #8d0036 100%);
      border: none;
      border-radius: 12px;
      padding: 1rem;
      margin-bottom: 1rem;
      animation: bounceIn 0.8s ease-out;
    }

    @keyframes bounceIn {
      0% { transform: scale(0.3); opacity: 0; }
      50% { transform: scale(1.05); }
      70% { transform: scale(0.9); }
      100% { transform: scale(1); opacity: 1; }
    }

    /* Modern Cards */
    .modern-card {
      background: var(--card-bg);
      border-radius: 12px;
      padding: 1.5rem;
      box-shadow: var(--shadow-sm);
      transition: var(--transition);
      border: 1px solid var(--border-color);
      height: 100%;
      animation: fadeInUp 0.6s ease-out;
      animation-fill-mode: both;
    }

    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(30px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .modern-card:hover {
      box-shadow: var(--shadow-md);
      transform: translateY(-4px);
    }

    .card-header-modern {
      border-bottom: 2px solid var(--primary-color);
      padding-bottom: 1rem;
      margin-bottom: 1.5rem;
    }

    .card-header-modern h5 {
      font-weight: 600;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 0;
    }

    .card-header-modern small {
      color: var(--text-secondary);
      font-size: 0.85rem;
      display: block;
      margin-top: 0.5rem;
    }

    /* Time Records */
    .time-record {
      background: linear-gradient(135deg, var(--card-bg) 0%, var(--card-hover) 100%);
      padding: 1rem;
      border-radius: 10px;
      margin-bottom: 0.75rem;
      border-left: 4px solid var(--primary-color);
      box-shadow: var(--shadow-sm);
      transition: var(--transition);
      animation: slideInRight 0.5s ease-out;
      animation-fill-mode: both;
    }

    @keyframes slideInRight {
      from {
        opacity: 0;
        transform: translateX(30px);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }

    .time-record:hover {
      transform: translateX(5px);
      box-shadow: var(--shadow-md);
    }

    .time-record:nth-child(1) { animation-delay: 0.1s; }
    .time-record:nth-child(2) { animation-delay: 0.2s; }
    .time-record:nth-child(3) { animation-delay: 0.3s; }
    .time-record:nth-child(4) { animation-delay: 0.4s; }

    .record-type {
      padding: 0.4rem 0.8rem;
      border-radius: 6px;
      font-size: 0.85rem;
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .record-type.entrada { background: #d4edda; color: var(--success-color); }
    .record-type.almoco { background: #fff3cd; color: #856404; }
    .record-type.retorno { background: #d1ecf1; color: #0c5460; }
    .record-type.saida { background: #f8d7da; color: var(--danger-color); }

    .record-time {
      font-size: 1.3rem;
      font-weight: 700;
      color: var(--primary-color);
      font-family: 'Courier New', monospace;
    }

    .status-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--success-color);
      display: inline-block;
      margin-right: 8px;
      animation: blink 2s ease-in-out infinite;
    }

    @keyframes blink {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.3; }
    }

    /* Filter Card */
    .filter-card {
      background: var(--card-bg);
      border-radius: 12px;
      padding: 1.5rem;
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--border-color);
    }

    .form-label {
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 0.5rem;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .form-control, .form-select {
      border: 1px solid var(--border-color);
      border-radius: 6px;
      padding: 0.75rem;
      transition: var(--transition);
      font-size: 0.95rem;
    }

    .form-control:focus, .form-select:focus {
      border-color: var(--primary-color);
      box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
      outline: none;
    }

    .btn-primary {
      background: var(--primary-color);
      border: none;
      padding: 0.75rem 1.5rem;
      border-radius: 6px;
      font-weight: 600;
      transition: var(--transition);
    }

    .btn-primary:hover {
      background: var(--primary-hover);
      transform: translateY(-2px);
      box-shadow: var(--shadow-md);
    }

    .btn-outline-secondary {
      border: 2px solid var(--border-color);
      color: var(--text-secondary);
      padding: 0.75rem 1.5rem;
      border-radius: 6px;
      font-weight: 600;
      transition: var(--transition);
    }

    .btn-outline-secondary:hover {
      background: var(--card-hover);
      border-color: var(--text-secondary);
      transform: translateY(-2px);
    }

    /* Table Styles */
    .table-modern {
      background: white;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: var(--shadow-sm);
    }

    .table-modern thead {
      background: linear-gradient(135deg, var(--primary-color) 0%, #1890ff 100%);
      color: white;
    }

    .table-modern thead th {
      font-weight: 600;
      padding: 1rem;
      border: none;
      text-transform: uppercase;
      font-size: 0.85rem;
      letter-spacing: 0.5px;
    }

    .table-modern tbody tr {
      transition: var(--transition);
      border-bottom: 1px solid var(--border-color);
    }

    .table-modern tbody tr:hover {
      background: var(--card-hover);
      transform: scale(1.01);
    }

    .table-modern tbody td {
      padding: 1rem;
      vertical-align: middle;
    }

    .badge {
      padding: 0.5rem 1rem;
      border-radius: 6px;
      font-weight: 600;
      font-size: 0.85rem;
    }

    .badge.bg-success { background: var(--success-color) !important; }
    .badge.bg-warning { background: var(--warning-color) !important; color: #000; }
    .badge.bg-danger { background: var(--danger-color) !important; }
    .badge.bg-primary { background: var(--primary-color) !important; }
    .badge.bg-info { background: #17a2b8 !important; }

    /* Empty State */
    .empty-state {
      text-align: center;
      padding: 3rem 1rem;
      animation: fadeIn 0.6s ease-out;
    }

    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    .empty-state i {
      font-size: 4rem;
      color: var(--border-color);
      margin-bottom: 1rem;
    }

    .empty-state h5 {
      color: var(--text-secondary);
      font-weight: 600;
    }

    .empty-state p {
      color: var(--text-secondary);
      opacity: 0.8;
    }

    .logout-btn {
      background: var(--danger-color);
      color: white;
      border: none;
      padding: 0.75rem 1.5rem;
      border-radius: 8px;
      font-weight: 600;
      text-decoration: none;
      transition: var(--transition);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .logout-btn:hover {
      background: #a82a2e;
      transform: translateY(-2px);
      box-shadow: var(--shadow-md);
      color: white;
    }

    /* Modal Styles */
    .modal-content {
      border: none;
      border-radius: 16px;
      overflow: hidden;
      box-shadow: var(--shadow-lg);
    }

    .modal-header {
      background: linear-gradient(135deg, var(--primary-color) 0%, #1890ff 100%);
      color: white;
      border: none;
      padding: 0.9rem;
      position: relative;
    }

    .modal-logo-img {
      height: 30px;
      width: auto;
      margin-right: 1rem;
    }

    .modal-title {
      font-weight: 600;
      display: flex;
      align-items: center;
      font-size: 18px;
    }

    .modal-body {
      padding: 0.9rem;
      text-align: center;
    }

    .photo-container {
      position: relative;
      display: inline-block;
      margin-bottom: 1rem;
    }

    .scan-animation {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 120px;
      height: 120px;
      border: 3px solid var(--success-color);
      border-radius: 50%;
      animation: scanPulse 2s ease-in-out infinite;
    }

    @keyframes scanPulse {
      0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
      }
      50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.08;
      }
    }

    .employee-photo-modal {
      width: 130px;
      height: 130px;
      border-radius: 50%;
      object-fit: cover;
      border: 6px solid var(--gray-color);
      box-shadow: var(--shadow-lg);
      position: relative;
      z-index: 2;
    }

    .status-check {
      position: absolute;
      bottom: 0;
      right: 0;
      background: var(--success-color);
      color: white;
      width: 35px;
      height: 35px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 3px solid white;
      z-index: 3;
    }

    .employee-name-modal {
      font-size: 1rem;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 1rem;
      white-space: normal; 
    }

    .employee-detail {
      color: var(--text-secondary);
      margin-bottom: 0.5rem;
    }

    .digital-time-display {
      padding: 0.5rem;
      border-radius: 12px;
      margin: 0.8rem 0;
      height-max: 40px;
      box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    }

    .digital-time {
      font-size: 2.5rem;
      color: var(--primary-color);
      font-weight: 700;
      font-family: 'Courier New', monospace;
      padding: 6px;
      border-radius: 6px;
      margin-bottom: 8px;
      word-break: keep-all;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .time-label {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      margin-top: 0.5rem;
      font-weight: 600;
      color: var(--text-secondary);
    }

    .typewriter-alert {
      background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
      border: none;
      border-radius: 10px;
      padding: 0.6rem;
      margin-top: 0.4rem;
    }

    .typewriter {
      font-weight: 600;
      color: var(--primary-color);
      white-space: normal;
      word-break: break-word;
      line-height: 1.4;
      animation: none !important;
      opacity: 1 !important;
      width: 100% !important;
    }

    .btn-confirm {
      background: var(--success-color);
      color: white;
      border: none;
      padding: 1rem 3rem;
      border-radius: 8px;
      font-weight: 600;
      font-size: 1.1rem;
      transition: var(--transition);
      box-shadow: var(--shadow-md);
    }

    .btn-confirm:hover:not(:disabled) {
      background: #0e6b0e;
      transform: translateY(-3px);
      box-shadow: var(--shadow-lg);
    }

    .btn-confirm:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }

    .barcode-section {
      background: #f5f5f5;
      padding: 1rem;
      border-top: 2px dashed var(--border-color);
    }

    .barcode-display {
      display: flex;
      justify-content: center;
      gap: 1px;
      margin-bottom: 0.5rem;
    }

    .barcode-line {
      height: 40px;
      background: #000;
      display: inline-block;
    }

    .barcode-id {
      font-size: 0.75rem;
      color: var(--text-secondary);
      text-align: center;
      font-family: 'Courier New', monospace;
    }

    .modal-footer {
      background: rgba(143, 157, 177, 0.1);
      padding: 0.75rem 0.9rem;
      display: flex;
      justify-content: center;
    }

    /* Pagination */
    .pagination {
      gap: 0.5rem;
      flex-wrap: wrap;
      justify-content: center;
    }

    .page-link {
      border: 1px solid var(--border-color);
      color: var(--primary-color);
      padding: 0.5rem 1rem;
      border-radius: 6px;
      font-weight: 600;
      transition: var(--transition);
    }

    .page-link:hover {
      background: var(--primary-color);
      color: white;
      border-color: var(--primary-color);
    }

    .page-item.active .page-link {
      background: var(--primary-color);
      border-color: var(--primary-color);
    }

    /* Scroll to top button */
    .scroll-top {
      position: fixed;
      bottom: 90px;
      right: 20px;
      background: var(--primary-color);
      color: white;
      width: 50px;
      height: 50px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: var(--shadow-md);
      transition: var(--transition);
      opacity: 0;
      visibility: hidden;
      z-index: 998;
    }

    .scroll-top.visible {
      opacity: 1;
      visibility: visible;
    }

    .scroll-top:hover {
      background: var(--primary-hover);
      transform: translateY(-5px);
    }

    /* Loading Animation */
    .loading-spinner {
      display: inline-block;
      width: 20px;
      height: 20px;
      border: 3px solid rgba(255,255,255,0.3);
      border-radius: 50%;
      border-top-color: white;
      animation: spin 1s ease-in-out infinite;
    }

    @keyframes spin {
      to { transform: rotate(360deg); }
    }

    /* Confetti */
    .confetti {
      pointer-events: none;
    }

    /* ========================================
       CORREÇÕES MODAL E RESPONSIVO
    ======================================== */

    /* Prevenir scroll da página quando modal está aberto */
    body.modal-open {
      overflow: hidden;
      padding-right: 0 !important;
    }

    /* Modal fixo e centralizado */
    .modal {
      overflow-y: auto !important;
      padding-right: 0 !important;
    }

    .modal-dialog {
      margin: 1.75rem auto;
      display: flex;
      align-items: center;
      min-height: calc(100vh - 3.5rem);
    }

    /* Responsive Design */
    @media (max-width: 768px) {
      .hero-card {
        padding: 1.5rem;
      }

      .employee-photo-hero {
        width: 70px;
        height: 70px;
      }

      .hero-info {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        flex-direction: column;
      }

      .hero-info h2 {
        font-size: 1.25rem;
      }

      .info-badge {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
      }

      .live-time {
        font-size: 1.2rem;
      }

      .btn-action {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        justify-content: center;
      }

      .modern-card {
        margin-bottom: 1rem;
      }

      .table-modern {
        font-size: 0.85rem;
      }

      .table-modern thead th,
      .table-modern tbody td {
        padding: 0.75rem 0.5rem;
      }

      .digital-time {
        font-size: 2rem;
      }

      .btn-confirm {
        padding: 0.75rem 2rem;
        font-size: 1rem;
      }

      .user-footer {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
      }

      .logout-btn {
        width: 100%;
        justify-content: center;
      }

      /* Paginação responsiva */
      .pagination {
        gap: 0.25rem;
        padding: 0.5rem 0;
      }

      .page-link {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
        min-width: 36px;
        text-align: center;
      }

      .page-item {
        margin: 0.1rem;
      }

      /* Modal responsivo */
      .modal-dialog {
        margin: 0.5rem;
        min-height: calc(100vh - 1rem);
        max-width: calc(100vw - 1rem);
      }

      .modal-content {
        max-height: calc(100vh - 1rem);
        display: flex;
        flex-direction: column;
      }

      .modal-body {
        padding: 1rem;
        overflow-y: auto;
        flex: 1;
      }

      .digital-time-display {
        padding: 0.5rem;
        margin: 0.5rem 0;
      }

      .digital-time {
        font-size: 1.8rem !important;
        word-break: break-all;
        white-space: normal;
        text-align: center;
        line-height: 1.2;
      }

      .typewriter {
        font-size: 0.9rem;
        white-space: normal;
        word-break: break-word;
        text-align: center;
      }

      .scan-animation {
        width: 90px;
        height: 90px;
      }

      .employee-photo-modal {
        width: 100px;
        height: 100px;
      }
    }

    @media (max-width: 576px) {
      .hero-card {
        padding: 1rem;
      }

      .employee-photo-hero {
        width: 90px;
        height: 90px;
      }

      .hero-info h2 {
        font-size: 1.1rem;
      }

      .info-badge {
        display: flex;
        font-size: 0.75rem;
        padding: 0.8rem 0.4rem;
        align-items: center;
        flex-direction: column;
        max-width: 90px;
      }

      .live-time {
        font-size: 1rem;
      }

      .card-header-modern h5 {
        font-size: 1rem;
      }

      .time-record {
        padding: 0.75rem;
      }

      .record-time {
        font-size: 1.1rem;
      }

      .filter-card {
        padding: 1rem;
      }

      .btn-primary,
      .btn-outline-secondary {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
      }

      .digital-time {
        font-size: 1.5rem !important;
      }

      .employee-name-modal {
        font-size: 1rem;
        margin-bottom: 1rem;
        word-wrap: break-word;
        white-space: normal;
      }

      .employee-photo-modal {
        width: 100px;
        height: 100px;
      }

      /* Paginação mobile */
      .pagination {
        gap: 0.2rem;
        font-size: 0.8rem;
      }

      .page-link {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
        min-width: 32px;
      }

      .page-item.d-none.d-md-inline-block {
        display: none !important;
      }

      /* Modal mobile */
      .modal-dialog {
        margin: 0.25rem;
        min-height: calc(100vh - 0.5rem);
        max-width: calc(100vw - 0.5rem);
      }

      .modal-content {
        max-height: calc(100vh - 0.5rem);
        border-radius: 12px;
      }

      .modal-header {
        padding: 0.75rem;
      }

      .modal-title {
        display: flex;
      align-items: center;
        font-size: 16px;
      }

      .modal-logo-img {
        height: 24px;
      }

      .btn-confirm {
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 1rem;
      }

      .barcode-section {
        padding: 0.75rem;
      }

      .status-check {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
      }
    }

    /* Ajuste extra para telas muito pequenas */
    @media (max-width: 380px) {
      .pagination {
        font-size: 0.75rem;
      }

      .page-link {
        padding: 0.3rem 0.5rem;
        min-width: 28px;
        font-size: 0.75rem;
      }

      .digital-time {
        font-size: 1.3rem !important;
      }

      .employee-photo-modal {
        width: 80px;
        height: 80px;
      }

      .scan-animation {
        width: 75px;
        height: 75px;
      }
    }