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

:root {
  /* Brand PontoZen Theme Tokens */
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-light: #e0f2fe;
  --primary-foreground: #ffffff;

  --accent: #f0f9ff;
  --accent-foreground: #0369a1;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #38bdf8;

  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-text: #065f46;

  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-text: #991b1b;

  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-text: #92400e;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

/* -------------------------------------------------------------------------- */
/* AppShell Layout & Grid                                                     */
/* -------------------------------------------------------------------------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 260px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset-y: 0;
  left: 0;
  z-index: 50;
  transition: transform 0.2s ease-in-out;
}

.sidebar-header {
  height: 64px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.brand-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background: var(--bg-page);
  color: var(--text-main);
  text-decoration: none;
}

.nav-link.active {
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.nav-link .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-meta {
  min-width: 0;
  flex: 1;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  text-transform: capitalize;
  color: var(--text-muted);
}

/* Mobile topbar */
.mobile-topbar {
  display: none;
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 45;
}

.app-main {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-content {
  padding: 24px 32px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 991px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.open {
    transform: translateX(0);
  }
  .mobile-overlay.open {
    display: block;
  }
  .mobile-topbar {
    display: flex;
  }
  .app-main {
    margin-left: 0;
  }
  .app-content {
    padding: 16px;
  }
}

/* -------------------------------------------------------------------------- */
/* Containers, Cards & Typography                                             */
/* -------------------------------------------------------------------------- */
.page-header {
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.card-description {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body {
  padding: 20px;
}

/* -------------------------------------------------------------------------- */
/* Botões & Formulários                                                       */
/* -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.4;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.2);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: #fff;
  color: var(--text-main);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover {
  background: #059669;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Formulários */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control, .form-select, textarea.form-control {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

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

/* -------------------------------------------------------------------------- */
/* Tabelas                                                                    */
/* -------------------------------------------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.table th {
  padding: 10px 16px;
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.table tbody tr:hover {
  background-color: #fafbfc;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.tabular-nums { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }

/* -------------------------------------------------------------------------- */
/* Badges & Tags                                                              */
/* -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}

.badge-primary { background: var(--primary-light); color: var(--primary-hover); }
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-muted   { background: #f1f5f9; color: var(--text-muted); }

/* -------------------------------------------------------------------------- */
/* KPIs & Métricas                                                            */
/* -------------------------------------------------------------------------- */
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-xs);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  font-family: var(--font-mono);
}

.kpi-label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--text-subtle);
}

/* -------------------------------------------------------------------------- */
/* Relógio & Marcação de Ponto                                                */
/* -------------------------------------------------------------------------- */
.live-clock-card {
  text-align: center;
  padding: 30px 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
  border: 1px solid #bae6fd;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.live-time-display {
  font-family: var(--font-mono);
  font-size: 52px;
  font-weight: 700;
  color: #0369a1;
  letter-spacing: -0.02em;
  line-height: 1;
}

.live-date-display {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 500;
}

.clock-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
}

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

.clock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 12px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s ease;
}

.clock-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.clock-btn .clock-emoji {
  font-size: 26px;
}

.clock-btn .clock-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.clock-btn.disabled, .clock-btn:disabled {
  opacity: 0.5;
  background: #f1f5f9;
  border-color: var(--border);
  cursor: not-allowed;
  transform: none;
}

.clock-btn.ja-marcado {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

/* Modais / Diálogos */
.pz-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pz-modal.active {
  display: flex;
}

.pz-modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.pz-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pz-modal-body {
  padding: 20px;
  max-height: 80vh;
  overflow-y: auto;
}

.pz-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
