/* Michpal Emergency Reporting - Matching portal-qa.michpaliram.co.il */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Rubik', sans-serif;
  font-weight: 400;
  background-color: rgba(211, 227, 237, 0.4);
  color: #333;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ======================== Layout ======================== */

.page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  padding: 20px;
}

/* Login page background with circular icon pattern */
.login-bg {
  background-image: url('/img/bg.31a470ab.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 700px;
}

.login-logo {
  height: 48px;
  margin-bottom: 12px;
}

/* ======================== Top Bar ======================== */

.topbar {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  height: 36px;
}

.topbar-title {
  font-size: 14px;
  font-weight: 500;
  color: #3b70a4;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-user {
  font-size: 13px;
  color: #666;
}

.topbar-logout {
  font-size: 13px;
  color: #4AAEEF;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.15s;
}

.topbar-logout:hover {
  background: rgba(74, 174, 239, 0.08);
}

/* ======================== Company Selector (Topbar) ======================== */

.topbar-company-select {
  appearance: none;
  -webkit-appearance: none;
  background: #f0f7ff;
  border: 1px solid #d0dde8;
  border-radius: 8px;
  padding: 6px 28px 6px 12px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: #3b70a4;
  cursor: pointer;
  outline: none;
  direction: rtl;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%233b70a4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 10px center;
  transition: border-color 0.15s, box-shadow 0.15s;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-company-select:hover {
  border-color: #4AAEEF;
}

.topbar-company-select:focus {
  border-color: #4AAEEF;
  box-shadow: 0 0 0 3px rgba(74, 174, 239, 0.12);
}

/* ======================== Company Activate List ======================== */

.company-activate-list {
  margin-bottom: 16px;
}

.company-activate-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

.company-activate-item:hover {
  border-color: #4AAEEF;
}

.company-activate-info {
  flex: 1;
  min-width: 0;
}

.company-activate-name {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  margin-bottom: 2px;
}

.company-activate-hp {
  font-size: 12px;
  color: #999;
  direction: ltr;
  text-align: right;
}

.company-activate-btn {
  width: auto !important;
  min-width: 80px;
  padding: 0 20px !important;
  height: 38px !important;
  line-height: 38px !important;
  font-size: 14px !important;
  margin-top: 0 !important;
  margin-right: 12px;
  flex-shrink: 0;
}

/* ======================== Company Subtitle ======================== */

.company-subtitle {
  text-align: center;
  font-size: 13px;
  color: #3b70a4;
  font-weight: 500;
  margin-top: -12px;
  margin-bottom: 16px;
}

.company-actions {
  text-align: center;
  font-size: 13px;
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.company-actions-sep {
  color: #ccc;
}

.text-link--danger {
  color: #c62828 !important;
}

.text-link--danger:hover {
  color: #b71c1c !important;
}

.has-topbar {
  padding-top: 72px;
}

/* ======================== Card ======================== */

.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  padding: 32px;
  width: 100%;
  max-width: 448px;
}

.card-wide {
  max-width: 900px;
}

.card h2 {
  font-size: 18px;
  font-weight: 500;
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

.card p {
  color: #666;
  font-size: 14px;
  line-height: 1.7;
}

.card-subtitle {
  text-align: center;
  color: #888;
  font-size: 13px;
  margin-bottom: 20px;
}

/* ======================== Tabs ======================== */

.tabs {
  display: flex;
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 16px;
  font-weight: 400;
  color: #666;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  border-bottom: 5px solid #fff;
  transition: border-color 0.2s, color 0.2s;
}

.tab.active {
  color: #333;
  border-bottom-color: #3b70a4;
}

.tab:hover:not(.active) {
  color: #444;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ======================== Form ======================== */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: #777;
  margin-bottom: 6px;
}

.input-wrapper {
  position: relative;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  opacity: 0.4;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #dde3ea;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 400;
  direction: rtl;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
  color: #333;
}

.form-input:focus {
  border-color: #4AAEEF;
  box-shadow: 0 0 0 3px rgba(74, 174, 239, 0.1);
}

.form-input::placeholder {
  color: #b0b8c4;
}

.form-input--ltr {
  direction: ltr;
  text-align: right;
}

.form-input--code {
  text-align: center;
  letter-spacing: 6px;
  font-size: 22px;
  font-weight: 500;
}

.form-hint {
  font-size: 14px;
  color: #666;
  margin-bottom: 16px;
  text-align: center;
}

/* ======================== Buttons ======================== */

.btn {
  display: block;
  width: 100%;
  border: none;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary {
  background-color: #4AAEEF;
  color: #fff;
  font-size: 16px;
  border-radius: 45px;
  padding: 0;
  height: 54px;
  line-height: 54px;
  box-shadow: 0 10px 16px rgba(59, 112, 164, 0.2);
  min-width: 124px;
  margin-top: 10px;
}

.btn-primary:hover {
  background-color: #3da0e0;
  box-shadow: 0 10px 20px rgba(59, 112, 164, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-outline {
  background: #fff;
  color: #4AAEEF;
  font-size: 14px;
  border: 1.5px solid #4AAEEF;
  border-radius: 10px;
  padding: 10px 20px;
  width: auto;
}

.btn-outline:hover {
  background: rgba(74, 174, 239, 0.05);
}

/* ======================== Status Cards ======================== */

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
}

.status-card {
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 22px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff;
  position: relative;
}

.status-card:hover {
  border-color: #4AAEEF;
  background: #fafcff;
}

.status-card.selected {
  border-color: #4AAEEF;
  background: #f0f8ff;
  box-shadow: 0 0 0 3px rgba(74, 174, 239, 0.12);
}

.status-card.selected::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4AAEEF;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
  background-size: 14px;
  background-position: center;
  background-repeat: no-repeat;
}

.status-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-icon svg {
  width: 22px;
  height: 22px;
}

.status-icon--office { background: #e8f5e9; }
.status-icon--office svg { color: #2e7d32; }
.status-icon--home { background: #e3f2fd; }
.status-icon--home svg { color: #1565c0; }
.status-icon--reserves { background: #fff3e0; }
.status-icon--reserves svg { color: #e65100; }
.status-icon--leave { background: #fce4ec; }
.status-icon--leave svg { color: #c62828; }

.status-label {
  font-size: 14px;
  font-weight: 500;
  color: #444;
}

/* ======================== Choice Buttons ======================== */

.choice-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-align: right;
}

.choice-btn:hover {
  border-color: #4AAEEF;
  background: #fafcff;
}

.choice-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #eef5fc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.choice-icon svg {
  width: 22px;
  height: 22px;
  color: #3b70a4;
}

.choice-text .title {
  font-weight: 500;
  font-size: 15px;
  color: #333;
}

.choice-text .desc {
  font-size: 13px;
  color: #888;
  margin-top: 2px;
}

/* ======================== Reports Table ======================== */

.date-picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.date-picker-row label {
  font-size: 14px;
  font-weight: 500;
  color: #555;
  white-space: nowrap;
}

.date-input {
  padding: 10px 14px;
  border: 1px solid #dde3ea;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  direction: ltr;
  outline: none;
  transition: border-color 0.15s;
}

.date-input:focus {
  border-color: #4AAEEF;
}

.reports-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.reports-table thead th {
  background: #f8fafb;
  padding: 12px 14px;
  text-align: right;
  font-weight: 500;
  color: #666;
  border-bottom: 1px solid #e2e8f0;
}

.reports-table thead th:first-child {
  border-radius: 0 8px 0 0;
}

.reports-table thead th:last-child {
  border-radius: 8px 0 0 0;
}

.reports-table tbody td {
  padding: 14px;
  border-bottom: 1px solid #f0f2f5;
  color: #444;
}

.reports-table tbody tr:last-child td {
  border-bottom: none;
}

.reports-table tbody tr:hover td {
  background: #f8fafb;
}

.reports-table .cell-ltr {
  direction: ltr;
  text-align: right;
}

.reports-table .cell-time {
  direction: ltr;
  text-align: center;
  color: #888;
  font-size: 13px;
}

/* ======================== Badges ======================== */

.badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.badge-office { background: #e8f5e9; color: #2e7d32; }
.badge-home { background: #e3f2fd; color: #1565c0; }
.badge-reserves { background: #fff3e0; color: #e65100; }
.badge-leave { background: #fce4ec; color: #c62828; }
.badge-not_reported { background: #f5f5f5; color: #999; }

.row-not-reported td {
  color: #aaa !important;
}

/* ======================== Messages ======================== */

.message {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
  margin-top: 16px;
  display: none;
}

.message.show { display: block; }
.message-success { background: #e8f5e9; color: #2e7d32; }
.message-error { background: #fce4ec; color: #c62828; }
.message-info { background: #e3f2fd; color: #1565c0; }

/* ======================== Spinner ======================== */

.spinner {
  display: none;
  text-align: center;
  padding: 16px;
}

.spinner.show { display: block; }

.spinner::after {
  content: '';
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid #e2e8f0;
  border-top-color: #4AAEEF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ======================== Misc ======================== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #4AAEEF;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 16px;
  background: none;
  border: none;
  font-family: inherit;
  font-weight: 400;
}

.back-link:hover { text-decoration: underline; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  opacity: 0.4;
}

.reports-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 2px;
}

.reports-count {
  font-size: 14px;
  font-weight: 500;
  color: #555;
}

.btn-small {
  font-size: 13px;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
}

.divider {
  height: 1px;
  background: #e2e8f0;
  margin: 20px 0;
}

.text-center { text-align: center; }
.text-link { color: #4AAEEF; cursor: pointer; }
.text-link:hover { text-decoration: underline; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ======================== Activation ======================== */

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  padding: 8px 0;
  font-size: 14px;
  color: #444;
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature-list li::before {
  content: '';
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4AAEEF;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

/* ======================== Sync Toast ======================== */

.sync-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 14px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  font-weight: 500;
  animation: toastSlideUp 0.4s ease-out;
  max-width: 90vw;
}

.sync-toast--loading {
  background: #e3f2fd;
  color: #1565c0;
}

.sync-toast--success {
  background: #e8f5e9;
  color: #2e7d32;
}

.sync-toast--error {
  background: #fce4ec;
  color: #c62828;
}

.sync-toast--hide {
  animation: toastSlideDown 0.4s ease-in forwards;
}

.sync-toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-toast-icon {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sync-toast-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(21, 101, 192, 0.25);
  border-top-color: #1565c0;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes toastSlideUp {
  from { transform: translateX(-50%) translateY(100px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes toastSlideDown {
  from { transform: translateX(-50%) translateY(0); opacity: 1; }
  to   { transform: translateX(-50%) translateY(100px); opacity: 0; }
}

/* ======================== Sync Info Line ======================== */

.sync-info {
  text-align: center;
  font-size: 12px;
  color: #999;
  margin-top: 12px;
  min-height: 18px;
}

/* ======================== Modal ======================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s ease-out;
}

.modal {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  animation: modalSlideIn 0.25s ease-out;
}

.modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 22px;
  font-weight: 700;
}

.modal-icon--warning {
  background: #fff3e0;
  color: #e65100;
}

.modal-icon--error {
  background: #fce4ec;
  color: #c62828;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.modal-text {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-btn {
  flex: 1;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.modal-btn--cancel {
  background: #f0f2f5;
  color: #555;
}

.modal-btn--cancel:hover {
  background: #e2e5e9;
}

.modal-btn--danger {
  background: #c62828;
  color: #fff;
}

.modal-btn--danger:hover {
  background: #b71c1c;
}

.modal-btn--ok {
  background: #4AAEEF;
  color: #fff;
}

.modal-btn--ok:hover {
  background: #3da0e0;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalSlideIn {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ======================== Responsive ======================== */

@media (max-width: 768px) {
  .card-wide {
    max-width: 100%;
  }

  .date-picker-row {
    flex-wrap: wrap;
  }

  .date-input {
    flex: 1;
    min-width: 140px;
  }

  .reports-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }
}

@media (max-width: 520px) {
  .card {
    padding: 24px 18px;
    border-radius: 12px;
  }

  .topbar {
    padding: 10px 16px;
  }

  .topbar-title {
    font-size: 12px;
  }

  .topbar-user {
    font-size: 11px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .status-grid {
    gap: 10px;
  }

  .status-card {
    padding: 18px 8px;
  }

  /* Reports table → card layout on mobile */
  .reports-table,
  .reports-table thead,
  .reports-table tbody,
  .reports-table th,
  .reports-table td,
  .reports-table tr {
    display: block;
  }

  .reports-table thead {
    display: none;
  }

  .reports-table tbody tr {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    align-items: center;
  }

  .reports-table tbody tr:hover td {
    background: transparent;
  }

  .reports-table tbody td {
    border-bottom: none;
    padding: 2px 0;
    font-size: 13px;
  }

  .reports-table tbody td:nth-child(1) {
    /* Employee name - full width, bold */
    width: 100%;
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 4px;
  }

  .reports-table tbody td:nth-child(2) {
    /* ID - show inline with label */
    color: #888;
  }

  .reports-table tbody td:nth-child(2)::before {
    content: "ת.ז. ";
    color: #aaa;
  }

  .reports-table tbody td:nth-child(3) {
    /* Department */
    color: #666;
  }

  .reports-table tbody td:nth-child(4) {
    /* Phone */
    direction: ltr;
    text-align: right;
    color: #888;
  }

  .reports-table tbody td:nth-child(5) {
    /* Status badge */
    margin-top: 4px;
  }

  .reports-table tbody td:nth-child(6) {
    /* Time */
    margin-right: auto;
    margin-top: 4px;
    color: #999;
    font-size: 12px;
  }

  .reports-table .cell-ltr,
  .reports-table .cell-time {
    text-align: right;
  }
}
