/* ─────────────────────────────────────────────
   Worktime Dashboard — Clean professional UI
   Mobil först, stabil desktop, enklare att underhålla
   ───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* === Reset & Base === */
*,
*::before,
*::after {
  box-sizing: border-box;
  min-width: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: #f0f4f8;
  color: #0f172a;
  line-height: 1.5;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.hidden {
  display: none !important;
}

/* === Layout === */
.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────
   Sidebar
   ───────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px 16px;
  background: #0f172a;
  color: #fff;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-content {
  display: none;
}

.sidebar-content.open {
  display: grid;
  gap: 10px;
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  background: #0b1120;
  padding: 12px 16px 18px;
  max-height: calc(100vh - 74px);
  overflow-y: auto;
  border-top: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.brand-logo-wrap {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-text {
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.brand p {
  display: none;
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  flex: 0 0 44px;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.hamburger-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* === Sidebar cards === */
.card {
  width: 100%;
  overflow-x: hidden;
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.06);
}

.card h2 {
  margin: 0 0 10px;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card label {
  color: #94a3b8;
}

.card input,
.card select,
.card textarea {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

.card input::placeholder,
.card textarea::placeholder {
  color: #475569;
}

#loggedInBox {
  display: grid;
  gap: 10px;
}

#loggedInUserInfo {
  background: #1e3a8a;
  border: 1px solid #1d4ed8;
  color: #bfdbfe;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
}

#loginBox.hidden,
#loggedInBox.hidden {
  display: none !important;
}

/* === Menu === */
.menu {
  display: grid;
  gap: 4px;
  width: 100%;
}

.menu button {
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  color: #94a3b8;
  text-align: left;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.menu button:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.menu button.active {
  background: #2563eb;
  color: #fff;
  font-weight: 600;
}

.menu button.active:hover {
  background: #1d4ed8;
  color: #fff;
}

/* ─────────────────────────────────────────────
   Main content
   ───────────────────────────────────────────── */
.content {
  flex: 1;
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 14px;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 2px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.topbar h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.4px;
}

.topbar p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.status {
  align-self: flex-start;
  white-space: nowrap;
  background: #dbeafe;
  color: #1d4ed8;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.03em;
}

.message {
  padding: 12px 16px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 14px;
  font-weight: 500;
  word-break: break-word;
}

/* === Panels === */
.panel {
  width: 100%;
  overflow-x: hidden;
  background: #fff;
  border-radius: 18px;
  padding: 16px;
  border: 1px solid #e8edf3;
  box-shadow: 0 1px 3px rgba(15,23,42,0.06), 0 4px 14px rgba(15,23,42,0.05);
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.2px;
}

.panel h3::before {
  content: '';
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  flex-shrink: 0;
  background: #0d9488;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M13 7h8m0 0v8m0-8l-8 8-4-4-6 6'/%3E%3C/svg%3E");
  background-size: 16px;
  background-repeat: no-repeat;
  background-position: center;
}

#tab-times h3::before {
  background-color: #2563eb;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath stroke-linecap='round' d='M12 6v6l4 2'/%3E%3C/svg%3E");
}

#tab-worklogs h3::before {
  background-color: #7c3aed;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' d='M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2'/%3E%3C/svg%3E");
}

#tab-reports h3::before {
  background-color: #ea580c;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' d='M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'/%3E%3C/svg%3E");
}

#tab-admin h3::before {
  background-color: #475569;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' d='M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.panel-inner {
  width: 100%;
  overflow-x: hidden;
  background: #f8fafc;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid #e8edf3;
}

.panel-inner h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  letter-spacing: -0.1px;
}

/* === Welcome === */
#welcomePanel {
  text-align: center;
  padding: 40px 20px;
}

#welcomePanel h3 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
}

#welcomePanel h3::before {
  display: none;
}

#welcomePanel p {
  margin: 6px 0;
  color: #64748b;
  font-size: 15px;
}

/* === Stats === */
.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  margin-bottom: 2px;
}

.stat {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8edf3;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}

.stat:hover {
  box-shadow: 0 4px 12px rgba(15,23,42,0.08);
  transform: translateY(-1px);
}

