/* WorkersPanel Layout — dark/orange */
.app-container{
  display:flex;
  min-height:100vh;
  background:var(--bg-main);
}
.sidebar{
  width:270px;
  flex:0 0 270px;
  background:var(--bg-panel);
  border-right:1px solid var(--border);
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:14px;
  position:fixed;
  height:100vh;
  overflow:hidden;
}
.sidebar-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-direction:column;
  padding-bottom:12px;
  border-bottom:1px solid var(--border);
}
.sidebar-logo-link{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color:var(--text-main);
  width:100%;
  padding:8px;
  border-radius:10px;
  transition:all 0.2s ease;
}
.sidebar-logo-link:hover{
  background:var(--bg-hover);
}
.sidebar-logo{
  display:flex;
  align-items:center;
  justify-content:center;
  width:80px;
  height:80px;
  flex-shrink:0;
}
.sidebar-logo-img{
  width:80px;
  height:80px;
  border-radius:12px;
  object-fit:contain;
  background:#0f0f0f;
  border:2px solid var(--accent);
  padding:8px;
}
.logo-icon{
  width:80px;
  height:80px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#0f0f0f;
  border:2px solid var(--accent);
  font-weight:800;
  font-size:2rem;
  color:var(--accent);
}
.sidebar-company-info{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  text-align:center;
}
.logo-text{
  font-weight:800;
  letter-spacing:.3px;
  color:var(--accent);
  font-size:1.1rem;
}
.sidebar .logo-text{display:none;}
.sidebar-toggle{
  display:none !important;
  background:transparent;
  border:1px solid var(--border);
  color:var(--text-main);
  border-radius:10px;
  padding:8px 10px;
  cursor:pointer;
}
.sidebar-body{
  display:flex;
  flex-direction:column;
  gap:14px;
  overflow:hidden;
  flex:1;
}
.sidebar-nav{
  flex:1;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:6px;
}
.sidebar-nav::-webkit-scrollbar{width:8px}
.sidebar-nav::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.10);border-radius:999px}
.sidebar-nav::-webkit-scrollbar-track{background:transparent}
.nav-section{margin-top:4px}
.nav-section-title{
  font-size:.78rem;
  letter-spacing:.08em;
  color:var(--text-muted);
  text-transform:uppercase;
  margin:12px 8px 8px;
}
.nav-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  margin:6px 0;
  border-radius:10px;
  color:var(--text-main);
  text-decoration:none;
  border:1px solid transparent;
  font-weight:650;
  font-size:.95rem;
  position:relative;
}
.nav-item .icon{width:22px;text-align:center;opacity:.95}
.nav-item:hover{background:var(--bg-hover)}
.nav-item.active{
  background:var(--accent-soft);
  border-color:rgba(255,140,26,0.35);
}
.nav-item.active::before{
  content:"";
  position:absolute;
  left:-1px;
  top:8px;
  bottom:8px;
  width:4px;
  border-radius:999px;
  background:var(--accent);
}
.sidebar-footer{
  padding-top:12px;
  border-top:1px solid var(--border);
  flex-shrink:0;
}
.btn-block{width:100%}

.main-area{flex:1;display:flex;flex-direction:column;min-width:0;margin-left:270px}

.main-content{
  flex:1;
  padding:22px 24px;
  min-width:0;
  width:100%;
  max-width:1400px;
  margin:0 auto;
}
/* Page Header - Company Name + Page Title */
.page-header-simple {
  background: var(--bg-panel);
  border-bottom: 2px solid var(--border);
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo{
  width:34px;
  height:34px;
  border-radius:10px;
  object-fit:contain;
  background:#0f0f0f;
  border:2px solid var(--accent);
  padding:4px;
  flex-shrink:0;
}

.company-name {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: 0.3px;
}

.page-separator {
  color: var(--text-muted);
  font-weight: 300;
  font-size: 1.1rem;
}

.page-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
  letter-spacing: 0.2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile menu toggle - HIDDEN on desktop, shows on mobile only */
.mobile-menu-toggle {
  display: none !important;  /* Hidden on desktop */
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

.user-menu-only {
  display: flex;
  align-items: center;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.2s ease;
}

.user-menu:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.user-menu:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-color: var(--accent);
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

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

.user-role {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 140, 26, 0.2), rgba(255, 111, 0, 0.2));
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 900;
  font-size: 1rem;
}

/* Header Navigation Tabs */
.header-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  background: var(--bg-main);
  overflow-x: auto;
}

.header-nav-item {
  display: inline-block;
  padding: 12px 20px;
  text-decoration: none;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  font-weight: 500;
}

.header-nav-item:hover {
  color: var(--text-main);
  border-bottom-color: var(--accent-soft);
}

.header-nav-item.active {
  color: var(--text-main);
  border-bottom-color: var(--accent);
}

