/* =========================================
RESET
========================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: #f9f9f9;
}

body {
  margin: 0 auto;
  padding: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f9f9f9;
  color: #111827;
  display: flex;
  flex-direction: column;
}

/* Desktop com aspeto mobile */
@media (min-width: 768px) {
  body {
    max-width: 480px;
  }
}


/* =========================================
HEADER
========================================= */

.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 64px;
  background: #f9f9f9;
  z-index: 1000;
}

.logo {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
}

.logo img {
  width: 100px;
  height: auto;
  display: block;
}


/* =========================================
MAIN
========================================= */

.app-main {
  flex: 1;
  padding-top: 80px;
  padding-bottom: 90px;
}


/* =========================================
CONTAINERS
========================================= */

.container,
.containerindex,
.containermenu,
.containerguias,
.containerpick {
  width: calc(100% - 20px);
  margin: 10px auto 15px auto;
  padding: 18px;
  background: #dddddd;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}


/* =========================================
FOOTER MENU
========================================= */

.footer-menu {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #f8f9fa;
  border-top: 1px solid #ddd;
  z-index: 999;
}

.footer-content {
  text-decoration: none;
}

/* =========================================
CTA BUTTON (LOGIN / ACTION BUTTON)
========================================= */

.cta-button {

  display: inline-block;

  margin-top: 10px;

  padding: 12px 22px;

  background: #2563eb;

  color: #ffffff;

  font-size: 15px;

  font-weight: 600;

  text-decoration: none;

  border-radius: 10px;

  transition: all 0.2s ease;

  box-shadow: 0 4px 12px rgba(0,0,0,0.08);

}

.cta-button:hover {

  background: #1d4ed8;

  transform: translateY(-2px);

  box-shadow: 0 6px 16px rgba(0,0,0,0.12);

}

.cta-button:active {

  transform: translateY(0);

  box-shadow: 0 2px 6px rgba(0,0,0,0.08);

}
/* =========================================
ERP PAGE STRUCTURE
========================================= */

.erp-page {
  width: 100%;
}

.erp-header {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.erp-title {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
  text-align: center;
}

.erp-subtitle {
  margin-top: 6px;
  text-align: center;
  font-size: 14px;
  color: #6b7280;
  font-weight: 600;
}


/* =========================================
ERP CARDS
========================================= */

.erp-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.05);
}


/* =========================================
MENU GRID
========================================= */

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.menu-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #111827;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.menu-card i {
  font-size: 28px;
  margin-bottom: 10px;
  color: #2563eb;
}

.menu-card span {
  font-size: 14px;
  text-align: center;
}

.menu-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}


/* =========================================
ERP TABLES
========================================= */

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.erp-table-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  overflow: hidden;
}

.erp-table {
  width: 100%;
  border-collapse: collapse;
}

.erp-table thead {
  background: #f3f4f6;
}

.erp-table th {
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  white-space: nowrap;
}

