/* =====================================================================
   DEXBPM GLOBAL STYLE SYSTEM - Sleek & Modern Dark System
   ===================================================================== */

:root {
  /* Dynamic custom theme properties, overrides on-the-fly */
  --brand-primary: #10B981;    /* Neon Emerald */
  --brand-secondary: #06B6D4;  /* Neon Cyan */
  --bg-dark: #09090b;          /* Zinc-950 (Retool/Notion Dark) */
  
  /* Constant semantic design tokens */
  --text-primary: #fafafa;     /* Zinc-50 */
  --text-secondary: #a1a1aa;   /* Zinc-400 */
  --text-muted: #71717a;      /* Zinc-500 */
  
  --border-light: #27272a;     /* Zinc-800 border size */
  --border-focus: rgba(16, 185, 129, 0.4);
  
  --bg-card: #18181b;          /* Zinc-900 card background */
  --bg-sidebar: #09090b;       /* Zinc-950 sidebar background */
  
  /* Status tags colors */
  --status-low: #3B82F6;
  --status-medium: #10B981;
  --status-high: #F59E0B;
  --status-critical: #EF4444;
  --status-warning: #D97706;
  --status-info: #06B6D4;

  --accent-clay: #D6A387;
  --accent-clay-light: rgba(214, 163, 135, 0.15);
  
  --shadow-glow: 0 4px 12px 0 rgba(0, 0, 0, 0.5);
  --transition-smooth: all 0.15s ease-in-out;
  --font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
}

/* Light Theme Variables */
body.theme-light {
  --bg-dark: #f4f4f5;          /* Zinc-100 */
  --text-primary: #09090b;     /* Zinc-950 */
  --text-secondary: #52525b;   /* Zinc-600 */
  --text-muted: #a1a1aa;       /* Zinc-400 */
  --border-light: #e4e4e7;     /* Zinc-200 */
  --bg-card: #ffffff;
  --bg-sidebar: #f4f4f5;
  --shadow-glow: 0 4px 12px 0 rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.3s ease;
}

/* Background Decorative Glass Glow */
.decor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.15;
  transition: all 0.5s ease;
}
.glow-1 {
  background: var(--brand-primary);
  top: -100px;
  right: -100px;
}
.glow-2 {
  background: var(--brand-secondary);
  bottom: -100px;
  left: -100px;
}

/* Navbar */
.navbar {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(15, 23, 42, 0.4);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
}
.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Workspace Selector Quick-Switch Dropdown */
.workspace-switcher {
  position: relative;
  display: inline-block;
}
.btn-workspace-switch {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
}
.btn-workspace-switch:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--brand-primary);
}
.workspace-dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: var(--bg-sidebar);
  min-width: 240px;
  box-shadow: var(--shadow-glow);
  z-index: 150;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  margin-top: 8px;
  padding: 8px 0;
}
.workspace-dropdown-content.show {
  display: block;
}
.workspace-dropdown-content a {
  color: var(--text-primary);
  padding: 10px 16px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}
.workspace-dropdown-content a:hover {
  background: rgba(255, 255, 255, 0.05);
}
.workspace-dropdown-content a.active {
  border-left: 3px solid var(--brand-primary);
  background: rgba(16, 185, 129, 0.08);
}
.workspace-dropdown-content a strong {
  font-size: 0.9rem;
  font-weight: 600;
}
.workspace-dropdown-content a span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Glass Panel Utility */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-glow);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 40px 20px 20px 20px;
  max-width: 800px;
  margin: 0 auto;
}
.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #FFF 30%, var(--brand-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Landing Views Grid */
.portal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1000px;
  margin: 20px auto 40px auto;
  padding: 0 20px;
}
@media (max-width: 768px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }
}

.portal-card {
  padding: 30px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.card-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Interactive Forms inside Card */
.portal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.input-group {
  position: relative;
  width: 100%;
}
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.custom-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 12px 16px 12px 42px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}
.custom-input.no-icon {
  padding-left: 16px;
}
.custom-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px var(--border-focus);
}

.custom-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 12px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  min-height: 100px;
  resize: vertical;
  transition: var(--transition-smooth);
}
.custom-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.custom-select-block {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 12px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  cursor: pointer;
}
.custom-select-block:focus {
  outline: none;
  border-color: var(--brand-primary);
}

