:root {
  --bg: #e6e9ee;
  --bg-soft: #f8fafc;

  --navy: #0b1d33;
  --navy-2: #071426;
  --teal: #0d6e6d;
  --teal-light: #14b8a6;
  --emerald: #16c172;

  --sidebar: #0b1d33;
  --sidebar-soft: #102744;
  --sidebar-border: rgba(255, 255, 255, 0.1);

  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-blue: #eefdfb;

  --text: #0b1d33;
  --muted: #64748b;
  --muted-strong: #475569;

  --border: #dbe3ef;
  --border-soft: #edf2f7;

  --primary: #0d6e6d;
  --primary-hover: #0b5e5d;
  --primary-soft: #dff7f3;

  --secondary: #475569;
  --secondary-hover: #334155;

  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: #fee2e2;

  --success: #16c172;
  --success-hover: #12a965;
  --success-soft: #dcfce7;

  --warning: #f59e0b;
  --warning-soft: #fef3c7;

  --shadow-sm: 0 4px 14px rgba(11, 29, 51, 0.06);
  --shadow: 0 14px 35px rgba(11, 29, 51, 0.09);
  --shadow-strong: 0 20px 55px rgba(11, 29, 51, 0.16);

  --radius: 18px;
  --radius-lg: 24px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  background:
    radial-gradient(
      circle at top left,
      rgba(13, 110, 109, 0.13),
      transparent 28%
    ),
    radial-gradient(
      circle at top right,
      rgba(22, 193, 114, 0.11),
      transparent 26%
    ),
    var(--bg);
  color: var(--text);
}

.hidden {
  display: none !important;
}

/* LOGIN */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.98),
    rgba(248, 250, 252, 0.98)
  );
  border: 1px solid rgba(219, 227, 239, 0.95);
  border-radius: 28px;
  box-shadow: var(--shadow-strong);
  padding: 34px;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--navy), var(--teal), var(--emerald));
}

.login-logo-wrap {
  width: 100%;
  padding: 10px 8px 14px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-logo {
  width: 100%;
  max-width: 330px;
  height: auto;
  display: block;
  object-fit: contain;
}

.login-card h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  color: var(--navy);
}

.login-card h1 strong {
  color: var(--teal);
}

.login-card h1 span {
  color: var(--navy);
}

.login-card .muted {
  margin-bottom: 22px;
}

/* LAYOUT */
.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background:
    radial-gradient(
      circle at 15% 10%,
      rgba(22, 193, 114, 0.18),
      transparent 28%
    ),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 60%, #03101f 100%);
  color: #fff;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.sidebar-logo {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.brand {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
  padding: 6px 8px;
}

.subtitle {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
  margin: 0 0 22px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-meta-label {
  font-size: 11px;
  color: #89a6c6;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.sidebar-org-name {
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
  margin-top: 3px;
  word-break: break-word;
}

#userInfo {
  color: #dce7f5;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 3px;
  word-break: break-word;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 12px 0;
}

.content {
  padding: 30px;
  max-width: 1600px;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  padding: 22px 24px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.98),
    rgba(248, 250, 252, 0.95)
  );
  border: 1px solid rgba(219, 227, 239, 0.95);
  border-radius: 26px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.topbar h2 {
  margin: 0 0 5px;
  font-size: 30px;
  letter-spacing: -0.8px;
}

/* TIPOGRAFIA */
h1,
h2,
h3 {
  color: var(--text);
}

h3 {
  margin: 0 0 18px;
  font-size: 20px;
  letter-spacing: -0.3px;
}

p {
  line-height: 1.6;
}

/* FORMS */
label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #334155;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  outline: none;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    transform 0.05s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(13, 110, 109, 0.55);
  box-shadow:
    0 0 0 4px rgba(13, 110, 109, 0.14),
    0 8px 18px rgba(13, 110, 109, 0.08);
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

/* BOTÕES */
button {
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--teal), var(--emerald));
  color: #fff;
  padding: 12px 15px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(13, 110, 109, 0.2);
  transition:
    transform 0.07s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

button:hover {
  background: linear-gradient(135deg, var(--primary-hover), #0a4f4e);
  box-shadow: 0 10px 22px rgba(13, 110, 109, 0.28);
}

button:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: linear-gradient(135deg, #64748b, #475569);
  box-shadow: 0 8px 16px rgba(71, 85, 105, 0.16);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #475569, #334155);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 8px 16px rgba(220, 38, 38, 0.18);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.btn-green {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 8px 16px rgba(22, 163, 74, 0.18);
}

.btn-green:hover {
  background: linear-gradient(135deg, #16a34a, #15803d);
}

/* MENU */
.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav button {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.055);
  color: #dbeafe;
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 12px 14px;
  box-shadow: none;
  position: relative;
}

.nav button:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.nav button.active {
  background: linear-gradient(135deg, var(--teal), var(--emerald));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(13, 110, 109, 0.32);
}

.nav button.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 99px;
  background: var(--emerald);
}

