/* =========================================================
   RESET
========================================================= */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #050505;
  color: #f5f5f5;
  font-family:
    Georgia,
    "Times New Roman",
    serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  height: 100vh;

  display: flex;
  flex-direction: column;

  background: #050505;
  border-right: 1px solid #202020;

  z-index: 100;
}

.sidebar-brand {
  padding: 30px 24px 34px;
  border-bottom: 1px solid #202020;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.brand-subtitle {
  margin-top: 7px;

  color: #777;
  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;

  padding: 18px 0;

  overflow-y: auto;
}

.nav-item {
  position: relative;

  display: flex;
  align-items: center;

  min-height: 45px;
  padding: 0 24px;

  color: #858585;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 13px;

  transition:
    color 160ms ease,
    background 160ms ease;
}

.nav-item:hover {
  color: #fff;
  background: #0b0b0b;
}

.nav-item.active {
  color: #fff;
  background: #090909;
}

.nav-item.active::before {
  content: "";

  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;

  width: 2px;
  background: #fff;
}

.sidebar-bottom {
  margin-top: auto;
  padding: 18px 24px 24px;

  border-top: 1px solid #202020;
}

.signout-button {
  width: 100%;
  padding: 11px 0;

  border: 0;
  border-top: 1px solid #303030;
  border-bottom: 1px solid #303030;

  background: transparent;
  color: #888;

  text-align: left;

  cursor: pointer;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 12px;
}

.signout-button:hover {
  color: #fff;
}


/* =========================================================
   MOBILE HEADER
========================================================= */

.mobile-header {
  display: none;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  height: 62px;

  align-items: center;

  padding: 0 17px;

  background: #050505;
  border-bottom: 1px solid #202020;

  z-index: 90;
}

.menu-button {
  width: 32px;
  height: 32px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;

  padding: 0;
  border: 0;

  background: transparent;

  cursor: pointer;
}

.menu-button span {
  display: block;

  width: 18px;
  height: 1px;

  background: #fff;
}

.mobile-brand {
  margin-left: 14px;

  display: flex;
  flex-direction: column;
}

.mobile-brand strong {
  font-size: 14px;
  letter-spacing: 0.14em;
}

.mobile-brand span {
  margin-top: 3px;

  color: #777;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 7px;
  letter-spacing: 0.17em;
}


/* =========================================================
   OVERLAY
========================================================= */

.sidebar-overlay {
  display: none;

  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.68);

  z-index: 95;
}

.sidebar-overlay.visible {
  display: block;
}


/* =========================================================
   MAIN
========================================================= */

.main-content {
  min-height: 100vh;
  margin-left: 230px;

  padding: 54px 54px 80px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;

  padding-bottom: 35px;

  border-bottom: 1px solid #222;
}

.breadcrumb {
  margin-bottom: 17px;

  color: #686868;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 11px;
  letter-spacing: 0.03em;
}

