:root {
  /* =========================================
     1. Design Tokens
     ========================================= */

  /* Colors: Brand (Modern Alfresco Blue) */
  --alf-brand-50:  #eff6ff;
  --alf-brand-100: #dbeafe;
  --alf-brand-200: #bfdbfe;
  --alf-brand-300: #93c5fd;
  --alf-brand-400: #60a5fa;
  --alf-brand-500: #3b82f6; /* Primary */
  --alf-brand-600: #2563eb;
  --alf-brand-700: #1d4ed8;
  --alf-brand-800: #1e40af;
  --alf-brand-900: #1e3a8a;

  /* Colors: Neutrals (Cool Gray) */
  --alf-neutral-50:  #f8fafc;
  --alf-neutral-100: #f1f5f9;
  --alf-neutral-200: #e2e8f0;
  --alf-neutral-300: #cbd5e1;
  --alf-neutral-400: #94a3b8;
  --alf-neutral-500: #64748b;
  --alf-neutral-600: #475569;
  --alf-neutral-700: #334155;
  --alf-neutral-800: #1e293b;
  --alf-neutral-900: #0f172a;
  --alf-white: #ffffff;
  --alf-black: #000000;

  /* Colors: Semantics */
  --alf-success-bg: #dcfce7;
  --alf-success-text: #166534;
  --alf-warning-bg: #fef9c3;
  --alf-warning-text: #854d0e;
  --alf-error-bg: #fee2e2;
  --alf-error-text: #991b1b;
  --alf-info-bg: #e0f2fe;
  --alf-info-text: #075985;

  /* Typography */
  --alf-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --alf-font-mono: 'JetBrains Mono', monospace;

  --alf-text-xs: 0.75rem;     /* 12px */
  --alf-text-sm: 0.875rem;    /* 14px */
  --alf-text-base: 1rem;      /* 16px */
  --alf-text-lg: 1.125rem;    /* 18px */
  --alf-text-xl: 1.25rem;     /* 20px */
  --alf-text-2xl: 1.5rem;     /* 24px */
  --alf-text-3xl: 1.875rem;   /* 30px */

  /* Spacing Scale */
  --alf-space-1: 4px;
  --alf-space-2: 8px;
  --alf-space-3: 12px;
  --alf-space-4: 16px;
  --alf-space-5: 20px;
  --alf-space-6: 24px;
  --alf-space-8: 32px;
  --alf-space-10: 40px;
  --alf-space-12: 48px;

  /* Layout */
  --alf-header-height: 64px;
  --alf-container-max: 1440px;
  --alf-radius-sm: 4px;
  --alf-radius-md: 6px;
  --alf-radius-lg: 8px;
  --alf-radius-xl: 12px; /* Slightly reduced for enterprise look */

  /* Effects */
  --alf-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --alf-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --alf-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --alf-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --alf-transition-fast: 150ms ease-in-out;
  --alf-transition-base: 200ms ease-in-out;
}

/* =========================================
   2. Reset & Base
   ========================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--alf-font-sans);
  background-color: var(--alf-white); /* Screenshot looks very clean/white */
  color: var(--alf-neutral-800);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  color: var(--alf-neutral-900);
}

a {
  color: var(--alf-brand-600);
  text-decoration: none;
  transition: color var(--alf-transition-fast);
}

a:hover {
  color: var(--alf-brand-700);
}

button {
  font-family: inherit;
}

/* =========================================
   3. Layout Components
   ========================================= */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: var(--alf-header-height);
}

.content-wrapper {
  width: 100%;
  max-width: var(--alf-container-max);
  margin: 0 auto;
  padding: var(--alf-space-6);
}

@media (min-width: 1024px) {
  .content-wrapper {
    padding: var(--alf-space-8);
  }
}

/* Dashboard Grid System */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--alf-space-6);
  align-items: start;
}

@media (min-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 2fr 1fr;
    gap: var(--alf-space-6); /* Slightly tighter gap */
  }
}

.dashboard-main, 
.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--alf-space-6);
}

/* =========================================
   4. Header & Navigation
   ========================================= */
.alf-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--alf-header-height);
  background-color: var(--alf-white);
  border-bottom: 1px solid var(--alf-neutral-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--alf-space-6);
  z-index: 100;
}

.alf-header-brand {
  display: flex;
  align-items: center;
  gap: var(--alf-space-2);
  font-weight: 700;
  font-size: var(--alf-text-lg);
  color: var(--alf-brand-600);
}

.alf-header-nav {
  display: none;
  gap: var(--alf-space-6);
  margin-left: var(--alf-space-8);
  flex: 1;
}

@media (min-width: 768px) {
  .alf-header-nav {
    display: flex;
  }
}

.alf-nav-link {
  color: var(--alf-neutral-500);
  font-weight: 500;
  font-size: var(--alf-text-sm);
  padding: var(--alf-space-2) 0;
  position: relative;
}

.alf-nav-link:hover {
  color: var(--alf-brand-600);
}

.alf-nav-link.active {
  color: var(--alf-brand-600);
}

.alf-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -21px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--alf-brand-600);
}

.alf-header-actions {
  display: flex;
  align-items: center;
  gap: var(--alf-space-3);
}

/* Search Bar */
.alf-search {
  position: relative;
  display: none;
}

@media (min-width: 768px) {
  .alf-search {
    display: block;
  }
}

.alf-search input {
  background-color: var(--alf-neutral-100);
  border: 1px solid transparent;
  border-radius: var(--alf-radius-md);
  padding: 6px var(--alf-space-3);
  padding-left: 32px;
  font-size: var(--alf-text-sm);
  color: var(--alf-neutral-900);
  width: 180px;
  transition: all var(--alf-transition-fast);
}