/* Buttons */
.btn-primary {
  background: var(--brand-primary);
  color: #0F172A;
  font-family: var(--font-family);
  font-weight: 600;
  border: 1px solid transparent;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  padding: 12px 24px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--brand-primary);
}
.btn-secondary.active {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.btn-link {
  background: none;
  border: none;
  color: var(--brand-primary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-link:hover {
  opacity: 0.8;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}
.btn-icon:hover {
  border-color: var(--brand-primary);
  background: rgba(255, 255, 255, 0.1);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-light);
}
.divider::before {
  margin-right: .5em;
}
.divider::after {
  margin-left: .5em;
}

.w-full { width: 100%; }
.mb-10 { margin-bottom: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mt-25 { margin-top: 25px; }

.feedback-msg {
  font-size: 0.85rem;
  margin-top: 8px;
  color: var(--text-secondary);
}
.feedback-msg.error {
  color: var(--status-critical);
}
.feedback-msg.success {
  color: var(--brand-primary);
}

/* Workspace selector items */
.workspace-list-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
}
.workspace-select-card {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border: 1px solid var(--border-light);
  transition: var(--transition-smooth);
}
.workspace-select-card:hover {
  transform: translateX(3px);
  border-color: var(--brand-primary);
  background: rgba(16, 185, 129, 0.05);
}
.ws-card-icon {
  font-size: 1.3rem;
}
.ws-card-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
}
.ws-card-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Download Wrapper Badges */
.download-badge-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.download-badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}
.download-badge:hover {
  border-color: var(--brand-secondary);
  background: rgba(59, 130, 246, 0.05);
}
.download-badge.web-badge:hover {
  border-color: var(--brand-primary);
  background: rgba(16, 185, 129, 0.05);
}
.badge-icon {
  font-size: 1.4rem;
}
.badge-text {
  display: flex;
  flex-direction: column;
}
.badge-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.badge-main {
  font-size: 0.9rem;
  font-weight: 600;
}

/* Developer Toolbox bottom panel */
.developer-toolbox {
  max-width: 1000px;
  margin: 0 auto 30px auto;
  background: rgba(239, 68, 68, 0.08);
  border: 1px dashed rgba(239, 68, 68, 0.3);
  padding: 12px;
  border-radius: 12px;
  text-align: center;
}
.toolbox-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: #EF4444;
  margin-right: 12px;
}
.quick-btn-group {
  display: inline-flex;
  gap: 8px;
  margin-top: 8px;
}
.btn-quick-login {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-family);
  font-size: 0.75rem;
  cursor: pointer;
}
.btn-quick-login:hover {
  border-color: #EF4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}
.status-badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--brand-primary);
}
.status-badge.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-critical);
}
.status-badge.warning {
  background: rgba(217, 119, 6, 0.15);
  color: var(--status-warning);
}

/* Resource details inside magic link */
.resource-detail-box {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  border: 1px solid var(--border-light);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.detail-row {
  display: flex;
  font-size: 0.85rem;
}
.detail-label {
  width: 90px;
  color: var(--text-secondary);
  font-weight: 500;
}
.detail-value {
  color: var(--text-primary);
  font-weight: 600;
}
.desc-row {
  flex-direction: column;
  gap: 4px;
}
.desc-row .detail-value {
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Spinner */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin-bottom: 16px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Unread bubble badge */
.chat-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--status-critical);
  color: #FFF;
  font-size: 0.65rem;
  font-weight: 800;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 5px rgba(239, 68, 68, 0.5);
}

/* ==========================================
   INTERNAL APP / DASHBOARD BAR & LAYOUT
   ========================================== */

.main-content {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
}