.stat:nth-child(1) { --stat-bg: #dbeafe; }
.stat:nth-child(2) { --stat-bg: #ccfbf1; }
.stat:nth-child(3) { --stat-bg: #dcfce7; }
.stat:nth-child(4) { --stat-bg: #fef9c3; }

.stat::before {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--stat-bg, #dbeafe);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%232563eb' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath stroke-linecap='round' d='M12 6v6l4 2'/%3E%3C/svg%3E");
  background-size: 19px;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.stat:nth-child(2)::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230d9488' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.stat:nth-child(3)::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2316a34a' stroke-width='2'%3E%3Cpath stroke-linecap='round' d='M13 7h8m0 0v8m0-8l-8 8-4-4-6 6'/%3E%3C/svg%3E");
}

.stat:nth-child(4)::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ca8a04' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath stroke-linecap='round' d='M12 6v6l4 2'/%3E%3C/svg%3E");
}

.stat span {
  display: block;
  margin-bottom: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat strong {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  letter-spacing: -0.6px;
}

/* === Grid === */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  width: 100%;
}

/* === Small text / content === */
.smalltext {
  font-size: 13px;
  line-height: 1.6;
  color: #64748b;
  word-break: break-word;
}

#userBox,
#meReadable,
#myEmployeeReadable,
#workLogsList {
  white-space: normal;
  word-break: break-word;
  line-height: 1.6;
  font-size: 13px;
  max-width: 100%;
}

/* === Forms === */
form {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

label {
  font-weight: 600;
  font-size: 13px;
  color: #374151;
}

input,
select,
textarea,
button {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

input,
select,
textarea {
  font: inherit;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

/* === Buttons === */
button {
  min-height: 44px;
  padding: 12px 20px;
  border: 0;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}

button:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37,99,235,0.22);
}

button:active {
  transform: scale(0.97);
}

button.secondary {
  background: #475569;
}

button.secondary:hover {
  background: #334155;
  box-shadow: none;
}

button.danger {
  background: #dc2626;
}

button.danger:hover {
  background: #b91c1c;
  box-shadow: none;
}

form button {
  width: 100%;
}

/* === Tables === */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid #e8edf3;
}

table {
  width: max-content;
  min-width: 720px;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}

th,
td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  white-space: nowrap;
  font-weight: 700;
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

td {
  vertical-align: middle;
  word-break: normal;
  overflow-wrap: break-word;
}

tr:last-child td {
  border-bottom: none;
}

.table-wrap table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.table-wrap table tbody tr:hover {
  background: #eef6ff;
  filter: brightness(0.985);
}

td:last-child {
  min-width: 260px;
}

/* === Employee actions === */
.employee-email-btn,
.employee-delete-btn,
.employee-purge-btn {
  width: auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 6px 6px 0;
  padding: 7px 10px;
  font-size: 12px;
  white-space: nowrap;
}

/* === Shift table improvements === */
.shift-edit-btn {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
}

.shift-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.shift-actions .secondary,
.shift-actions .danger {
  width: auto;
  min-width: auto;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.1;
  border-radius: 10px;
}

.shift-row-planned {
  background: #f8fbff;
}

.shift-row-confirmed {
  background: #f0fdf4;
}

.shift-row-declined {
  background: #fef2f2;
}

/* === Reports / admin action buttons === */
#reportsActionPanel,
#adminTimeEntriesPanel {
  margin-top: 8px;
}

#reportsActionPanel .smalltext,
#adminTimeEntriesPanel .smalltext {
  margin-bottom: 10px;
}

#reportsTableBody td:last-child,
#adminTimeEntriesTableBody td:last-child {
  min-width: 220px;
  vertical-align: middle;
}

#reportsTableBody td:last-child {
  white-space: normal;
}

#reportsTableBody button,
#adminTimeEntriesTableBody button {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 8px;
  margin: 0;
}

#reportsTableBody td:last-child > button,
#adminTimeEntriesTableBody td:last-child > button {
  margin-bottom: 6px;
}

#reportsTableBody td:last-child > button:last-child,
#adminTimeEntriesTableBody td:last-child > button:last-child {
  margin-bottom: 0;
}

/* === Settings layout === */
#tab-settings .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

#tab-settings .panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 18px;
}

#tab-settings form {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
}

#tab-settings .panel-inner h4 {
  margin-bottom: 14px;
}

#tab-settings label {
  margin-top: 10px;
  margin-bottom: 6px;
  font-weight: 600;
}

#tab-settings input,
#tab-settings select,
#tab-settings textarea {
  width: 100%;
  box-sizing: border-box;
}

#tab-settings form button[type="submit"] {
  margin-top: auto;
  margin-bottom: 0;
}

#tab-settings #companySettingsPanel.hidden,
#tab-settings #companySettingsPanel[style*="display: none"] {
  display: none !important;
}

#tab-settings .grid:has(#companySettingsPanel.hidden) {
  grid-template-columns: 1fr;
}

#tab-settings .grid:has(#companySettingsPanel.hidden) .panel-inner:first-child {
  max-width: 760px;
  margin: 0 auto;
}

/* === Admin forms === */
@media (min-width: 1024px) {
  #tab-admin .grid {
    align-items: stretch;
  }

  #tab-admin .grid > .panel-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  #tab-admin .grid > .panel-inner form {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  #tab-admin .grid > .panel-inner form button[type="submit"] {
    margin-top: auto;
  }
}

/* === Check-out spacing fix === */
#checkOutForm::before {
  content: "";
  display: block;
  height: 48px;
  margin-bottom: 6px;
}

/* ─────────────────────────────────────────────
   Calendar
   ───────────────────────────────────────────── */
