:root {
  --o-brand: #1f4f9d;
  --o-brand-dark: #173a75;
  --o-accent: #2bb673;
  --o-sky: #1f9ed8;
  --o-border: #d8dadd;
  --o-bg: #f4f8fc;
  --o-text: #1f2933;
  --o-muted: #6b7280;
  --o-danger: #b42318;
  --o-success: #027a48;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--o-bg);
  color: var(--o-text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--o-border);
  border-radius: 4px;
  background: #fff;
  color: var(--o-text);
  cursor: pointer;
  padding: 8px 12px;
}

button:hover {
  background: #f1f5f9;
}

button.o-primary {
  border-color: var(--o-brand);
  background: var(--o-brand);
  color: #fff;
}

.is-hidden {
  display: none !important;
}

.o-login {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(31, 158, 216, 0.2), transparent 34%),
    linear-gradient(135deg, #f8fbff 0%, #edf7f3 100%);
}

.o-login__card {
  width: min(420px, 100%);
  border: 1px solid var(--o-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.16);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
}

.o-login__brand {
  color: var(--o-brand);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.o-login__logo {
  align-self: flex-start;
  height: auto;
  width: 170px;
}

.o-login h1,
.o-login p {
  margin: 0;
}

.o-login p {
  color: var(--o-muted);
  line-height: 1.45;
}

.o-appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: linear-gradient(90deg, var(--o-brand-dark), var(--o-brand));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.o-appbar__brand {
  align-items: center;
  display: flex;
  gap: 12px;
}

.o-appbar__logo {
  background: #fff;
  border-radius: 6px;
  height: 44px;
  padding: 3px;
  width: 116px;
}

.o-appbar__title {
  font-size: 20px;
  font-weight: 700;
}

.o-appbar__subtitle {
  color: rgba(255, 255, 255, 0.8);
}

.o-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.o-main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.o-main-nav button {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.o-main-nav button.active {
  background: #fff;
  color: var(--o-brand-dark);
  font-weight: 700;
}

.o-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 16px auto 48px;
}

.o-card {
  background: #fff;
  border: 1px solid var(--o-border);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  margin-bottom: 12px;
  padding: 16px;
}

.o-sync {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.o-monitor-status {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.o-monitor-status p {
  margin: 6px 0 0;
  color: var(--o-muted);
}

.o-monitor-status.is-up-to-date {
  border-left: 5px solid var(--o-accent);
}

.o-monitor-status.has-pending {
  border-left: 5px solid #f79009;
}

.o-monitor-actions {
  display: flex;
  gap: 8px;
}

.o-monitor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.o-kpi {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.o-kpi span {
  color: var(--o-muted);
  font-weight: 700;
}

.o-kpi strong {
  font-size: 28px;
}

.o-table-wrap {
  overflow-x: auto;
}

.o-monitor-table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

.o-monitor-table th,
.o-monitor-table td {
  border-bottom: 1px solid var(--o-border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.o-monitor-table th {
  background: #f8fafc;
  color: #374151;
  font-size: 12px;
  text-transform: uppercase;
}

.o-badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.o-badge--success {
  background: #ecfdf3;
  color: var(--o-success);
}

.o-badge--warning {
  background: #fffaeb;
  color: #b54708;
}

.o-badge--danger {
  background: #fef3f2;
  color: var(--o-danger);
}

.o-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.o-grid--top {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.o-grid--otros {
  align-items: end;
  grid-template-columns: minmax(180px, 0.8fr) minmax(180px, 1fr);
  max-width: 760px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #374151;
  font-weight: 600;
}

.o-check {
  align-items: center;
  flex-direction: row;
  justify-content: flex-start;
  gap: 10px;
  min-height: 36px;
  padding: 7px 0;
  white-space: nowrap;
}

.o-check input[type="checkbox"] {
  flex: 0 0 auto;
  height: 16px;
  margin: 0;
  min-height: 16px;
  padding: 0;
  width: 16px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--o-border);
  border-radius: 4px;
  background: #fff;
  min-height: 36px;
  padding: 7px 9px;
  color: var(--o-text);
}

select[multiple] {
  min-height: 138px;
}

textarea {
  min-height: 94px;
  resize: vertical;
}

input[readonly] {
  background: #f8fafc;
  color: var(--o-muted);
}

.o-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--o-border);
  margin: 12px 0 0;
}

.o-tabs button {
  border-radius: 6px 6px 0 0;
  border-bottom: 0;
  color: var(--o-brand-dark);
}

.o-tabs button.active {
  background: #fff;
  border-color: var(--o-border);
  font-weight: 700;
  position: relative;
  top: 1px;
}

.o-tab {
  border-top-left-radius: 0;
  display: none;
}

.o-tab.active {
  display: block;
}

.o-time-grid {
  display: grid;
  grid-template-columns: 210px 130px 160px;
  gap: 10px 12px;
  align-items: center;
  margin-bottom: 18px;
}

.o-label {
  color: #374151;
  font-weight: 600;
}

.o-list-toolbar,
.o-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.o-footer {
  align-items: center;
  color: var(--o-muted);
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 18px 0 28px;
}

.o-footer img {
  height: auto;
  width: 120px;
}

.o-actions {
  justify-content: flex-end;
  padding: 14px 0;
}

.o-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.o-line {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--o-border);
  border-radius: 5px;
  padding: 10px;
  background: #fbfbfc;
}

.o-line[data-line="photo"] {
  grid-template-columns: 1fr 1fr 1fr auto;
}

.is-offline {
  color: var(--o-danger);
}

.is-online {
  color: var(--o-success);
}

@media (max-width: 860px) {
  .o-appbar,
  .o-sync,
  .o-monitor-status,
  .o-monitor-actions,
  .o-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .o-main-nav,
  .o-status {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .o-main-nav button,
  .o-status button {
    width: 100%;
  }

  .o-grid,
  .o-grid--top,
  .o-grid--otros,
  .o-monitor-grid,
  .o-time-grid,
  .o-line,
  .o-line[data-line="photo"] {
    grid-template-columns: 1fr;
  }
}