.dashboard-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  margin-bottom: 20px;
}
.user-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-avatar {
  width: 38px;
  height: 38px;
  background: var(--accent-clay-light);
  color: var(--accent-clay);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: var(--transition-smooth);
}
.user-avatar:hover {
  border-color: var(--brand-primary);
}
.user-text {
  display: flex;
  flex-direction: column;
}
.user-welcome {
  font-size: 0.9rem;
  font-weight: 600;
}
.user-role-badge {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.company-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.company-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-primary);
}
.sector-badge {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #EF4444;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}
.btn-logout:hover {
  background: #EF4444;
  color: #FFF;
}

/* APP GRID LAYOUT */
.app-layout-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .app-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* Notion Style Left Sidebar */
.app-sidebar {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: fit-content;
}
.sidebar-workspace-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.sidebar-workspace-header:hover {
  border-color: var(--brand-primary);
}
.sw-logo-icon {
  font-size: 1.2rem;
}
.sw-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.sw-title {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.sw-subtitle {
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.sw-switch-icon {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 10px 10px 4px 10px;
  letter-spacing: 0.5px;
}
.collapsible-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.collapsible-content {
  display: block;
}
.sidebar-dynamic-links {
  display: flex;
  flex-direction: column;
  margin-left: 12px;
  padding-left: 8px;
  border-left: 1px solid var(--border-light);
  gap: 2px;
}
.sidebar-sub-link {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 4px;
  transition: var(--transition-smooth);
}
.sub-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

/* Navigation Buttons */
.nav-tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition-smooth);
}
.nav-tab-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}
.nav-tab-btn.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--brand-primary);
  font-weight: 600;
}

/* Main Panel contents */
.app-main-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Sponsored ad tip banner */
.sponsored-tip-banner {
  background: rgba(214, 163, 135, 0.05);
  border: 1px solid rgba(214, 163, 135, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.tip-ad-tag {
  background: var(--accent-clay-light);
  color: var(--accent-clay);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(214,163,135,0.3);
}
.tip-ad-text {
  font-size: 0.85rem;
  flex: 1;
  color: var(--text-secondary);
}
.btn-tip-ad-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}
.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}
.btn-xs {
  padding: 6px 12px;
  font-size: 0.75rem;
}

.isolated-department-banner {
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Instagram Style Cards Board */
.workorder-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.wo-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
  box-shadow: var(--shadow-glow);
}
.wo-card:hover {
  transform: translateY(-2px);
}

.wo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
}
.wo-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wo-avatar-small {
  width: 24px;
  height: 24px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.wo-creator {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.priority-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}
.priority-tag.low { background: rgba(59, 130, 246, 0.15); color: var(--status-low); }
.priority-tag.medium { background: rgba(16, 185, 129, 0.15); color: var(--brand-primary); }
.priority-tag.high { background: rgba(245, 158, 11, 0.15); color: var(--status-high); }
.priority-tag.critical { background: rgba(239, 68, 68, 0.15); color: var(--status-critical); }

.wo-photo-container {
  width: 100%;
  padding-top: 56.25%; /* 16:9 ratio */
  position: relative;
  background: #000;
  border-bottom: 1px solid var(--border-light);
}
.wo-photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wo-card-body {
  padding: 16px;
  flex: 1;
}
.wo-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.wo-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.wo-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--border-light);
}
.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot.pending { background: var(--status-high); }
.status-dot.in_progress { background: var(--status-low); }
.status-dot.completed { background: var(--brand-primary); }

.wo-actions {
  display: flex;
  gap: 6px;
}
.btn-card-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-card-action:hover {
  border-color: var(--brand-primary);
  background: rgba(255,255,255,0.08);
}
.btn-card-action.btn-accent {
  background: var(--accent-clay);
  color: #000;
  border-color: transparent;
}
.btn-card-action.btn-accent:hover {
  background: #E5B499;
}
.btn-complete-trigger {
  background: var(--brand-primary);
  color: #0F172A;
  border-color: transparent;
}
.btn-complete-trigger:hover {
  background: #34D399;
}
.btn-submit-rev-trigger {
  background: var(--status-info);
  color: #0F172A;
  border-color: transparent;
}
.btn-submit-rev-trigger:hover {
  background: #22D3EE;
}

/* ==========================================
   TIME LOG & GPS LAYOUT
   ========================================== */

.timelog-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .timelog-layout-grid {
    grid-template-columns: 1fr;
  }
}

.timelog-action-card {
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.clock-display {
  font-size: 3.2rem;
  font-weight: 800;
  font-family: monospace;
  letter-spacing: 2px;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}
.shift-state-sub {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}

.punch-btn-container {
  margin-top: 30px;
}
.btn-punch-main {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid transparent;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}
.btn-punch-main.state-checkin {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #0F172A;
  border-color: rgba(16, 185, 129, 0.3);
}
.btn-punch-main.state-checkin:hover {
  transform: scale(1.03);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.5);
}
.btn-punch-main.state-checkout {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: #FFF;
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-punch-main.state-checkout:hover {
  transform: scale(1.03);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.5);
}

