:root {
  --white: #ffffff;
  --black: #101828;
  --main-color: #f9fafb;

  --primary-color: #1d2939;
  --secondary-color: #667085;

  --accent-color: #29539f;
  --accent-color-dark: #112a5a;
  --accent-color-rgb: 41, 83, 159;
  --light-accent-color: #ecf3ff;

  --success-color: #12b76a;
  --error-color: #f04438;

  --border-color: #e4e7ec;

  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;

  --shadow-sm: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 25px rgb(0 0 0 / 0.15);

  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: "Roboto-300";
  src: url("../fonts/Inter_18pt-Light.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Roboto-400";
  src: url("../fonts/Inter_18pt-Regular.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Roboto-bold";
  src: url("../fonts/Inter_18pt-Bold.woff2") format("woff2");
  font-display: swap;
}

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

img {
  display: block;
  max-width: 100%;
}

ul {
  list-style: none;
}

body {
  font-family: "Roboto-300", sans-serif;
  color: var(--primary-color);
  @media (min-width: 768px) {
    display: flex;
    min-height: 100vh;
  }
}

h1 {
  @media (max-width: 768px) {
    font-size: 18px;
  }
}

h2 {
  font-family: "Roboto-bold", sans-serif;
}

h3 {
  font-family: "Roboto-400", sans-serif;
}

body#login {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 30px;
}

body#login .error {
  text-align: center;
  padding-top: 40px;
}

body#login .demo-access {
  background-color: var(--light-accent-color);
  border: 1px solid var(--accent-color);
  border-radius: var(--radius-lg);
  padding: 12px 24px;
  text-align: center;
  color: var(--accent-color-dark);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-logo-img {
  width: 200px;
  margin-inline: auto;
}

.login-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

header {
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: 20px;

  p {
    text-transform: uppercase;
    font-weight: 600;
  }
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
textarea {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
}

.input {
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 20px;
  padding-block: 5px;

  @media (min-width: 1024px) {
    flex-direction: row;
    align-items: center;
  }

  label {
    width: 100%;
    padding-bottom: 10px;

    @media (min-width: 1024px) {
      width: 40%;
      padding-bottom: 0;
    }
  }

  input:not([type="checkbox"]) {
    width: 100%;

    @media (min-width: 1024px) {
      width: 60%;
    }

    &:focus {
      outline: none;
      border-color: var(--accent-color);
      border: 1.5px solid var(--accent-color);
      box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb, 255, 0, 0), 0.3);
    }
  }

  select {
    width: 100%;
    @media (min-width: 1024px) {
      width: 60%;
    }
  }
}

.no-scroll {
  overflow: hidden;
}

button[type="submit"],
.primary-button {
  all: unset;
  padding: 12px 16px;
  cursor: pointer;
  border: 1px solid var(--accent-color);
  background-color: var(--accent-color);
  color: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease-in-out);

  &:hover {
    background-color: var(--accent-color-dark);
  }

  &.danger {
    border: 1px solid var(--error-color);
    background-color: var(--error-color);
  }
}

.box {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-2xl);

  .settings {
    flex: 1;

    h2 {
      font-size: 28px;
      margin-bottom: 20px;
    }

    h3 {
      margin-block: 10px;
      font-size: 20px;
    }

    .option {
      padding-block: 20px;

      h3 {
        margin-bottom: 10px;
      }
    }
  }

  .apply-btn {
    padding-top: 20px;
    text-align: right;
  }
}

.dashboard {
  background-color: var(--white);
  padding: 20px;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
  width: 80%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-100%);
  transition: all 0.4s var(--ease-in-out);

  @media (min-width: 1024px) {
    position: fixed;
    display: flex;
    width: 250px;
    min-height: 100vh;
    border-right: 1px solid var(--border-color);
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
  }
}