.alf-search::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background-color: var(--alf-neutral-400);
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>') no-repeat center;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>') no-repeat center;
  z-index: 1;
}

.alf-search input:focus {
  background-color: var(--alf-white);
  border-color: var(--alf-brand-400);
  outline: none;
  box-shadow: 0 0 0 2px var(--alf-brand-100);
}

/* =========================================
   5. Components: Cards (Dashlets)
   ========================================= */
.card {
  background: var(--alf-white);
  border-radius: var(--alf-radius-md); /* Sharper corners in screenshot */
  box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* Subtler shadow */
  border: 1px solid var(--alf-neutral-200);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.card:hover {
  box-shadow: var(--alf-shadow-md);
}

.card-header {
  padding: var(--alf-space-4) var(--alf-space-6);
  border-bottom: 1px solid var(--alf-neutral-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--alf-white);
}

.card-title {
  font-size: var(--alf-text-base);
  font-weight: 700;
  color: var(--alf-neutral-900);
}

.card-actions {
  display: flex;
  gap: var(--alf-space-2);
}

.card-body {
  padding: 0;
  flex: 1;
}

.card-footer {
  padding: var(--alf-space-3) var(--alf-space-6);
  background-color: var(--alf-white);
  border-top: none; /* Screenshot looks clean */
}

/* =========================================
   6. Components: Lists & Tables
   ========================================= */
.alf-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.alf-list-item {
  display: flex;
  align-items: flex-start;
  padding: var(--alf-space-4) var(--alf-space-6);
  border-bottom: 1px solid var(--alf-neutral-100);
  gap: var(--alf-space-4);
}

.alf-list-item:hover {
  background-color: var(--alf-neutral-50);
}

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

.alf-list-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--alf-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Icon Variants */
.icon-pdf { background-color: #fee2e2; color: #b91c1c; } /* Red */
.icon-doc { background-color: #dbeafe; color: #1d4ed8; } /* Blue */
.icon-xls { background-color: #dcfce7; color: #15803d; } /* Green */
.icon-img { background-color: #f3e8ff; color: #7e22ce; } /* Purple */

.alf-list-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alf-list-title {
  font-weight: 600;
  color: var(--alf-neutral-800);
  font-size: var(--alf-text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alf-list-title:hover {
  color: var(--alf-brand-600);
  text-decoration: underline;
}

.alf-list-meta {
  font-size: var(--alf-text-xs);
  color: var(--alf-neutral-500);
}

/* =========================================
   7. Components: Buttons
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--alf-space-4);
  height: 32px; /* Smaller buttons in enterprise apps */
  border-radius: var(--alf-radius-sm);
  font-weight: 600;
  font-size: var(--alf-text-sm);
  cursor: pointer;
  transition: all var(--alf-transition-fast);
  border: 1px solid transparent;
  gap: var(--alf-space-2);
  white-space: nowrap;
}

.btn-primary {
  background: var(--alf-brand-600);
  color: var(--alf-white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
  background: var(--alf-brand-700);
}

.btn-secondary {
  background: var(--alf-white);
  border-color: var(--alf-neutral-200);
  color: var(--alf-neutral-700);
}

.btn-secondary:hover {
  border-color: var(--alf-neutral-300);
  background: var(--alf-neutral-50);
}

.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--alf-neutral-400);
  background: transparent;
  border-radius: var(--alf-radius-sm);
  border: none;
}

.btn-icon:hover {
  background-color: var(--alf-neutral-100);
  color: var(--alf-neutral-900);
}

.btn-full {
  width: 100%;
}

/* =========================================
   8. Components: Utilities & Badges
   ========================================= */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-info { background-color: var(--alf-brand-100); color: var(--alf-brand-700); }
.badge-warning { background-color: var(--alf-warning-bg); color: var(--alf-warning-text); }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--alf-brand-600);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--alf-text-xs);
  font-weight: 600;
}

.placeholder-icon {
  width: 16px;
  height: 16px;
  background-color: currentColor;
  opacity: 0.5;
  border-radius: 2px;
}

/* Hero Section (UPDATED FOR PRESENTATION.CSS) */
.dashboard-hero {
  margin-bottom: var(--alf-space-6);
  display: flex;
  flex-direction: column;
  gap: var(--alf-space-4);
}

.welcome-banner {
  background-color: var(--alf-brand-700); /* The deep blue bar */
  color: var(--alf-white);
  padding: var(--alf-space-3) var(--alf-space-6);
  border-radius: var(--alf-radius-md); /* Consistent radius */
  display: flex;
  align-items: center;
  min-height: 48px;
}

.welcome-banner h1 {
  font-size: var(--alf-text-xl);
  font-weight: 600;
  color: var(--alf-white);
  margin: 0;
  background: none;
  -webkit-text-fill-color: initial;
}

.welcome-subtitle {
  color: var(--alf-neutral-500);
  font-size: var(--alf-text-base);
  margin: 0;
  padding-left: var(--alf-space-1);
}

/* =========================================
   9. Domain Components
   ========================================= */
.task-list {
  display: flex;
  flex-direction: column;
}

.task-item {
  padding: var(--alf-space-4) var(--alf-space-6);
  border-bottom: 1px solid var(--alf-neutral-100);
  background-color: var(--alf-white);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

.task-title {
  font-weight: 600;
  font-size: var(--alf-text-sm);
  color: var(--alf-neutral-900);
}

.task-meta {
  font-size: var(--alf-text-xs);
  color: var(--alf-neutral-500);
}

/* Spacing Utilities */
.mb-4 { margin-bottom: var(--alf-space-4); }
.mb-6 { margin-bottom: var(--alf-space-6); }
.w-full { width: 100%; }