.secure-connection-tag {
  background: rgba(16, 185, 129, 0.1);
  color: var(--brand-primary);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.gps-coords-display {
  margin-top: 20px;
  font-size: 0.8rem;
  font-family: monospace;
  color: var(--text-secondary);
}

/* Geofencing configuration presets cards */
.gps-sim-card {
  padding: 24px;
}
.gps-sim-card h3 {
  font-size: 1.15rem;
  margin-bottom: 6px;
}
.sim-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.form-group {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.checkbox-group input {
  cursor: pointer;
}

.quick-sim-buttons {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}
.btn-sim-preset {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  flex: 1;
  text-align: center;
  transition: var(--transition-smooth);
}
.btn-sim-preset:hover {
  border-color: var(--brand-primary);
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

/* History table logs */
.history-section {
  padding: 20px;
}
.history-section h3 {
  margin-bottom: 12px;
}
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.custom-table th {
  padding: 10px;
  border-bottom: 1.5px solid var(--border-light);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}
.custom-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}
.gps-flag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==========================================
   STUDIO & WORKFLOW BUILDER
   ========================================== */

.workflow-dashboard-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .workflow-dashboard-layout {
    grid-template-columns: 1fr;
  }
}

.workflow-list-panel {
  padding: 16px;
}
.workflow-list-panel h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text-muted);
}
.workflow-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.workflow-item {
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  transition: var(--transition-smooth);
}
.workflow-item:hover {
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
}
.workflow-item.active {
  background: rgba(16, 185, 129, 0.08);
  border-left: 2px solid var(--brand-primary);
  color: var(--text-primary);
  font-weight: 600;
}

.workflow-designer-panel {
  padding: 20px;
}
.designer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.workflow-steps-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.workflow-step-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px 16px;
  position: relative;
}
.step-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 4px;
}
.step-order {
  color: var(--text-muted);
  font-weight: 700;
}
.step-trigger-badge {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
}
.step-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.step-card-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================
   OFFICE SCREEN
   ========================================== */

.office-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .office-layout-grid {
    grid-template-columns: 1fr;
  }
}
.static-val-text {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.invite-generator-box {
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.15);
  padding: 15px;
  border-radius: 10px;
}
.sub-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.invite-code-display {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: monospace;
  background: #000;
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
  margin-top: 10px;
  letter-spacing: 1px;
  color: var(--brand-secondary);
}

/* ==========================================
   RADAR TAB & SOCIAL CARD STYLING
   ========================================== */

.radar-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-glow);
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}
.radar-post-card:hover {
  transform: translateY(-1px);
}
.radar-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.radar-author-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.radar-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-clay-light);
  color: var(--accent-clay);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
}
.radar-author-name {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
}
.radar-author-title {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 400;
}
.radar-post-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.radar-post-content {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
}
.radar-post-image {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 10px;
  border: 1px solid var(--border-light);
}

/* Post Reactions and Comment actions row */
.radar-post-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
  margin-top: 12px;
}
.radar-reactions-list {
  display: flex;
  gap: 6px;
}
.btn-radar-emoji {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition-smooth);
}
.btn-radar-emoji:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--brand-primary);
}
.btn-radar-emoji.active {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  font-weight: 600;
}
.btn-radar-comment-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-family);
  font-weight: 500;
}
.btn-radar-comment-toggle:hover {
  color: var(--brand-primary);
}

/* Comments Drawer/Collapse inside Social Card */
.radar-comments-section {
  background: rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: 10px;
  margin-top: 10px;
  border: 1px solid var(--border-light);
}
.radar-comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 10px;
}
.radar-comment-item {
  font-size: 0.8rem;
  line-height: 1.4;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
  padding-bottom: 6px;
}
.radar-comment-author {
  font-weight: 700;
  color: var(--brand-secondary);
  margin-right: 6px;
}
.radar-comment-content {
  color: var(--text-primary);
}
.radar-comment-form {
  display: flex;
  gap: 8px;
}
.radar-comment-input {
  flex: 1;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-light);
  color: #FFF;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: var(--font-family);
}
.radar-comment-input:focus {
  outline: none;
  border-color: var(--brand-primary);
}

/* ==========================================
   SOHBETLER (CHAT DRAWER) SLIDING PANEL
   ========================================== */

