/* Style CSS - Improvement Dye6 Web Application */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Color Palette */
  --bg-primary: #0b0f19;
  --bg-secondary: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --border-color: rgba(255, 255, 255, 0.08);
  
  --accent-primary: #8b5cf6; /* Violet */
  --accent-secondary: #3b82f6; /* Blue */
  --accent-gradient: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  
  /* Status Colors */
  --color-success: #10b981; /* Emerald */
  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-warning: #f59e0b; /* Amber */
  --color-warning-bg: rgba(245, 158, 11, 0.15);
  --color-danger: #ef4444; /* Coral/Red */
  --color-danger-bg: rgba(239, 68, 68, 0.15);
  --color-info: #06b6d4; /* Cyan */
  --color-info-bg: rgba(6, 182, 212, 0.15);
  
  /* Text Colors */
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Box Shadow & Borders */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 15px rgba(139, 92, 246, 0.3);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  /* Fonts */
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* App Container Layout */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.sidebar {
  width: 300px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.sidebar-logo {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.logo-text {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, #fff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-user {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

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

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

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

.user-role-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-switch-role {
  width: 100%;
  padding: 8px 12px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-switch-role:hover {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.sidebar-filter {
  padding: 20px 24px 10px;
}

.filter-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: block;
}

.year-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.year-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.sidebar-menu {
  flex-grow: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.menu-section-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-left: 12px;
  margin-bottom: 8px;
  margin-top: 16px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

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

.menu-item.active {
  color: #fff;
  background: var(--accent-gradient);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.menu-item svg {
  width: 18px;
  height: 18px;
}

/* Main Content Styling */
.main-content {
  margin-left: 300px;
  flex-grow: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
}

/* Header Styling */
.header {
  height: 80px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-title-container h1 {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 24px;
  color: #fff;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-pill {
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-pill.manager {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill.operator {
  background: var(--color-info-bg);
  color: var(--color-info);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
}

/* Content Container */
.content-body {
  padding: 40px;
  flex-grow: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Animation classes */
.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Glassmorphism Card Base */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  border-color: rgba(139, 92, 246, 0.2);
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}

/* Category Projects Layout */
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 4px 0;
}

.project-title-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.project-expand-icon {
  transition: transform 0.3s ease;
  color: var(--text-secondary);
}

.project-expand-icon.expanded {
  transform: rotate(180deg);
}

.project-badge-group {
  display: flex;
  gap: 8px;
}

.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-status-progress { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-status-done { background: var(--color-success-bg); color: var(--color-success); }
.badge-status-stuck { background: var(--color-danger-bg); color: var(--color-danger); }

.badge-track-on { background: rgba(16, 185, 129, 0.1); color: var(--color-success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-track-off { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); border: 1px solid rgba(239, 68, 68, 0.2); }

.project-body {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  display: none; /* Controlled by JS classes */
}

.project-body.expanded {
  display: block;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.project-info-block {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 16px;
  border-radius: var(--radius-md);
}

.info-block-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.info-block-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
}

/* Action Plan Table Styling */
.table-container {
  overflow-x: auto;
  margin: 16px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.action-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.action-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.action-table td {
  padding: 12px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.action-table tbody tr:last-child td {
  border-bottom: none;
}

.action-table input[type="text"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.action-table input[type="text"]:focus {
  border-color: var(--accent-primary);
}

.btn-remove-row {
  background: transparent;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-remove-row:hover {
  background: var(--color-danger-bg);
}

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

.btn-secondary-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary-sm:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Update section */
.update-section {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 24px;
}

.update-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 16px;
}

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

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.select-custom, .textarea-custom, .input-custom {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  font-family: var(--font-body);
  font-size: 13px;
  transition: all 0.2s;
}

.select-custom:focus, .textarea-custom:focus, .input-custom:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}

.textarea-custom {
  resize: vertical;
  min-height: 80px;
}

/* Manager Comment Block */
.comment-block {
  margin-top: 20px;
  background: rgba(139, 92, 246, 0.05);
  border: 1px dashed rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.comment-content {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
}

.btn-primary {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

/* Propose Project Page Styles */
.propose-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.propose-form-full {
  grid-column: span 2;
}

/* KPI Summary Page Styles */
.kpi-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.kpi-section-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dept-selector-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px 24px;
  border-radius: var(--radius-md);
}

.dept-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.dept-pill {
  padding: 8px 16px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.dept-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.dept-pill.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(139, 92, 246, 0.2);
}

.kpi-progress-item {
  margin-bottom: 20px;
}

.kpi-progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
}

.kpi-progress-name {
  font-weight: 500;
  color: var(--text-primary);
}

.kpi-progress-score {
  font-weight: 600;
  color: var(--accent-primary);
}

.kpi-progress-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.kpi-progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
  width: 0; /* Animated by JS */
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-target-indicator {
  position: absolute;
  top: 0;
  height: 100%;
  width: 2px;
  background: var(--color-warning);
}

.kpi-employee-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}

.kpi-employee-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.kpi-employee-info {
  display: flex;
  flex-direction: column;
}

.kpi-employee-name {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
}

.kpi-employee-dept {
  font-size: 11px;
  color: var(--text-muted);
}

.kpi-employee-score-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.1);
  border: 2px solid var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
}

/* Manager Panel Subtabs */
.manager-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.manager-tab {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.manager-tab:hover {
  color: var(--text-primary);
}

.manager-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.manager-tab-content {
  display: none;
}

.manager-tab-content.active {
  display: block;
}

/* Pending Approval Card */
.pending-card {
  border-left: 4px solid var(--color-warning);
}

.pending-meta {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-success {
  background: var(--color-success);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}

.btn-success:hover { opacity: 0.9; }

.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}

.btn-danger:hover { opacity: 0.9; }

/* Modal overlay & popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 15, 25, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--accent-gradient);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.modal-icon svg {
  width: 30px;
  height: 30px;
  color: #fff;
}

.modal-title {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 24px;
  color: #fff;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.modal-alert {
  background: var(--color-danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--color-danger);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 16px;
  display: none;
}

.btn-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-modal-close:hover {
  color: var(--text-primary);
}

/* Empty State Styling */
.empty-state {
  text-align: center;
  padding: 60px 40px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 14px;
}

/* Responsive constraints */
@media (max-width: 900px) {
  .sidebar {
    width: 80px;
  }
  .sidebar-logo .logo-text,
  .sidebar-user .user-info,
  .btn-switch-role span,
  .sidebar-filter .filter-label,
  .sidebar-filter .year-select,
  .menu-section-title,
  .menu-item span {
    display: none;
  }
  
  .sidebar-logo {
    padding: 16px;
    justify-content: center;
  }
  .sidebar-user {
    padding: 16px;
    justify-content: center;
  }
  .user-status {
    margin-bottom: 0;
  }
  .sidebar-filter {
    padding: 8px;
  }
  .menu-item {
    justify-content: center;
    padding: 12px;
  }
  .main-content {
    margin-left: 80px;
  }
  
  .project-grid, .propose-form-grid, .kpi-summary-grid {
    grid-template-columns: 1fr;
  }
  .propose-form-full {
    grid-column: span 1;
  }
  .logo-large-view {
    display: none !important;
  }
  .logo-small-view {
    display: flex !important;
  }
}

/* Logo Responsive & Custom Card Styles */
.logo-large-view {
  width: 100%;
  display: flex;
  justify-content: center;
  transition: all 0.3s ease;
}
.logo-large-view img {
  max-height: 52px;
  max-width: 100%;
  object-fit: contain;
}
.logo-small-view {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-gradient);
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