.page-header h1 {
  margin: 0;

  font-size: clamp(34px, 4vw, 52px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1;
}

.page-header p {
  max-width: 560px;

  margin: 15px 0 0;

  color: #858585;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 13px;
  line-height: 1.7;
}

.create-button {
  flex-shrink: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 43px;
  padding: 0 18px;

  border: 1px solid #fff;

  background: #fff;
  color: #050505;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 12px;
  font-weight: 600;

  transition:
    background 160ms ease,
    color 160ms ease;
}

.create-button:hover {
  background: #050505;
  color: #fff;
}


/* =========================================================
   TOOLBAR
========================================================= */

.toolbar {
  display: flex;
  gap: 10px;

  padding: 22px 0;

  border-bottom: 1px solid #1c1c1c;
}

.search-wrapper {
  flex: 1;
}

.search-wrapper input,
.toolbar select {
  width: 100%;
  height: 42px;

  border: 1px solid #292929;
  border-radius: 0;

  outline: none;

  background: #080808;
  color: #eee;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 12px;
}

.search-wrapper input {
  padding: 0 13px;
}

.toolbar select {
  width: 170px;
  padding: 0 10px;
}

.search-wrapper input::placeholder {
  color: #555;
}

.search-wrapper input:focus,
.toolbar select:focus {
  border-color: #666;
}


/* =========================================================
   MESSAGE
========================================================= */

.page-message {
  min-height: 0;

  color: #8d8d8d;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 12px;
}

.page-message:not(:empty) {
  padding: 14px 0;
}


/* =========================================================
   DIRECTORY
========================================================= */

.automation-section {
  padding-top: 28px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;

  padding-bottom: 17px;

  border-bottom: 1px solid #222;
}

.section-label {
  display: block;

  margin-bottom: 8px;

  color: #555;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 0;

  font-size: 24px;
  font-weight: 400;
}

.automation-count {
  color: #666;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 11px;
}


/* =========================================================
   AUTOMATION ROW
========================================================= */

.automation-list {
  width: 100%;
}

.automation-row {
  display: grid;

  grid-template-columns:
    minmax(240px, 1.6fr)
    minmax(130px, 0.7fr)
    minmax(110px, 0.5fr)
    auto;

  align-items: center;

  min-height: 88px;

  border-bottom: 1px solid #1c1c1c;

  transition:
    background 160ms ease;
}

.automation-row:hover {
  background: #090909;
}

.automation-main {
  min-width: 0;

  padding: 17px 18px 17px 0;
}

.automation-name {
  margin: 0;

  color: #f4f4f4;

  font-size: 17px;
  font-weight: 400;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automation-description {
  max-width: 600px;

  margin-top: 7px;

  color: #6f6f6f;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 11px;
  line-height: 1.5;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automation-trigger,
.automation-delivery {
  padding: 17px;

  color: #888;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 11px;
}

.row-label {
  display: block;

  margin-bottom: 6px;

  color: #4f4f4f;

  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.trigger-value {
  color: #b5b5b5;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-value {
  color: #b5b5b5;
}

.automation-status {
  display: flex;
  align-items: center;

  padding: 17px;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  color: #9a9a9a;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 10px;
}

.status-indicator::before {
  content: "";

  width: 5px;
  height: 5px;

  border-radius: 50%;

  background: #777;
}

.status-indicator.active {
  color: #ddd;
}

.status-indicator.active::before {
  background: #fff;
}

.automation-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;

  padding: 17px 0 17px 17px;
}

.action-button {
  min-height: 32px;
  padding: 0 10px;

  border: 1px solid #2b2b2b;

  background: transparent;
  color: #8a8a8a;

  cursor: pointer;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 10px;

  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.action-button:hover {
  border-color: #666;
  color: #fff;
}

.action-button.delete:hover {
  border-color: #777;
  color: #fff;
}


/* =========================================================
   EMPTY / LOADING
========================================================= */

.empty-state,
.loading-state {
  padding: 70px 20px;

  border-bottom: 1px solid #1c1c1c;

  text-align: center;
}

.empty-state h3 {
  margin: 0;

  font-size: 21px;
  font-weight: 400;
}

.empty-state p {
  margin: 10px 0 22px;

  color: #686868;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 12px;
}

.empty-link {
  display: inline-block;

  padding-bottom: 4px;

  border-bottom: 1px solid #666;

  color: #bbb;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 11px;
}

.empty-link:hover {
  color: #fff;
  border-color: #fff;
}

.loading-state {
  color: #666;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 11px;
}


/* =========================================================
   DELETE MODAL
========================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 20px;

  background: rgba(0, 0, 0, 0.78);

  z-index: 300;
}

.modal-backdrop.open {
  display: flex;
}

.delete-modal {
  width: min(440px, 100%);

  padding: 30px;

  border: 1px solid #303030;

  background: #080808;
}

.modal-label {
  margin-bottom: 12px;

  color: #666;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.delete-modal h2 {
  margin: 0;

  font-size: 24px;
  font-weight: 400;
}

.delete-modal p {
  margin: 12px 0 26px;

  color: #777;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-actions button {
  min-height: 38px;
  padding: 0 15px;

  cursor: pointer;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  font-size: 11px;
}

.modal-cancel {
  border: 1px solid #303030;

  background: transparent;
  color: #999;
}

.modal-delete {
  border: 1px solid #fff;

  background: #fff;
  color: #000;
}

.modal-cancel:hover {
  border-color: #666;
  color: #fff;
}

.modal-delete:hover {
  background: #ddd;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1050px) {

  .main-content {
    padding: 42px 35px 70px;
  }

  .automation-row {
    grid-template-columns:
      minmax(210px, 1.5fr)
      minmax(110px, 0.7fr)
      minmax(90px, 0.5fr)
      auto;
  }

  .automation-trigger {
    padding-left: 10px;
    padding-right: 10px;
  }

  .automation-delivery {
    padding-left: 10px;
    padding-right: 10px;
  }

}


@media (max-width: 800px) {

  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
    z-index: 110;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-header {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding: 96px 22px 60px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 24px;
  }

  .create-button {
    width: 100%;
  }

  .toolbar {
    flex-direction: column;
  }

  .toolbar select {
    width: 100%;
  }

  .automation-row {
    display: block;

    padding: 17px 0;
  }

  .automation-main {
    padding: 0 0 15px;
  }

  .automation-trigger,
  .automation-delivery,
  .automation-status {
    display: inline-flex;

    padding: 5px 14px 5px 0;
  }

  .automation-actions {
    justify-content: flex-start;

    padding: 15px 0 0;
  }

}


@media (max-width: 480px) {

  .main-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-header h1 {
    font-size: 36px;
  }

  .section-heading h2 {
    font-size: 21px;
  }

  .automation-description {
    white-space: normal;
  }

  .action-button {
    flex: 1;
  }

  .automation-actions {
    width: 100%;
  }

}