.chat-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100vh;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-light);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  z-index: 500;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.chat-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-close-drawer {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-close-drawer:hover {
  color: var(--status-critical);
}

.drawer-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Room Items */
.chat-room-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition-smooth);
}
.chat-room-item:hover {
  background: rgba(255,255,255,0.03);
}
.chat-room-item.active {
  background: rgba(16, 185, 129, 0.05);
  border-left: 3px solid var(--brand-primary);
}
.room-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-secondary);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.95rem;
}
.room-avatar.dm { background: var(--accent-clay); }
.room-avatar.department { background: var(--brand-primary); }
.room-avatar.task { background: var(--status-high); }

.room-info {
  flex: 1;
  overflow: hidden;
}
.room-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.room-name-text {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.room-date-text {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.room-last-msg {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Contacts checklist selection list */
.contact-select-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.contact-select-item:hover {
  background: rgba(255,255,255,0.03);
}
.contact-select-checkbox {
  cursor: pointer;
}
.contact-select-details {
  display: flex;
  flex-direction: column;
}
.contact-select-name {
  font-size: 0.85rem;
  font-weight: 700;
}
.contact-select-title {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Chat Messages Balloons */
.chat-messages-log {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg-container {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}
.msg-container.sent {
  align-self: flex-end;
}
.msg-container.received {
  align-self: flex-start;
}
.msg-sender-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 2px;
  padding: 0 4px;
}
.msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.45;
  word-break: break-word;
}
.msg-container.sent .msg-bubble {
  background: var(--brand-primary);
  color: #0F172A;
  font-weight: 500;
  border-bottom-right-radius: 2px;
}
.msg-container.received .msg-bubble {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-bottom-left-radius: 2px;
}
.msg-time-meta {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-align: right;
  padding: 0 4px;
}

/* Active chat buttons on filter row */
.chat-filter-btn.active {
  color: var(--brand-primary) !important;
  font-weight: 700 !important;
  border-bottom: 2px solid var(--brand-primary) !important;
}

/* ==========================================
   MODALS POPUPS
   ========================================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  width: 100%;
  max-width: 460px;
  padding: 24px;
  position: relative;
  animation: modalSlide 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalSlide {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
}
.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-close-modal:hover {
  color: var(--status-critical);
}

.proof-warning {
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.2);
  color: var(--status-warning);
  padding: 10px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  margin-bottom: 15px;
}

/* Audit logs timeline styling */
.history-logs-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-log-item {
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 12px;
}

/* Color picker panel styles */
.theme-picker-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.color-picker-input {
  border: none;
  background: none;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

/* Footer styling */
.footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--border-light);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 40px;
}
.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
}
.footer-link:hover {
  color: var(--brand-primary);
}

/* ==========================================
   USER PROFILE & AVATAR UPLOAD STYLING
   ========================================== */
.profile-avatar-uploader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.profile-avatar-preview-container {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--brand-primary);
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-smooth);
}
.profile-avatar-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-drag-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  cursor: pointer;
  text-align: center;
  padding: 4px;
}
.profile-avatar-preview-container:hover .profile-avatar-drag-overlay,
.profile-avatar-preview-container.drag-over .profile-avatar-drag-overlay {
  opacity: 1;
}
.avatar-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}
.profile-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 15px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toggle-switch-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  margin-bottom: 8px;
}
.toggle-switch-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.toggle-switch-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.toggle-switch-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.switch-control {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border-radius: 24px;
  border: 1px solid var(--border-light);
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .3s;
  border-radius: 50%;
}
input:checked + .switch-slider {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}
input:checked + .switch-slider:before {
  transform: translateX(20px);
  background-color: #fff;
}

/* ==========================================
   RTL (RIGHT-TO-LEFT) LAYOUT OVERRIDES
   ========================================== */