@media (max-width: 900px){
  /* Utility: hide desktop-only elements on mobile */
  .desktop-only{display:none !important;}

  .app-container{flex-direction:column}
  .sidebar{
    width:100%;
    flex:0 0 auto;
    border-right:none;
    border-bottom:1px solid var(--border);
    height:auto;
    padding:12px;
    position:fixed;
    top:0;
    left:-100%;  /* Hidden by default */
    z-index:1000;
    transition: left 0.3s ease;
    background: var(--bg-panel);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
  }
  
  /* Show sidebar when open */
  .sidebar.open {
    left: 0;
  }
  
  /* Show mobile menu toggle on mobile */
  .mobile-menu-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    order: 2;  /* Hamburger after profile */
  }
  
  /* Show company name and page name on mobile (smaller) */
  .header-left {
    display: flex;
    flex: 1;
    min-width: 0;  /* Allow shrinking */
  }
  
  .company-name, .page-name {
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .page-separator {
    font-size: 0.85rem;
    flex-shrink: 0;
  }
  
  /* Profile menu comes first, both on RIGHT side */
  .user-menu {
    order: 1;
  }
  
  /* Header right stays on right */
  .header-right {
    margin-left: auto;  /* Push to right */
    flex-shrink: 0;
  }
  
  /* Fix main area - remove left margin on mobile */
  .main-area {
    margin-left: 0 !important;
    width: 100%;
  }
  
  /* Mobile: Compact header with just toggle button and company name */
  .sidebar-header {
    flex-direction: row;
    padding-bottom: 0;
    border-bottom: none;
  }
  
  .sidebar-logo-link {
    flex-direction: row;
    gap: 10px;
    padding: 4px;
  }
  
  .sidebar-logo {
    width: 40px;
    height: 40px;
  }
  
  .sidebar-logo-img,
  .logo-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    padding: 4px;
  }
  
  .logo-text {
    font-size: 1rem;
  }

  /* Sidebar company name (mobile only) */
  .sidebar .logo-text{display:inline;}
  
  .sidebar-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.5rem;
  }
  
  .sidebar-body{display:none}
  .sidebar.open .sidebar-body{display:flex}
  .main-content{padding:18px 16px}
  .page-header-simple{padding:12px 16px; position:static}
  
  /* Mobile: Hide user info text */
  .user-info {
    display: none;
  }
  
  .user-avatar {
    width: 34px;
    height: 34px;
  }
}

/* Tablet (768px - 900px) */
@media (min-width: 768px) and (max-width: 900px) {
  .main-content {
    padding: 16px 12px;
  }
  .page-header-simple {
    padding: 10px 12px;
  }
}

/* Small phones (480px - 768px) */
@media (max-width: 768px) {
  .main-area {
    margin-left: 0 !important;
    width: 100%;
  }
  
  .main-content {
    padding: 14px;
    width: 100%;
  }

  .nav-item {
    font-size: 0.9rem;
    padding: 10px;
  }
  
  .card {
    padding: 14px;
  }
}

@media (max-width: 480px) {
  .main-area {
    margin-left: 0 !important;
    width: 100%;
  }
  
  .main-content {
    padding: 12px;
    width: 100%;
  }

  .page-header-simple {
    padding: 8px 12px;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
}

  .user-menu {
    padding: 6px 8px;
  }

  .user-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }

  .header-nav {
    padding: 0 12px;
  }

  .header-nav-item {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
}

/* Extra small phones (max 480px) */
@media (max-width: 480px) {
  .sidebar-logo {
    width: 50px;
    height: 50px;
  }

  .sidebar-logo-img,
  .logo-icon {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }

  .logo-text {
    font-size: 0.9rem;
  }

  .sidebar-company-info {
    gap: 2px;
  }

  .nav-section-title {
    font-size: 0.7rem;
    margin: 10px 6px 6px;
  }

  .nav-item {
    padding: 8px 8px;
    margin: 4px 0;
    font-size: 0.85rem;
  }

  .nav-item .icon {
    width: 20px;
  }

  .main-content {
    padding: 12px;
  }

  .header {
    padding: 10px;
    gap: 6px;
  }

  .user-menu {
    padding: 6px 8px;
    gap: 6px;
  }

  .user-info {
    display: none;
  }

  .user-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.75rem;
  }

  .header-nav {
    padding: 0 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .header-nav-item {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .card {
    border-radius: 8px;
    padding: 12px !important;
  }

  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 8px 4px !important;
  }

  .btn {
    padding: 10px 14px;
    font-size: 0.9rem;
    min-height: 44px;
  }

  .form-group {
    margin-bottom: 12px;
  }

  .input,
  select,
  textarea {
    padding: 10px;
    font-size: 16px;
  }
}

/* Mobile-only logo */
.header-logo.mobile-only {
  display: none;
}

@media (max-width: 900px) {
  .header-logo.mobile-only {
    display: block;
  }
}