/* CARDS */
.card,
.kpi {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.99),
    rgba(248, 250, 252, 0.96)
  );
  border: 1px solid rgba(219, 227, 239, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card {
  padding: 24px;
}

.kpi {
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 90px;
  height: 90px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
}

.kpi .label {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 800;
}

.kpi .value {
  font-size: 34px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -1px;
}

/* GRIDS */
.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

/* SEÇÕES */
.section {
  display: none;
}

.section.active {
  display: block;
}

/* TABELAS */
.table-wrap {
  margin-top: 16px;
  overflow: auto;
  border: 1px solid rgba(219, 227, 239, 0.95);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #f7fffd;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* MENSAGENS */
.msg {
  margin-top: 12px;
  min-height: 20px;
  font-size: 14px;
  font-weight: 800;
}

.success {
  color: var(--success);
}

.error {
  color: var(--danger);
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

/* PRE */
pre {
  margin: 0;
  padding: 18px;
  border-radius: 16px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 14px;
  line-height: 1.7;
  overflow: auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* RESUMOS */
.summary-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #eefdfb, #f8fafc);
  border: 1px solid rgba(219, 227, 239, 0.95);
}

.summary-info {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.summary-info b {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: var(--muted);
  margin-bottom: 6px;
}

.status-ok {
  color: var(--success);
  font-weight: 800;
}

.status-alert {
  color: var(--danger);
  font-weight: 800;
}

.status-extra {
  color: var(--primary);
  font-weight: 800;
}

.print-only {
  display: none;
}

/* CHECKBOXES */
input[type="checkbox"] {
  width: auto !important;
  margin-right: 8px;
  accent-color: var(--teal);
}

/* IDENTIDADE KONDALEF ACCESS */
.login-tagline {
  margin: 6px 0 4px;
  color: var(--teal);
  font-weight: 900;
  letter-spacing: 0.2px;
  text-align: center;
}

.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  background:
    radial-gradient(
      circle at top right,
      rgba(22, 193, 114, 0.18),
      transparent 35%
    ),
    linear-gradient(135deg, #ffffff, #f7fffd);
}

.hero-card h3 {
  margin-bottom: 8px;
}

.hero-badge {
  min-width: 190px;
  padding: 18px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(11, 29, 51, 0.98),
    rgba(13, 110, 109, 0.95)
  );
  box-shadow: 0 18px 34px rgba(11, 29, 51, 0.18);
}

.hero-badge span {
  display: block;
  font-size: 12px;
  color: #bbf7d0;
  font-weight: 800;
  margin-bottom: 5px;
}

.hero-badge strong {
  font-size: 28px;
  letter-spacing: -0.8px;
}

.dashboard-brand-card {
  background:
    radial-gradient(
      circle at top right,
      rgba(22, 193, 114, 0.16),
      transparent 30%
    ),
    linear-gradient(135deg, #ffffff, #f7fffd);
}

.dashboard-brand-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.dashboard-logo-box {
  width: min(420px, 42%);
  background: #fff;
  border: 1px solid rgba(219, 227, 239, 0.95);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 18px 38px rgba(11, 29, 51, 0.08);
  flex: 0 0 auto;
}

.dashboard-logo {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.sidebar::after {
  content: "";
  position: fixed;
  left: 0;
  bottom: 0;
  width: 280px;
  height: 210px;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      transparent 0 22px,
      rgba(22, 193, 114, 0.15) 22px 24px,
      transparent 24px
    ),
    linear-gradient(
      0deg,
      transparent 0 22px,
      rgba(13, 110, 109, 0.18) 22px 24px,
      transparent 24px
    );
  opacity: 0.35;
  mask-image: linear-gradient(to top, #000, transparent);
}

/* RESPONSIVO */
@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .sidebar::after {
    display: none;
  }

  .sidebar-logo-card {
    max-width: 320px;
  }

  .content {
    padding: 18px;
  }

  .topbar {
    padding: 18px;
  }

  .topbar h2 {
    font-size: 24px;
  }

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

  .dashboard-brand-content {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-logo-box {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .hero-card {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-badge {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .login-card {
    padding: 24px;
    border-radius: 22px;
  }

  .login-logo {
    max-width: 280px;
  }

  .card,
  .kpi {
    padding: 18px;
  }

  .summary-header {
    grid-template-columns: 1fr;
  }
}

/* IMPRESSÃO */
@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  #loginView,
  .no-print {
    display: none !important;
  }

  .layout {
    display: block;
  }

  .content {
    padding: 0;
  }

  .section {
    display: none !important;
  }

  #section-timesheet,
  #section-period,
  #section-daily {
    display: block !important;
  }

  .card,
  .kpi,
  .summary-info,
  .table-wrap {
    box-shadow: none;
    border-radius: 0;
    border: 1px solid #ddd;
  }

  .print-only {
    display: block;
    margin-bottom: 12px;
  }

  table {
    min-width: 0;
  }

  th,
  td {
    font-size: 11px;
    padding: 6px 8px;
  }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.hidden {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 23, 0.72);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(720px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-card textarea {
  width: 100%;
  resize: vertical;
  min-height: 96px;
}
