body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  background: #eaf3f8;
  color: #1e293b;
  -webkit-tap-highlight-color: transparent;

  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  background: #ffffff;
  padding: 14px;
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}

.container:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topBar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.user-info-block {
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#currentDate,
#employeeName {
  color: #64748b;
  font-weight: normal;
  font-size: small;
  line-height: 1.2;
}

.icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f4f8;
  border: none;
  border-radius: 50%;
  color: #4a5568;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.icon-btn:active {
  transform: scale(0.95);
  background: #e2e8f0;
}

.icon-btn .icon {
  width: 20px;
  height: 20px;
  display: block;
}

h1,
h2 {
  margin: 0 0 10px;
  text-align: center;

  color: #0f172a;

  font-weight: 700;
}

label {
  font-size: 14px;
  font-weight: 600;

  color: #475569;

  margin-top: 4px;
}

input,
select,
button {
  width: 100%;

  box-sizing: border-box;

  font-size: 16px;

  border-radius: 12px;

  border: 1px solid #dbe4ee;

  outline: none;
}

input,
select {
  padding: 10px 12px;
  background: #f8fbfd;
  color: #0f172a;
}

input:focus,
select:focus {
  border-color: #7aa7c7;
  background: #ffffff;
}

button {
  padding: 10px 14px;
  border: none;
  background: #5b8faf;
  color: white;
  font-weight: 600;
  transition: 0.15s;
}

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

button:disabled {
  background: #c7d4df;
  color: #f8fafc;
}

#statusContainer {
  background: #f7fbfe;
}

.smallBtn {
  width: auto;
  align-self: flex-end;
  margin: 0;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;

  background: #f7fbfe;
  border-radius: 8px;
  padding: 6px 12px;
  color: #64748b;
}

.smallBtn:active {
  opacity: 0.8;
}

#status {
  font-size: 15px;
  font-weight: 600;

  color: #334155;
}

#status.status-error {
  color: #ef4444;
}

.shift-card {
  border-left: 5px solid #ccc;
  background: #f9f9f9;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shift-card.status-1 {
  border-left-color: #2196F3;
}

.shift-card.status-2 {
  border-left-color: #4CAF50;
}

.shift-card-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shift-time-column {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-right: 15px;
  flex-shrink: 0;
  min-width: 85px;
}

.shift-date {
  font-weight: bold;
  color: #334155;
  font-size: 0.95em;
}

.shift-time-start,
.shift-time-end {
  font-size: 0.8em;
  color: #64748b;
  white-space: nowrap;
}

.shift-info {
  flex-grow: 1;
}

.shift-descr {
  font-size: 0.9em;
  color: #777;
  font-style: italic;
  margin-top: 4px;
}

.shift-status-badge {
  font-size: 0.85em;
  padding: 4px 8px;
  white-space: nowrap;
}

.filter-buttons {
  display: flex;
  gap: 2px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  overflow: hidden;
  margin: 10px 0;
  box-sizing: border-box;
}

.filter-btn {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 6px 2px;
  font-size: 0.75rem;
  color: #64748b;
  cursor: pointer;
  border-radius: 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  color: #0f172a;
}

.filter-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  font-weight: 500;
}

.smallBtn.active-tab {
  background-color: #007bff;
  color: white;
  font-weight: bold;
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tabs-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  border-bottom: 2px solid #dbe4ee;
  align-self: flex-start;
}

.tab-nav-btn {
  width: auto;
  background: transparent;
  color: #64748b;
  border: none;
  border-radius: 0;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: -2px;
  border-bottom: 2px solid transparent;
}

.tab-nav-btn:hover {
  color: #0f172a;
}

.tab-nav-btn.active-tab {
  color: #5b8faf;
  background: transparent;
  border-bottom: 2px solid #5b8faf;
  transform: none;
}

.tab-content[hidden] {
  display: none !important;
}

.tab-content:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
  overflow-y: auto;

  -webkit-overflow-scrolling: touch;
}

.tab-content h2,
.filter-buttons,
.tabs-nav {
  flex-shrink: 0;
}

#commonTrackerContainer:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
  margin: 5px auto;
}

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

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

.shift-edit-context {
  background-color: #f8fafc;
  border-left: 4px solid #3b82f6;
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 0 6px 6px 0;
  font-size: 14px;
  line-height: 1.5;
}

.shift-edit-meta {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 4px;
}

.shift-edit-object {
  color: #1e293b;
  font-weight: 600;
}

.shift-edit-worktype {
  color: #475569;
}

.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 500;
  font-size: 14px;
  color: #334155;
}

#shift-edit-description {
  width: 100%;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

#shift-edit-description:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.smallBtn .icon {
  width: 16px;
  height: 16px;
  display: block;
}

.btn-edit-shift {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  background: #f0f4f8;
  border: none;
  cursor: pointer;
  color: #4a5568;
  transition: background 0.2s;
}

.btn-edit-shift:hover {
  background: #e2e8f0;
}

#shiftsList {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 2px;

  -webkit-overflow-scrolling: touch;
}

#shiftsList::-webkit-scrollbar {
  width: 4px;
}

#shiftsList::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
}

#topBarContainer {
  flex-shrink: 0;
  margin: 10px auto 5px;
}

#statusContainer {
  flex-shrink: 0;
  margin: 5px auto 10px;
  background: #f7fbfe;
}

/* Menu */

.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 240px;
  height: 100%;
  background: #ffffff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.sidebar-backdrop.open {
  visibility: visible;
  opacity: 1;
}

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

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.sidebar-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  height: 100%;
}

.sidebar-link,
.sidebar-link:link,
.sidebar-link:visited,
.sidebar-link:hover,
.sidebar-link:active {
  color: inherit;
  padding: 14px 20px;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
  background: transparent;
}

#sidebar-logout,
#sidebar-logout:link,
#sidebar-logout:visited,
#sidebar-logout:hover,
#sidebar-logout:active {
  color: inherit;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
  margin-top: auto;
  background: transparent;
}

.overtime-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.overtime-row label {
  white-space: nowrap; 
  flex-shrink: 0;
}