:root {
  /* Color Palette - Modern Dark */
  --primary-color: #60a5fa;
  /* Blue 400 */
  --primary-hover: #3b82f6;
  /* Blue 500 */
  --bg-page: #0f172a;
  /* Slate 900 */
  --bg-surface: #1e293b;
  /* Slate 800 */
  --bg-item: rgba(30, 41, 59, 0.5);
  /* Semi-transparent Slate 800 */
  --bg-item-hover: #1e293b;
  /* Solid Slate 800 */

  --text-main: #f8fafc;
  /* Slate 50 */
  --text-secondary: #94a3b8;
  /* Slate 400 */
  --text-on-primary: #0f172a;
  /* Dark text on bright button */

  --border-color: #334155;
  /* Slate 700 */
  --focus-ring: rgba(96, 165, 250, 0.4);

  --btn-hover-bg: #334155;
  /* Slate 700 */
  --btn-hover-border: #475569;
  /* Slate 600 */

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.2);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.2);

  /* Radius */
  --radius-card: 16px;
  --radius-input: 8px;

  /* Spacing */
  --spacing-md: 1.5rem;
}

[data-theme="light"] {
  --primary-color: #2563eb;
  /* Blue 600 */
  --primary-hover: #1d4ed8;
  /* Blue 700 */
  --bg-page: #f1f5f9;
  /* Slate 100 for better container framing */
  --bg-surface: #ffffff;
  /* White */
  --bg-item: #f8fafc;
  /* Slate 50 for cards inner content */
  --bg-item-hover: #ffffff;
  /* White on hover */

  --text-main: #0f172a;
  /* Slate 900 */
  --text-secondary: #475569;
  /* Slate 600 */
  --text-on-primary: #ffffff;

  --border-color: #cbd5e1;
  /* Slate 300 for clearer divisions */
  --focus-ring: rgba(37, 99, 235, 0.4);

  --btn-hover-bg: #f8fafc;
  /* Slate 50 */
  --btn-hover-border: #94a3b8;
  /* Slate 400 */

  /* Light Mode optimized soft shadows */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}


/* Base Body Style for Modern Pages */
body.modern-body {
  background-color: var(--bg-page);
  background-image: none !important;
  /* Override legacy dashboard.css gradients */
  color: var(--text-main);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

/* Modern Card */
.card-modern {
  background-color: var(--bg-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-md);
  border: 1px solid var(--border-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-left-color 0.2s ease;
  position: relative;
}

/* Priority Colors Support */
body.priority-colors-enabled .card-modern.priority-alta {
  border-left: 8px solid #ef4444;
  /* Red 500 */
  background: linear-gradient(to right, rgba(239, 68, 68, 0.1), var(--bg-surface) 15%);
}

body.priority-colors-enabled .card-modern.priority-media {
  border-left: 8px solid #f97316;
  /* Orange 500 */
  background: linear-gradient(to right, rgba(249, 115, 22, 0.1), var(--bg-surface) 15%);
}

body.priority-colors-enabled .card-modern.priority-baja {
  border-left: 8px solid #22c55e;
  /* Green 500 */
  background: linear-gradient(to right, rgba(34, 197, 94, 0.1), var(--bg-surface) 15%);
}

.card-modern:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-modern h3 {
  margin-top: 0;
  color: var(--text-main);
  font-size: 1.25rem;
  font-weight: 600;
}

.card-modern p {
  color: var(--text-secondary);
}

/* Modern Forms */
.form-control-modern {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  /* Finger friendly padding */
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-input);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control-modern:focus {
  outline: 0;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Buttons */
.btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  /* Finger friendly */
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-input);
  cursor: pointer;
  transition: all 0.2s;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  text-decoration: none;
}

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

.btn-modern-primary {
  background-color: var(--primary-color);
  color: var(--text-on-primary);
  border: 1px solid transparent;
  font-weight: 600;
}

.btn-modern-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: var(--shadow-lg);
  color: var(--text-on-primary);
}

/* Utility for demonstrating grid layout */
.modern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem;
}