:host {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: #333;
}

.rdr-container {
  padding: 16px;
  max-width: 1100px;
}

.page-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
  color: #1a1a2e;
}

.filter-bar {
  margin-bottom: 16px;
}

fieldset {
  border: 1px solid #dde2ea;
  border-radius: 6px;
  padding: 12px 16px;
  margin: 0 0 16px;

  legend {
    font-size: 11px;
    font-weight: 600;
    color: #5a6070;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 6px;
  }
}

.fs-inline {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.fs-add .add-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;

  label {
    font-size: 11px;
    font-weight: 500;
    color: #5a6070;
    white-space: nowrap;
  }
}

.cell-input, .cell-select {
  height: 30px;
  border: 1px solid #cdd5e0;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12px;
  color: #333;
  background: #fff;
  outline: none;

  &:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12);
  }
}

.cell-input.narrow { width: 70px; }
.cell-input.wide   { width: 180px; }
.cell-select       { width: 130px; }

.btn {
  height: 32px;
  padding: 0 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s;

  &.btn-primary {
    background: #1a73e8;
    color: #fff;

    &:hover { background: #1558c0; }
    &:disabled { background: #b0bec5; cursor: not-allowed; }
  }
}

.status-msg {
  margin: 8px 0;
  font-size: 12px;
  color: #1a73e8;

  &.muted { color: #888; }
}

/* Table */
.table-scroll {
  overflow-x: auto;
  margin-bottom: 16px;
}

.grid-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;

  th {
    background: #f5f7fa;
    padding: 8px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #5a6070;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #dde2ea;
    white-space: nowrap;
  }

  td {
    padding: 5px 6px;
    border-bottom: 1px solid #eef0f4;
    vertical-align: middle;
  }

  tr.row-dirty td { background: #fffde7; }
  tr.row-saved td { background: #f1f8e9; }

  tr:hover td {
    background: #f0f4ff;
  }

  tr.row-dirty:hover td { background: #fff8d6; }
  tr.row-saved:hover td { background: #eaf5e0; }
}

.col-action {
  width: 70px;
  text-align: center;
  white-space: nowrap;
}

.btn-icon {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;

  &:disabled { opacity: 0.4; cursor: not-allowed; }
}

.save-btn {
  background: #e8f0fe;
  color: #1a73e8;
  &:hover:not(:disabled) { background: #d2e3fc; }
}

.del-btn {
  background: #fce8e6;
  color: #c62828;
  margin-left: 4px;
  &:hover { background: #f5c6c2; }
}