.calendar-toolbar {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.calendar-title {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.calendar-head {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  padding: 6px 4px 10px;
}

.calendar-cell {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.calendar-cell-empty {
  background: transparent;
  border: none;
}

.calendar-cell.weekend {
  background: #f9fbff;
}

.calendar-cell.today {
  border: 2px solid #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.calendar-date {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.calendar-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calendar-event {
  padding: 7px 8px;
  background: #fff;
  border: 1px solid #dbeafe;
  border-left: 4px solid #2563eb;
  border-radius: 10px;
}

.calendar-event-title {
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.calendar-event-meta {
  font-size: 11px;
  color: #64748b;
  line-height: 1.3;
}

.calendar-event-note {
  margin-top: 2px;
  font-size: 11px;
  color: #475569;
  line-height: 1.3;
}

.calendar-empty-day {
  font-size: 11px;
  color: #cbd5e1;
}

/* === Misc === */
#tab-my-shifts .table-wrap {
  overflow-x: auto;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px;
  border-radius: 12px;
  font-size: 12px;
  max-width: 100%;
  border: 1px solid rgba(255,255,255,0.06);
}

/* ─────────────────────────────────────────────
   Breakpoints
   ───────────────────────────────────────────── */
@media (min-width: 480px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 16px;
    gap: 12px;
    display: grid;
    align-content: start;
  }

  .hamburger-btn {
    display: none;
  }

  .sidebar-toggle {
    display: block;
  }

  .sidebar-content,
  .sidebar-content.open {
    display: grid;
    gap: 10px;
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: transparent;
    border-top: 0;
    box-shadow: none;
  }

  .brand {
    display: block;
  }

  .brand h1 {
    font-size: 21px;
    margin-bottom: 2px;
  }

  .brand p {
    display: block;
  }

  .content {
    padding: 16px 18px;
    gap: 16px;
  }

  .topbar {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
  }

  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .panel {
    padding: 14px;
    border-radius: 16px;
  }

  .panel-inner {
    padding: 12px;
  }

  .panel h3 {
    font-size: 15px;
    margin-bottom: 12px;
  }

  .panel h3::before {
    width: 24px;
    height: 24px;
    background-size: 15px;
  }

  .stat {
    padding: 12px;
    border-radius: 13px;
    gap: 8px;
  }

  .stat::before {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background-size: 16px;
  }

  .stat span {
    font-size: 10px;
  }

  .stat strong {
    font-size: 18px;
    letter-spacing: -0.4px;
  }

  button {
    width: auto;
    min-width: 110px;
  }

  form button {
    width: 100%;
  }

  .employee-email-btn,
  .employee-delete-btn,
  .employee-purge-btn {
    width: auto;
    display: inline-flex;
    margin-right: 6px;
    margin-bottom: 4px;
  }

  table {
    min-width: 760px;
    font-size: 13px;
  }

  th,
  td {
    padding: 10px 12px;
  }

  #welcomePanel {
    padding: 32px 20px;
  }

  #welcomePanel h3 {
    font-size: 22px;
  }
}

@media (min-width: 900px) {
  #generateSpecificReportForm {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 10px;
  }

  #generateSpecificReportForm label[for="reportEmployeeId"],
  #generateSpecificReportForm select#reportEmployeeId,
  #generateSpecificReportForm button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  #tab-settings .grid,
  #tab-settings .grid:has(#companySettingsPanel.hidden) {
    grid-template-columns: 1fr;
  }

  #tab-settings .grid:has(#companySettingsPanel.hidden) .panel-inner:first-child {
    max-width: 100%;
  }
}

@media (min-width: 1024px) {
  .layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .sidebar {
    padding: 18px;
    gap: 12px;
  }

  .content {
    padding: 18px 20px;
    gap: 16px;
  }

  .topbar h2 {
    font-size: 25px;
  }

  .brand h1 {
    font-size: 22px;
  }

  .panel {
    padding: 14px;
  }

  .panel-inner {
    padding: 12px;
  }

  .stat strong {
    font-size: 17px;
  }

  .smalltext {
    font-size: 12px;
  }

  #reportsTableBody td:last-child {
    min-width: 340px;
  }

  #reportsTableBody td:last-child,
  #adminTimeEntriesTableBody td:last-child {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  #reportsTableBody td:last-child > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 76px;
    margin-right: 6px;
    margin-bottom: 6px;
  }

  #adminTimeEntriesTableBody td:last-child > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 92px;
    margin-right: 6px;
    margin-bottom: 6px;
  }
}

@media (min-width: 1280px) {
  .layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .content {
    padding: 18px 22px;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  .panel {
    padding: 14px;
  }

  .panel-inner {
    padding: 12px;
  }

  .stat strong {
    font-size: 16px;
  }
}

@media (min-width: 1440px) {
  .layout {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .content {
    padding: 20px 24px;
  }

  .topbar h2 {
    font-size: 26px;
  }

  .panel {
    padding: 15px;
  }

  .panel-inner {
    padding: 13px;
  }

  #reportsTableBody td:last-child {
    min-width: 380px;
  }

  #adminTimeEntriesTableBody td:last-child {
    min-width: 260px;
  }
}

@media (max-width: 1200px) {
  .calendar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .calendar-toolbar {
    grid-template-columns: 1fr;
  }

  .calendar-title {
    order: -1;
    font-size: 22px;
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .calendar-grid {
    grid-template-columns: 1fr;
  }
}
