/* ============================================================
   Policy & Consent Management ERP - styles.css
   Professional corporate design for AWS CloudFront / S3
   ============================================================ */

/* ─── CSS Variables (Design Tokens) ─────────────────────────── */
:root {
  --color-primary: #1a56db;
  --color-primary-hover: #1648b8;
  --color-primary-light: #e8eefb;
  --color-surface: #ffffff;
  --color-background: #f1f5f9;
  --color-sidebar: #0f172a;
  --color-sidebar-hover: #1e293b;
  --color-sidebar-active: #1a56db;
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;
  --color-text-inverse: #ffffff;
  --color-border: #e2e8f0;
  --color-border-hover: #cbd5e1;
  --color-success: #059669;
  --color-success-bg: #ecfdf5;
  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-info: #1a56db;
  --color-info-bg: #e8eefb;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--color-background);
  color: var(--color-text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ─── Login Screen ─────────────────────────────────────────── */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 24px;
}

.login-container {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 48px 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
}

.login-logo {
  width: 96px;
  height: 96px;
  background: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.login-logo svg {
  width: 28px;
  height: 28px;
  color: var(--color-text-inverse);
}

.login-container h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.login-container p {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  line-height: 1.5;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 24px;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text-primary);
  transition: all var(--transition);
  margin-bottom: 16px;
}

.login-btn:hover {
  background: var(--color-background);
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-sm);
}

.login-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.login-footer {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ─── App Layout ──────────────────────────────────────────── */
#app-screen {
  display: none;
  min-height: 100vh;
}

#app-screen.active {
  display: flex;
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform var(--transition);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo svg {
  width: 20px;
  height: 20px;
  color: var(--color-text-inverse);
}

.sidebar-brand {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-inverse);
  letter-spacing: -0.01em;
}

.sidebar-brand span {
  display: block;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-top: 1px;
}

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

.sidebar-section {
  margin-bottom: 24px;
}

.sidebar-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 450;
  color: rgba(255, 255, 255, 0.65);
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-link:hover {
  background: var(--color-sidebar-hover);
  color: var(--color-text-inverse);
}

.sidebar-link.active {
  background: var(--color-sidebar-active);
  color: var(--color-text-inverse);
  font-weight: 500;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-link.active svg,
.sidebar-link:hover svg {
  opacity: 1;
}

.sidebar-link .badge {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}

.sidebar-link.active .badge {
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-text-inverse);
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ─── Main Content Area ──────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Top Bar ────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  transition: all var(--transition);
}

.mobile-menu-btn:hover {
  background: var(--color-background);
}

.mobile-menu-btn svg {
  width: 20px;
  height: 20px;
}

.topbar-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

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

.topbar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  transition: all var(--transition);
  position: relative;
}

.topbar-icon-btn:hover {
  background: var(--color-background);
  color: var(--color-text-primary);
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-danger);
  border: 2px solid var(--color-surface);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: all var(--transition);
}

