/* Overlay */
#dashboard-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.5);
  z-index: 999;
}
.dashboard-settings-open #dashboard-overlay {
  display: block;
}
/* Gear Button */
#dashboard-gear-btn {
  position: fixed;
  top: 0rem;
  right: 0rem;
  font-size: 2rem;
  padding: 0rem;
  cursor: pointer;
  z-index: 1001;
}
.dashboard-settings {
    display: none;
}
.dashboard-settings-open .dashboard-settings {
  display: block;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 95vw;
  max-height: 95vh;
  overflow: auto;
  z-index: 1000;
  background-color: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.dashboard-settings ul {
    list-style: none;
    padding: 0;
    margin: 0;
    background: white;
    border-radius: 0.25rem;
    overflow: hidden;
}

/* List Item */
.dashboard-settings li {
    border-bottom: 1px solid #ddd;
    padding: .75rem 0rem;
    min-height: 72px;
    transition: opacity 0.2s ease;
}
.dashboard-settings li:last-child {
    border-bottom: none;
}
.name { white-space: nowrap; }

/* Grid Layout */
.tile-row {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
}
.move.up {
    grid-column: 1;
    grid-row: 1;
}
.tile-center {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.move.down {
    grid-column: 2;
    grid-row: 1;
}
.remove,
.add {
    grid-column: 4;
    grid-row: 1;
    justify-self: center;
}
.name {
    font-weight: normal;
    font-size: 1.5rem;
}
/* Buttons */
.dashboard-settings button {
    --min-width: 44px;
    --min-height: 44px;
    min-width: 40px;
    min-height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    border: 1px solid #ccc;
    background: #fafafa;
    --border-radius: 4px;
}
.dashboard-settings button:disabled {
    opacity: 0.3;
    cursor: default;
}
.remove { color: #c62828; }
.add { color: #2e7d32; }

/* Toggle Switch */
.hide-empty {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
    margin-left: 0.5rem;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    inset: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: 0.2s;
}
.slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.2s;
}
.switch input:checked + .slider {
    background-color: #4caf50;
}
.switch input:checked + .slider::before {
    transform: translateX(22px);
}

/* Disabled State */
li.disabled .tile-center {
    opacity: 0.45;
}
li.disabled .move,
li.disabled .hide-empty {
    visibility: hidden;
}
li.disabled .remove {
    display: none;
}
li:not(.disabled) .add {
    display: none;
}