[dir="rtl"] {
  text-align: right;
}
[dir="rtl"] .sidebar-workspace-header {
  flex-direction: row-reverse;
}
[dir="rtl"] .sidebar-dynamic-links {
  margin-left: 0;
  margin-right: 12px;
  padding-left: 0;
  padding-right: 8px;
  border-left: none;
  border-right: 1px solid var(--border-light);
}
[dir="rtl"] .nav-tab-btn {
  text-align: right;
}
[dir="rtl"] .nav-tab-btn i {
  margin-left: 8px;
  margin-right: 0;
}
[dir="rtl"] .btn-workspace-switch i {
  margin-left: 0;
  margin-right: 8px;
}
[dir="rtl"] .user-meta {
  flex-direction: row-reverse;
}
[dir="rtl"] .dashboard-bar {
  flex-direction: row-reverse;
}
[dir="rtl"] .panel-header {
  flex-direction: row-reverse;
}
[dir="rtl"] .workflow-designer-panel .designer-header {
  flex-direction: row-reverse;
}
[dir="rtl"] .detail-row {
  flex-direction: row-reverse;
}
[dir="rtl"] .detail-label {
  text-align: left;
  margin-left: 8px;
  margin-right: 0;
}
[dir="rtl"] .logo-text-part {
  text-anchor: end;
}
[dir="rtl"] .toggle-switch-label {
  text-align: right;
}
[dir="rtl"] .logo {
  transform: scaleX(-1);
}

/* ==========================================
   CASH FLOW (NAKİT AKIŞI) DESIGN SYSTEM
   ========================================== */
.cashflow-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 15px;
  margin-bottom: 25px;
}

.cf-summary-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 100px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cf-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.cf-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.cf-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cf-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.cf-card-values {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cf-card-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
}

.cf-chart-section {
  padding: 20px;
  margin-bottom: 25px;
}

.cf-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.cf-chart-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.cf-chart-controls {
  display: flex;
  gap: 10px;
}

.cf-select-inline {
  width: auto !important;
  display: inline-block;
  padding: 6px 30px 6px 12px !important;
  font-size: 0.8rem;
  background-color: rgba(255, 255, 255, 0.03) !important;
}

.cf-chart-body {
  width: 100%;
  height: 280px;
  position: relative;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 10px;
  border: 1px solid var(--border-light);
}

.cf-table-section {
  padding: 20px;
  margin-bottom: 30px;
}

.cf-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.cf-table-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.cf-table-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cf-search-inline {
  font-size: 0.8rem;
  padding: 6px 12px;
  width: 200px;
  background-color: rgba(255, 255, 255, 0.03);
}

.cf-table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.1);
}

.cf-excel-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.cf-excel-table th {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  font-weight: 700;
  color: var(--text-secondary);
}

.cf-excel-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.cf-excel-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

.cf-excel-table th:last-child,
.cf-excel-table td:last-child {
  border-right: none;
}

/* Status & Type Tags */
.cf-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}
.cf-status-tag.paid {
  background: rgba(16, 185, 129, 0.15);
  color: var(--brand-primary);
}
.cf-status-tag.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--status-high);
}
.cf-status-tag.overdue {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-critical);
}

.cf-type-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  text-align: center;
}
.cf-type-tag.income {
  background: rgba(6, 182, 212, 0.15);
  color: #06B6D4;
}
.cf-type-tag.expense {
  background: rgba(244, 63, 94, 0.15);
  color: #F43F5E;
}

/* Inline checkbox styles */
.row-checkbox {
  user-select: none;
}
.row-checkbox label {
  font-size: 0.85rem !important;
}

@media (max-width: 992px) {
  .cf-table-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .cf-table-filters {
    width: 100%;
  }
  .cf-search-inline {
    flex: 1;
    width: 100%;
  }
}

/* ============================================================
   EMPTY STATE - No Company View
   ============================================================ */
.empty-state-icon {
  font-size: 4rem;
  color: var(--text-muted);
  animation: pulse-glow 2.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* ============================================================
   SIDEBAR ACCESS LEVEL CLASSES
   ============================================================ */
/* These are hidden by default and revealed by JS based on access_level */
.level-2-up,
.level-3-up,
.level-4-up,
.level-5-only {
  display: none;
}

/* JS adds .level-N-visible to <aside> to reveal appropriate elements */
.level-2-active .level-2-up,
.level-3-active .level-2-up,
.level-4-active .level-2-up,
.level-5-active .level-2-up { display: flex; }

.level-3-active .level-3-up,
.level-4-active .level-3-up,
.level-5-active .level-3-up { display: flex; }

.level-4-active .level-4-up,
.level-5-active .level-4-up { display: flex; }

.level-5-active .level-5-only { display: flex; }

/* Sidebar section titles using same level classes */
div.level-2-up, div.level-3-up, div.level-4-up {
  display: none;
}
.level-2-active div.level-2-up,
.level-3-active div.level-2-up,
.level-4-active div.level-2-up,
.level-5-active div.level-2-up { display: block; }

.level-3-active div.level-3-up,
.level-4-active div.level-3-up,
.level-5-active div.level-3-up { display: block; }

.level-4-active div.level-4-up,
.level-5-active div.level-4-up { display: block; }

/* ============================================================
   DYNAMIC SIDEBAR ACCORDION CATEGORIES
   ============================================================ */
.sidebar-category-section {
  margin-top: 4px;
}

.sidebar-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}