.user-menu:hover {
  background: var(--color-background);
  border-color: var(--color-border-hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
}

.user-info {
  text-align: left;
}

.user-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.user-role {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  line-height: 1.2;
}

.user-menu-chevron {
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}

/* ─── User Dropdown ──────────────────────────────────────── */
.user-dropdown {
  position: absolute;
  top: calc(var(--topbar-height) - 4px);
  right: 32px;
  width: 220px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 100;
  display: none;
  overflow: hidden;
}

.user-dropdown.open {
  display: block;
  animation: slideDown 150ms ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
  padding: 16px;
  border-bottom: 1px solid var(--color-border);
}

.user-dropdown-header .name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.user-dropdown-header .email {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all var(--transition);
}

.user-dropdown-item:hover {
  background: var(--color-background);
  color: var(--color-text-primary);
}

.user-dropdown-item.danger {
  color: var(--color-danger);
}

.user-dropdown-item.danger:hover {
  background: var(--color-danger-bg);
}

.user-dropdown-item svg {
  width: 16px;
  height: 16px;
}

.dropdown-divider {
  height: 1px;
  background: var(--color-border);
}

/* ─── Page Content ───────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 32px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-header-left h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.page-header-left p {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.page-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ─── Stats Row ──────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-hover);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card-icon.blue {
  background: var(--color-info-bg);
  color: var(--color-primary);
}

.stat-card-icon.green {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.stat-card-icon.amber {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.stat-card-icon.red {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.stat-card-icon svg {
  width: 20px;
  height: 20px;
}

.stat-card-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.stat-card-subtext {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-background);
  border-color: var(--color-border-hover);
}

.btn-danger {
  background: var(--color-danger);
  color: var(--color-text-inverse);
  border-color: var(--color-danger);
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-success {
  background: var(--color-success);
  color: var(--color-text-inverse);
  border-color: var(--color-success);
}

.btn-success:hover {
  background: #047857;
  border-color: #047857;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
  padding: 9px 10px;
}

.btn-ghost:hover {
  background: var(--color-background);
  color: var(--color-text-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 6px;
  cursor: pointer;
  color: #64748b;
  transition: all 0.15s;
}
.btn-icon:hover { background: #f1f5f9; color: #0f172a; }
.btn-icon svg { width: 14px; height: 14px; }
.btn-icon-danger { color: #ef4444; border-color: #fecaca; }
.btn-icon-danger:hover { background: #fef2f2; color: #dc2626; }

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ─── Data Table ─────────────────────────────────────────── */
.data-table-wrapper {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 12px;
  border-bottom: 1px solid var(--color-border);
}

.data-table-search {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.data-table-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  font-size: 0.8125rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-background);
  color: var(--color-text-primary);
  transition: all var(--transition);
  outline: none;
}

.data-table-search input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
  background: var(--color-surface);
}

.data-table-search input::placeholder {
  color: var(--color-text-muted);
}

.data-table-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
}

.data-table-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--color-background);
}

th {
  padding: 10px 20px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

td {
  padding: 14px 20px;
  font-size: 0.8125rem;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--color-background);
}

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

.td-title {
  font-weight: 500;
  color: var(--color-text-primary);
}

.td-desc {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: 2px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.td-date {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

.td-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Empty State ────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  text-align: center;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--color-background);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--color-text-muted);
}

.empty-state-icon svg {
  width: 24px;
  height: 24px;
}

.empty-state h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
  max-width: 320px;
}

