/* Grid Layout */
.app-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  width: 100vw;
}

/* Sidebar Styling */
.sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 0 0 30px 0;
  justify-content: space-between;
}

.sidebar-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 25px;
}

.brand-logo-img {
  max-width: 200px;
  height: 79px;
  object-fit: contain;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.nav-item:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.25) 0%, rgba(0, 210, 255, 0.05) 100%);
  border-color: rgba(0, 210, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 210, 255, 0.1);
}

.nav-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2px;
  transition: stroke 0.3s;
}

.nav-item.active .nav-icon {
  color: var(--accent-blue);
  filter: drop-shadow(0 0 4px var(--accent-blue));
}

/* Badge for notifications */
.nav-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--status-stopped);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid var(--bg-primary);
}

/* System Status Card */
.sidebar-status-card {
  margin: 30px 16px 20px 16px;
  padding: 20px;
  background: rgba(12, 21, 39, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.status-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.status-shield-icon {
  width: 26px;
  height: 26px;
  color: var(--status-running);
  filter: drop-shadow(0 0 4px rgba(0, 230, 118, 0.3));
}

.status-card-titles {
  display: flex;
  flex-direction: column;
}

.status-card-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.status-card-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--status-running);
  letter-spacing: 0.5px;
}

.status-card-subtext {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-footer .version {
  font-weight: 500;
}

/* Main Area Layout */
.main-area {
  display: grid;
  grid-template-rows: var(--header-height) 1fr;
  height: 100vh;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  width: 100%;
}

/* Header Styling */
.header {
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: var(--header-height);
}

.header-title-area {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.header-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.header-widgets {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Time Widget styling */
.time-widget {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Week Widget styling */
.week-widget {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 8px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
}

.week-widget .week-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 0.5px;
}

.time-widget .time-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 1px;
}

.time-widget .date-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-blue);
}

/* Notify Widget styling */
.notify-widget {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s;
}

.notify-widget:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.notify-widget:hover .notify-icon {
  color: var(--accent-blue);
  filter: drop-shadow(0 0 4px var(--accent-blue));
}

.notify-icon {
  width: 22px;
  height: 22px;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.notify-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background-color: var(--status-stopped);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid var(--bg-primary);
}

/* User Profile styling */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 12px;
  transition: background-color 0.3s;
}

.user-profile:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #1a2a4e;
  border: 1px solid rgba(0, 210, 255, 0.2);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  letter-spacing: 0.5px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.user-profile:hover .user-name {
  color: var(--text-primary);
}

.user-dropdown-icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

/* Content Area Styling */
.content-container {
  padding: 30px;
  overflow-y: auto;
  background-color: var(--bg-primary);
  height: calc(100vh - var(--header-height));
}

/* Tab View Switcher classes */
.view-section {
  display: block;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Placeholder Views Styling */

/* Language Switcher Widget styling */
.lang-switcher-widget {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.lang-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-blue);
}

.lang-dropdown {
  position: absolute;
  top: 45px;
  right: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px;
  width: 140px;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lang-dropdown.hidden {
  display: none;
}

.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.2s;
}

.lang-dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--accent-blue);
}

/* Sidebar sub-menu accordion */
.nav-item-parent {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.nav-item-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.nav-item-header:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.03);
}

.nav-item-parent.active .nav-item-header {
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.15) 0%, rgba(0, 210, 255, 0.03) 100%);
  border-color: rgba(0, 210, 255, 0.2);
}

.expand-arrow {
  margin-left: auto;
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
  stroke: currentColor;
}

.nav-item-parent.expanded .expand-arrow {
  transform: rotate(90deg);
}

.sidebar-submenu {
  list-style: none;
  padding: 4px 0 4px 36px;
  margin: 0;
  display: none;
  flex-direction: column;
  gap: 4px;
}

.nav-item-parent.expanded .sidebar-submenu {
  display: flex;
}

.submenu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.submenu-item:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.02);
}

.submenu-item.active {
  color: var(--accent-blue);
  font-weight: 600;
  background-color: rgba(0, 210, 255, 0.08);
}

.submenu-item .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--text-secondary);
  transition: background-color 0.2s ease;
}

.submenu-item.active .dot {
  background-color: var(--accent-blue);
  box-shadow: 0 0 6px var(--accent-blue);
}

/* Custom Status Badges for Production Orders */
.status-badge-custom {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  min-width: 85px;
}
.status-badge-custom.status-running {
  background: rgba(0, 210, 255, 0.15);
  color: #00d2ff;
  border: 1px solid rgba(0, 210, 255, 0.3);
}
.status-badge-custom.status-pending {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
}
.status-badge-custom.status-completed {
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.3);
}
.status-badge-custom.status-stopped {
  background: rgba(255, 23, 68, 0.15);
  color: #ff1744;
  border: 1px solid rgba(255, 23, 68, 0.3);
}
.status-badge-custom.status-cancelled {
  background: rgba(158, 158, 158, 0.15);
  color: #9e9e9e;
  border: 1px solid rgba(158, 158, 158, 0.3);
}

/* Glassmorphism Login View Styles */
.login-view-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  background: radial-gradient(circle at 50% 30%, #0d1e3a 0%, #060b17 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-view-wrapper.hidden {
  display: none !important;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(13, 25, 48, 0.75);
  border: 1px solid rgba(0, 210, 255, 0.25);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 210, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 40px 32px;
  color: var(--text-primary);
}
.login-card-header {
  text-align: center;
  margin-bottom: 24px;
}
.login-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.login-brand-logo img {
  height: 38px;
  object-fit: contain;
}
.login-brand-logo span {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}
.login-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.login-form-group {
  margin-bottom: 20px;
}
.login-form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.login-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.login-input-wrapper input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: rgba(6, 11, 23, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.25s ease;
}
.login-input-wrapper input:focus {
  border-color: #00d2ff;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.3);
}
.login-input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}
.login-btn-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #00d2ff 0%, #0072ff 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.4);
  transition: all 0.2s ease;
  margin-top: 10px;
}
.login-btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 210, 255, 0.6);
}
.login-error-alert {
  background: rgba(255, 23, 68, 0.15);
  border: 1px solid rgba(255, 23, 68, 0.4);
  color: #ff5252;
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: none;
  text-align: center;
}