.erp-table td {
  padding: 12px;
  font-size: 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.erp-table tbody tr:hover {
  background: #f9fafb;
}

.project-cell {
  font-family: monospace;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.text-center {
  text-align: center;
}

.empty-row td {
  color: #6b7280;
}


/* =========================================
BADGES
========================================= */

.badge-status {
  display: inline-block;
  min-width: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

.badge-approved {
  background: #16a34a;
}

.badge-not-approved {
  background: #dc2626;
}

.badge-neutral {
  background: #6b7280;
}


/* =========================================
ERP FORMS
========================================= */

.erp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.erp-form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.erp-form-group-full {
  grid-column: 1 / -1;
}

.erp-form-group label {
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.erp-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
}

.erp-input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}

.erp-form-actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.erp-loading {
  font-size: 14px;
  color: #6b7280;
}

.form-text {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}


/* =========================================
TECHNICIANS LIST
========================================= */

.erp-tecnicos-list {
  max-height: 320px;
  overflow-y: auto;
}


/* =========================================
SELECT2 FIX
========================================= */

.select2-container {
  width: 100% !important;
}

.select2-container .select2-selection--single {
  height: 42px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  background: #fff !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 40px !important;
  padding-left: 12px !important;
  color: #111827 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 40px !important;
}


/* =========================================
LOGIN
========================================= */

.loginpage .title {
  font-size: 22px;
  margin-bottom: 20px;
}

.input.is-large {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  margin-bottom: 15px;
}

.notification.is-danger {
  background: rgba(255, 0, 0, 0.1);
  color: #ff4d4f;
  padding: 10px;
  border-radius: 10px;
}

.checkbox input[type="checkbox"] {
  margin-right: 8px;
  transform: scale(1.1);
}


/* =========================================
BUTTONS
========================================= */

.button.is-info {
  background: linear-gradient(to right, #a8d0e6, #cae2f0);
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  color: #111827;
}

.button.is-info:hover {
  background: linear-gradient(to right, #cae2f0, #a8d0e6);
}

.btn,
button {
  font-family: inherit;
}

.erp-table .button.is-info {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 8px;
  white-space: nowrap;
}


/* =========================================
MODALS
========================================= */

.modal-relatorios-duplicados {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(0, 0, 0, 0.45);
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.modal-content {
	max-height: 90vh;
    overflow-y: auto;
  width: 100%;
  max-width: 500px;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.modal-content h4 {
  margin-top: 0;
  margin-bottom: 18px;
  text-align: center;
}

.modal-content label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.modal-content input[type="text"],
.modal-content input[type="date"],
.modal-content input[type="time"],
.modal-content select,
.modal-content textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-family: inherit;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}

.erp-modal-details {
  text-align: left;
}

.erp-modal-details p {
  margin-bottom: 10px;
  font-size: 14px;
}


/* =========================================
CALENDAR
========================================= */

.erp-calendar {
  margin-top: 6px;
}

#calendar {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.fc {
  font-size: 13px;
}

.fc-toolbar-title {
  font-size: 16px !important;
}

.fc-button {
  font-size: 12px !important;
}

.fc-timegrid-slot-label {
  font-size: 10px !important;
}


/* =========================================
EXTRA HOURS
========================================= */

.extrahours-wrapper {
  width: 100%;
}

.extrahours-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.extrahours-title {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
  text-align: center;
  width: 100%;
}

.extrahours-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;
}

.extrahours-filters label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.extrahours-filters select {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.summary-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.05);
}

.summary-card .label {
  font-size: 12px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.summary-card .value {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}


/* =========================================
CONTACTS
========================================= */

.contact-search {
  margin-bottom: 16px;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-item {
  width: 100%;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
  color: #111827;
  text-align: left;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.05);
}

.contact-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.contact-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.contact-info strong,
.contact-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-info strong {
  font-size: 15px;
  font-weight: 700;
}

.contact-info small {
  font-size: 12px;
  color: #6b7280;
}

.empty-state {
  padding: 18px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  text-align: center;
}

.contact-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(17, 24, 39, 0.55);
}

.contact-modal-box {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 14px;
  padding: 22px 18px 18px;
  position: relative;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

.contact-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #374151;
  font-size: 24px;
  line-height: 1;
}

.contact-modal-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  margin-bottom: 14px;
}

.contact-modal-name {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.contact-modal-role {
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
}

.contact-modal-detail {
  margin-top: 4px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}

.contact-modal-actions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-action {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #111827;
  font-weight: 600;
}

.contact-action span {
  overflow-wrap: anywhere;
}

.contact-action.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}


/* =========================================
RESPONSIVE
========================================= */

@media (max-width: 480px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }

  .erp-form-grid {
    grid-template-columns: 1fr;
  }

  .summary-cards {
    grid-template-columns: 1fr;
  }

  .container,
  .containerindex,
  .containermenu,
  .containerguias,
  .containerpick {
    width: calc(100% - 16px);
    padding: 16px;
  }

  .modal-content {
    padding: 16px;
  }
}