.sidebar-category-header:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.sidebar-category-header .fold-arrow {
  font-size: 0.65rem;
  transition: transform 0.2s ease;
}

.sidebar-category-header.collapsed .fold-arrow {
  transform: rotate(-90deg);
}

.sidebar-category-content {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sidebar-category-content.collapsed {
  max-height: 0;
}

.sidebar-category-content .nav-tab-btn {
  padding-left: 24px;
}

/* ============================================================
   AUTOCOMPLETE DROPDOWN COMPONENT
   ============================================================ */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  display: none;
}

.autocomplete-list.active {
  display: block;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: rgba(16, 185, 129, 0.12);
  color: var(--brand-primary);
}

.autocomplete-item .autocomplete-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   PERSONALIZED INVITE CARDS
   ============================================================ */
.invite-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: border-color 0.15s;
}

.invite-card:hover {
  border-color: var(--brand-primary);
}

.invite-card-qr {
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.invite-card-body {
  flex: 1;
  min-width: 0;
}

.invite-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.invite-card-code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  background: rgba(16, 185, 129, 0.1);
  color: var(--brand-primary);
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 6px;
}

.invite-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.invite-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* ============================================================
   CREATE INVITE MODAL
   ============================================================ */
#modal-create-invite .modal-content {
  max-width: 460px;
}

/* ============================================================
   SIDEBAR SECTION TITLE FOR LEVEL VISIBILITY
   ============================================================ */
/* Override admin-only for the new level system */
.admin-only {
  display: none;
}

/* ==========================================
   LEAVES / İZİNLERİM SCREEN
   ========================================== */
.leaves-layout-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
  margin-top: 15px;
}
@media (max-width: 900px) {
  .leaves-layout-grid {
    grid-template-columns: 1fr;
  }
}
.leaves-balance-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.balance-card {
  padding: 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(10px);
}
.balance-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.balance-card.balance-remaining {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.05);
}
.balance-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.balance-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 6px;
}
.balance-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.leaves-main-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Calendar styling */
.calendar-card {
  padding: 20px;
  border-radius: 12px;
}
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.calendar-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.btn-calendar-nav {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.btn-calendar-nav:hover {
  background: rgba(255, 255, 255, 0.1);
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
}
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar-day-cell {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  min-height: 80px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.calendar-day-cell.other-month {
  opacity: 0.3;
}
.calendar-day-cell.today {
  border-color: var(--brand-primary);
  background: rgba(16, 185, 129, 0.02);
}
.day-number {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  align-self: flex-end;
  margin-bottom: 4px;
}
.calendar-day-cell.today .day-number {
  color: var(--brand-primary);
}
.calendar-event-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: auto;
  overflow: hidden;
}
.calendar-event-bar {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.1s;
}
.calendar-event-bar:hover {
  transform: scale(1.03);
}

/* Colors for leave types */
.event-yillik_izin, .event-annual {
  background-color: var(--brand-primary) !important;
  color: #141211 !important;
}
.event-saglik_izni, .event-sick {
  background-color: #3B82F6 !important;
  color: #fff !important;
}
.event-idari_izin, .event-excuse {
  background-color: #F59E0B !important;
  color: #141211 !important;
}
.event-ucretsiz_izin, .event-other {
  background-color: #6B7280 !important;
  color: #fff !important;
}

/* Custom Tooltip Popover styling */
.calendar-tooltip {
  position: absolute;
  background: rgba(20, 18, 17, 0.95);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 1000;
  width: 220px;
  color: var(--text-primary);
  pointer-events: none;
  font-size: 0.8rem;
}
.calendar-tooltip h4 {
  font-weight: 700;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 4px;
}
.calendar-tooltip p {
  margin: 3px 0;
}

