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

html, body {
  height: 100%;
}

body {
  font-family: 'Courier New', Courier, monospace;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  background-color: #000000;
  height: 100vh;
  height: 100dvh;
  color: white;
  text-transform: lowercase;
}

a {
  color: white;
  text-decoration: underline;
  font-weight: bold;
  transition: all 0.2s ease-in-out;
  border-radius: 6px;
  padding: 2px 6px;
}

a:hover {
  background-color: white;
  color: black;
}

a.botao {
  background-color: white;
  color: black;
  text-decoration: none;
  font-weight: bold;
  border-radius: 6px;
  padding: 2px 6px;
}

a.botao:hover {
  background-color: #222222;
  color: #cccccc;
  text-decoration: none;
  font-weight: bold;
  border-radius: 6px;
  padding: 2px 6px;
}   

a.botaotit {
  background-color: #222222;
  color: #cccccc;
  text-decoration: none;
  font-weight: bold;
  border-radius: 6px;
  padding: 2px 6px;
}

a.botaotit:hover {
  background-color: white;
  color: black;
  text-decoration: none;
  font-weight: bold;
  border-radius: 6px;
  padding: 2px 6px;
}   

.sidebar {
  grid-row: 1 / 3;
  background-color: #222222;
  width: 90px;
  transition: width 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  flex-shrink: 0;
}

.sidebar.expanded {
  width: 240px;
}

.menu-header {
  padding: 20px;
  font-weight: bold;
  font-size: 14px;
  text-align: left;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar:not(.expanded) .menu-header span {
  display: none;
}

.toggle-btn {
  margin-left: auto;
  cursor: pointer;
  font-size: 20px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 10px;
}

.menu-item {
  display: flex;
  font-size: 12px;
  justify-content: center;
  align-items: center;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.menu-item span {
  margin-left: 15px;
}

.sidebar.expanded .menu-item {
  justify-content: flex-start;
}

.menu-item:hover,
.menu-item.active {
  background-color: #444;
}

.menu-item i {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

.sidebar:not(.expanded) .menu-item span {
  display: none;
}

.footer {
  text-decoration: none;
  font-weight: normal;
  font-size: 11px;
  padding: 15px;
  white-space: nowrap;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 40px;
}

.footer:focus-visible { outline-offset: -3px; }
.footer .cursor { background-color: currentColor; }

.sidebar:not(.expanded) .footer {
  justify-content: center;
}

.sidebar:not(.expanded) .footer span.text-full {
  display: none;
}

.sidebar.expanded .footer span.text-short {
  display: none;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background-color: white;
  animation: blink 1s steps(1) infinite;
  vertical-align: middle;
  margin-left: 4px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.content {
  grid-area: 1 / 2;
  padding: 30px;
  overflow-y: auto;
}

.app-actions {
  grid-area: 2 / 2;
  display: flex;
  align-items: center;
  padding: 0 24px max(4px, env(safe-area-inset-bottom));
  background: #000;
}

#petar { text-transform: none; }
#petar p { margin-block: 1em; }

.section[hidden] {
  display: none;
}


.sidebar {
  overflow-y: auto;
}

.toggle-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  padding: 4px;
}

.menu-item {
  text-decoration: none;
  font-weight: normal;
}

.menu-item:hover {
  color: white;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.content {
  min-width: 0;
  overflow-wrap: break-word;
}

@media (max-width: 768px) {
  body { grid-template-columns: 56px minmax(0, 1fr); }
  .app-actions { padding-inline: 10px; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 56px;
    z-index: 2;
  }

  .sidebar.expanded {
    width: min(240px, 90vw);
  }

  .menu-header {
    padding: 8px;
    min-height: 48px;
  }

  .sidebar:not(.expanded) .menu-header > i {
    display: none;
  }

  .toggle-btn {
    min-width: 40px;
    min-height: 40px;
  }

  .menu {
    padding: 8px 4px;
    gap: 4px;
  }

  .menu-item {
    min-height: 44px;
  }

  .footer {
    padding: 4px;
    flex-shrink: 0;
  }

  .content {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, a {
    transition: none;
  }

  .cursor {
    animation: none;
  }
}