.dashboard.active {
  display: flex;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.dashboard .close {
  position: absolute;
  top: 20px;
  right: 20px;
  cursor: pointer;

  @media (min-width: 1024px) {
    display: none;
  }
}

.main-content {
  flex: 1;
  background-color: var(--main-color);
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;

  @media (min-width: 1024px) {
    padding-left: 270px;
  }
}

.content {
  flex: 1;
  overflow-y: auto;
  padding-block: 60px;
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 20px;

  @media (min-width: 1024px) {
    grid-template-columns: repeat(2, 1fr);
  }
}

.toggle-dashboard {
  all: unset;
  @media (min-width: 1024px) {
    display: none;
  }
}

.logo {
  width: 150px;
  margin-inline: auto;
}

.menu {
  flex: 1;
  padding-top: 60px;

  ul {
    li {
      a {
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px;
        border-radius: var(--radius-lg);
        margin-bottom: 20px;
        transition: all 0.3s var(--ease-in-out);

        &:hover {
          cursor: pointer;
          background-color: var(--light-accent-color);
        }

        &.active {
          background-color: var(--light-accent-color);
          color: var(--accent-color);
        }
        svg {
          width: 24px;
        }
      }
    }
  }
}

.logout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  padding: 10px;
  border-radius: var(--radius-lg);
  transition: all 0.3s var(--ease-in-out);
  background-color: #d92d20;
  color: var(--white);

  &:hover {
    cursor: pointer;
    background-color: #d92c2093;
  }

  svg {
    width: 20px;
  }
}

.status {
  ul {
    padding-top: 20px;

    li {
      margin-bottom: 20px;
      display: flex;
      justify-content: space-between;
    }
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid black;
}
th,
td {
  border: 1px solid black;
  padding: 8px;
  text-align: center;
}
th {
  background-color: #c0c0c0;
}
.priority-select {
  width: 50px;
}

.success-message {
  margin-top: 20px;
  padding: 10px;
  background-color: var(--success-color);
  color: white;
  border-radius: 5px;
  margin-bottom: 20px;
  text-align: center;
}
.error-message {
  margin-top: 20px;
  padding: 10px;
  background-color: var(--error-color);
  color: var(--white);
  border-radius: 5px;
  margin-bottom: 20px;
  text-align: center;
}

@keyframes blink {
  0% {
    background-color: var(--success-color);
    color: white;
  }
  50% {
    background-color: transparent;
    color: inherit;
  }
  100% {
    background-color: var(--success-color);
    color: white;
  }
}

.blink {
  animation: blink 0.5s ease-in-out 2;
  border-radius: 3px;
}

.timer {
  display: flex;
  align-items: center;
  gap: 20px;
}

select {
  appearance: none;
  background-color: #fff;
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' 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: right 3px center;
  background-size: 12px;
}

.content.status {
  span {
    text-align: right;
  }
}

.system .controls {
  display: flex;
  gap: 20px;

  * {
    align-content: flex-end;
  }
}

.header-controls {
  .restart {
    form {
      .restart-btn {
        all: unset;
        cursor: pointer;
        display: flex;
        svg {
          width: 20px;
        }
      }
    }
  }
}

.system-general-title {
  font-size: 28px;
  margin-bottom: 20px;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.update-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.update-modal .modal-content {
  background-color: white;
  padding: 2em 3em;
  border-radius: 8px;
  text-align: center;
  font-size: 1.2em;
  color: #333;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

.update-modal .spinner {
  border: 5px solid #eee;
  border-top: 5px solid var(--accent-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1em auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.check-for-update-form {
  margin-top: 20px;
}

.check-for-update-form .system-general-settings {
  display: flex;
  align-items: center;
}

.check-for-update-form .system-general-settings .apply-btn {
  padding-top: 0;
}

.update-now-form {
  margin-top: 20px;
}

.system-update-now {
  display: flex;
  align-items: center;
}

.system-update-now .apply-btn {
  padding-top: 0;
}