/* ─── Status Badges ──────────────────────────────────────── */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-accepted {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge-accepted .dot {
  background: var(--color-success);
}

.badge-rejected {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.badge-rejected .dot {
  background: var(--color-danger);
}

.badge-pending {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.badge-pending .dot {
  background: var(--color-warning);
}

.badge-role {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-role.admin {
  background: var(--color-info-bg);
  color: var(--color-primary);
}

.badge-role.hr {
  background: #f0fdf4;
  color: #16a34a;
}

.badge-role.it {
  background: #fefce8;
  color: #ca8a04;
}

.badge-role.employee {
  background: var(--color-background);
  color: var(--color-text-secondary);
}

.badge-role.manager {
  background: #faf5ff;
  color: #9333ea;
}

/* ─── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(8px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0 24px;
}

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

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

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-body {
  padding: 24px;
}

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

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  transition: all var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2394a3b8'%3e%3cpath d='M4.22 6.22a.75.75 0 011.06 0L8 8.94l2.72-2.72a.75.75 0 111.06 1.06l-3.25 3.25a.75.75 0 01-1.06 0L4.22 7.28a.75.75 0 010-1.06z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 24px 24px 24px;
}

/* ─── Toast Notifications ────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 320px;
  max-width: 420px;
  pointer-events: auto;
  animation: toastIn 300ms ease-out;
}

.toast.removing {
  animation: toastOut 200ms ease-in forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(24px); }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--color-success); }
.toast.error .toast-icon { color: var(--color-danger); }
.toast.warning .toast-icon { color: var(--color-warning); }
.toast.info .toast-icon { color: var(--color-primary); }

.toast-message {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 450;
  color: var(--color-text-primary);
}

.toast-dismiss {
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all var(--transition);
}

.toast-dismiss:hover {
  color: var(--color-text-primary);
  background: var(--color-background);
}

/* ─── Confirm Dialog ─────────────────────────────────────── */
.confirm-body {
  text-align: center;
  padding: 32px 24px 24px 24px;
}

.confirm-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-danger-bg);
  color: var(--color-danger);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.confirm-icon svg {
  width: 24px;
  height: 24px;
}

.confirm-body h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 8px;
}

.confirm-body p {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* ─── Loading Spinner ────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

.spinner.sm { width: 14px; height: 14px; border-width: 2px; }
.spinner.lg { width: 32px; height: 32px; border-width: 3px; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  gap: 12px;
}

.loading-overlay span {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ─── Page Views ─────────────────────────────────────────── */
.page-view {
  display: none;
}

.page-view.active {
  display: block;
}

/* ─── Skeleton Loading ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--color-border) 25%, #f1f5f9 50%, var(--color-border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Responsive ─────────────────────────────────────────── */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 45;
  display: none;
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .mobile-overlay.open {
    display: block;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .page-content {
    padding: 24px 16px;
  }

  .topbar {
    padding: 0 16px;
  }

  .page-header {
    flex-direction: column;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .data-table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .data-table-search {
    max-width: none;
  }

  .user-info {
    display: none;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .page-header-actions {
    flex-direction: column;
    width: 100%;
  }

  .page-header-actions .btn {
    width: 100%;
  }

  .modal {
    margin: 16px;
  }
}

/* ─── Utility ────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── WorkMate Login Branding ─────────────────────────────────── */
.login-logo-img { width: 96px; height: 96px; object-fit: contain; border-radius: 0; background: transparent; }
.login-logo-svg { width: 96px; height: 96px; background: var(--color-primary, #3b82f6); border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.login-logo-svg svg { width: 40px; height: 40px; color: #fff; }
.login-app-name { font-size: 1.75rem; font-weight: 700; margin: 12px 0 4px; }
.login-tagline { font-size: 0.9375rem; color: var(--text-secondary, #64748b); margin-bottom: 28px; }

/* ─── Sidebar brand button (clickable logo) ───────────────────── */
.sidebar-brand-btn { display: flex; align-items: center; gap: 10px; background: none; border: none; cursor: pointer; padding: 0; width: 100%; text-align: left; }
.sidebar-brand-btn:hover .brand-name { color: var(--color-primary, #3b82f6); }
.company-logo-img { width: 40px; height: 40px; object-fit: contain; }
.company-logo-svg { width: 36px; height: 36px; background: var(--color-primary, #3b82f6); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.company-logo-svg svg { width: 20px; height: 20px; color: #fff; }
.sidebar-brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 0.9375rem; font-weight: 700; color: #f1f5f9; }
.brand-sub { font-size: 0.7rem; color: var(--text-secondary, #64748b); }

/* ─── Policy row hover ────────────────────────────────────────── */
.policy-row-clickable:hover { background: var(--bg-hover, #f8fafc); }
.policy-title-cell { display: flex; flex-direction: column; gap: 2px; }
.policy-desc { font-size: 0.78rem; color: var(--text-secondary, #64748b); }
.policy-meta { padding-bottom: 12px; border-bottom: 1px solid var(--border, #e2e8f0); margin-bottom: 16px; }
.policy-meta-row { display: flex; gap: 12px; font-size: 0.85rem; color: var(--text-secondary, #64748b); flex-wrap: wrap; }
.policy-content-body { max-height: 55vh; overflow-y: auto; }
.policy-text { font-size: 0.9375rem; line-height: 1.7; color: var(--text-primary, #0f172a); white-space: pre-wrap; }
.modal-large { max-width: 720px; }
.accepted-badge { display: flex; align-items: center; gap: 6px; color: #16a34a; font-weight: 600; font-size: 0.875rem; }

/* ─── Consent stats mini ──────────────────────────────────────── */
.consent-mini-stats { font-size: 0.8rem; }
.accepted-count { color: #16a34a; font-weight: 500; }
.pending-count { color: #d97706; font-weight: 500; }

/* ─── Consent grouped cards ───────────────────────────────────── */
.consent-group-card { background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 12px; padding: 20px 24px; margin-bottom: 16px; }
.consent-group-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 16px; }
.consent-group-info { flex: 1; }
.consent-group-title { font-size: 1rem; font-weight: 600; margin: 0 0 4px; }
.consent-group-subtitle { font-size: 0.8125rem; color: var(--text-secondary, #64748b); }
.consent-progress-bar-wrap { height: 6px; background: #e2e8f0; border-radius: 999px; margin-bottom: 12px; overflow: hidden; }
.consent-progress-bar { height: 100%; background: #16a34a; border-radius: 999px; transition: width 0.4s ease; }
.consent-group-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat-pill { font-size: 0.8rem; font-weight: 500; padding: 3px 10px; border-radius: 999px; }
.stat-pill.accepted { background: #dcfce7; color: #16a34a; }
.stat-pill.pending { background: #fef9c3; color: #854d0e; }
.stat-pill.total { background: #f1f5f9; color: #475569; }

/* ─── Consent detail modal ────────────────────────────────────── */
.consent-detail-stats { margin-bottom: 16px; }
.consent-detail-stats-row { display: flex; gap: 12px; flex-wrap: wrap; }
.consent-stat-pill { font-size: 0.875rem; font-weight: 600; padding: 6px 14px; border-radius: 999px; }
.consent-stat-pill.accepted { background: #dcfce7; color: #16a34a; }
.consent-stat-pill.pending { background: #fef9c3; color: #854d0e; }
.consent-stat-pill.total { background: #f1f5f9; color: #475569; }

/* ─── Stat card purple variant ────────────────────────────────── */
.stat-card-icon.purple { background: #f3e8ff; color: #7c3aed; }

/* ─── Clickable stat cards ────────────────────────────────────── */
.stat-card-clickable { cursor: pointer; border: none; text-align: left; width: 100%; transition: transform 0.15s ease, box-shadow 0.15s ease; position: relative; }
.stat-card-clickable:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.stat-card-hint { font-size: 0.72rem; color: var(--color-primary, #3b82f6); margin-top: 8px; opacity: 0; transition: opacity 0.15s ease; font-weight: 500; }
.stat-card-clickable:hover .stat-card-hint { opacity: 1; }

/* ─── Icon Button (inline table actions) ─────────────────── */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.icon-btn:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}


/* ═══════════════════════════════════════════════════════════
   PHASE 2 — EFFORT TRACKING STYLES
   ═══════════════════════════════════════════════════════════ */

/* ─── Log Hours Layout ─────────────────────────────────── */
.log-hours-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .log-hours-layout { grid-template-columns: 1fr; }
}

/* ─── Timesheet Grid ─────────────────────────────────────── */
.timesheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.timesheet-table th {
  background: var(--color-surface-secondary, #f8fafc);
  padding: 10px 12px;
  text-align: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary, #64748b);
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}
.timesheet-table th:first-child { text-align: left; }
.timesheet-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border, #f1f5f9);
  text-align: center;
  color: var(--color-text-primary, #0f172a);
}
.timesheet-table td:first-child { text-align: left; font-weight: 600; }
.timesheet-table tfoot td {
  font-weight: 700;
  background: var(--color-surface-secondary, #f8fafc);
  border-top: 2px solid var(--color-border, #e2e8f0);
}
.ts-hours-cell { font-weight: 600; color: var(--color-primary, #3b82f6); }
.ts-empty-cell { color: var(--color-text-muted, #cbd5e1); }
.ts-today { background: #eff6ff !important; }
.ts-weekend { background: var(--color-surface-secondary, #f8fafc); opacity: 0.7; }
.ts-total-row td { background: #f0fdf4; color: #15803d; font-weight: 700; }

/* ─── Project Table ─────────────────────────────────────── */
.project-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.project-status-badge.active    { background: #dcfce7; color: #15803d; }
.project-status-badge.completed { background: #dbeafe; color: #1d4ed8; }
.project-status-badge.on_hold   { background: #fef9c3; color: #854d0e; }
.project-status-badge.archived  { background: #f1f5f9; color: #64748b; }

.project-progress-bar {
  height: 6px;
  background: var(--color-border, #e2e8f0);
  border-radius: 999px;
  overflow: hidden;
  min-width: 80px;
}
.project-progress-bar-fill {
  height: 100%;
  background: var(--color-primary, #3b82f6);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.project-progress-bar-fill.over { background: #ef4444; }

/* ─── Recent Logs Table ─────────────────────────────────── */
.log-entry-row, .log-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border, #f1f5f9);
}
.log-entry-row:last-child { border-bottom: none; }
.log-entry-date {
  min-width: 80px;
  font-size: 11px;
  color: var(--color-text-secondary, #64748b);
  padding-top: 2px;
}
.log-entry-info { flex: 1; }
.log-entry-project {
  font-weight: 600;
  font-size: 13px;
  color: var(--color-primary, #3b82f6);
  margin-bottom: 2px;
}
.log-entry-desc {
  font-size: 12px;
  color: var(--color-text-secondary, #64748b);
}
.log-entry-hours {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-primary, #0f172a);
  min-width: 50px;
  text-align: right;
}
.log-entry-actions { display: flex; gap: 4px; }

/* ─── KPI Cards for Reports ─────────────────────────────── */
.kpi-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  padding: 20px 24px;
}
.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-secondary, #64748b);
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-text-primary, #0f172a);
  line-height: 1;
}
.kpi-sub {
  font-size: 12px;
  color: var(--color-text-secondary, #64748b);
  margin-top: 4px;
}

/* ─── Member Chip ────────────────────────────────────────── */
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface-secondary, #f1f5f9);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.member-chip.selected {
  background: var(--color-primary, #3b82f6);
  color: #fff;
  border-color: var(--color-primary, #3b82f6);
}
.member-chip:hover { opacity: 0.8; }

/* ─── Timer ──────────────────────────────────────────────── */
.timer-display {
  font-size: 48px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 2px;
  color: var(--color-text-primary, #0f172a);
  padding: 16px 0;
  font-variant-numeric: tabular-nums;
}

.timer-section {
  background: var(--color-surface-secondary, #f8fafc);
  border-radius: var(--radius-md, 8px);
  padding: 16px;
  border: 1px solid var(--color-border, #e2e8f0);
}

.btn-danger {
  background: #ef4444;
  color: #fff;
  border: none;
}
.btn-danger:hover { background: #dc2626; }

.btn-success {
  background: #10b981;
  color: #fff;
  border: none;
}
.btn-success:hover { background: #059669; }


/* ─── Stats Grid (KPI cards row) ────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.stats-grid .kpi-card {
  padding: 14px 18px;
}
.stats-grid .kpi-value {
  font-size: 22px;
}

/* ─── Reports layout ─────────────────────────────────────── */
.report-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .report-charts-grid { grid-template-columns: 1fr; }
}

/* ─── Sidebar collapse ───────────────────────────────────── */
.sidebar {
  transition: width 0.2s ease;
  overflow: hidden;
}


/* ─── Chart sizing fixes ────────────────────────────────── */
.report-charts-grid .card {
  padding: 16px;
}
.report-charts-grid canvas {
  max-height: 200px !important;
}
#chart-daily {
  max-height: 180px !important;
}

/* ─── Teams page KPI compact ─────────────────────────────── */
#teams-kpi-row {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* ─── Reports page header + filter ──────────────────────── */
.report-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.report-filter-bar .form-group {
  margin: 0;
  flex: 1;
  min-width: 140px;
}

/* ─── Sidebar brand name always visible ──────────────────── */
.sidebar-brand-text .brand-name {
  color: #f1f5f9 !important;
}
.sidebar-brand-text .brand-tagline {
  color: #94a3b8 !important;
}


/* ─── Chart canvas sizes ─────────────────────────────────── */
#chart-by-project,
#chart-by-employee {
  max-height: 240px;
}
#chart-daily {
  max-height: 150px;
}
.report-charts-grid .card {
  overflow: hidden;
}




/* Collapsed state */
.sidebar.collapsed {
  width: 60px !important;
}

/* Hide all text in collapsed sidebar */
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .sidebar-section-label {
  display: none !important;
}

/* Hide text nodes in buttons - use font-size trick */
.sidebar.collapsed .sidebar-link {
  font-size: 0 !important;
  justify-content: center !important;
  padding: 12px !important;
}
.sidebar.collapsed .sidebar-link svg {
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  flex-shrink: 0;
}
.sidebar.collapsed .sidebar-link .badge {
  display: none !important;
}

/* Hide brand text */
.sidebar.collapsed .brand-name,
.sidebar.collapsed .brand-tagline,
.sidebar.collapsed p {
  display: none !important;
}
.sidebar.collapsed .sidebar-brand-btn {
  justify-content: center !important;
  padding: 12px 8px !important;
}

/* Main wrapper transition */
.main-wrapper {
  transition: margin-left 0.25s ease;
}


/* ══════════════════════════════════════════════════════════
   SIDEBAR COLLAPSE — CLEAN IMPLEMENTATION
   ══════════════════════════════════════════════════════════ */

/* Smooth transition for sidebar width */
.sidebar {
  transition: width 0.25s ease;
  overflow: hidden;
}

/* Smooth transition for main content */
.main-wrapper {
  transition: margin-left 0.25s ease;
}

/* Toggle button at bottom of sidebar */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  background: rgba(255,255,255,0.04);
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
  letter-spacing: 0;
}
.sidebar-toggle:hover {
  background: rgba(59,130,246,0.15);
  color: #93c5fd;
}

/* ── Collapsed state ── */
.sidebar.collapsed {
  width: 60px !important;
}

/* Hide section titles */
.sidebar.collapsed .sidebar-section-title {
  display: none !important;
}

/* Hide nav label text */
.sidebar.collapsed .nav-label {
  display: none !important;
}

/* Hide badge counts */
.sidebar.collapsed .badge {
  display: none !important;
}

/* Center the icon */
.sidebar.collapsed .sidebar-link {
  justify-content: center !important;
  padding: 10px 0 !important;
}
.sidebar.collapsed .sidebar-link svg {
  margin: 0 !important;
  width: 22px !important;
  height: 22px !important;
}

/* Hide brand text */
.sidebar.collapsed .brand-name,
.sidebar.collapsed .brand-tagline {
  display: none !important;
}
.sidebar.collapsed .sidebar-brand-btn {
  justify-content: center !important;
  padding: 10px !important;
}
.sidebar.collapsed .sidebar-brand-btn .sidebar-logo {
  margin: 0 !important;
}

/* Collapsed toggle shows ▶ */
.sidebar.collapsed .sidebar-toggle {
  font-size: 14px;
}
/* ── Tag chips & filter buttons ── */
.tag-chip { display:inline-block; background:#dbeafe; color:#1d4ed8; border-radius:999px; padding:2px 10px; font-size:11px; font-weight:600; margin:2px 3px 2px 0; }
.tag-filter-btn { background:#f1f5f9; border:1px solid #e2e8f0; border-radius:999px; padding:4px 14px; font-size:12px; font-weight:600; cursor:pointer; color:#475569; }
.tag-filter-btn.active { background:#1e40af; color:#fff; border-color:#1e40af; }
.tag-filter-btn:hover { background:#e2e8f0; }
.tag-filter-btn.active:hover { background:#1d4ed8; }
.btn-sm { padding:4px 12px; font-size:12px; }
