:root {
  /* Colors - Modern Dark Theme */
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --border-color: #334155;

  /* Priority Colors */
  --priority-high: #ef4444;
  --priority-medium: #f59e0b;
  --priority-low: #3b82f6;

  /* Shadows & Effects */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 15px rgba(59, 130, 246, 0.5);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* =========================================
   Layout & Common
   ========================================= */

.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

.hidden {
  display: none !important;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-primary-hover);
}

/* =========================================
   Buttons & Inputs
   ========================================= */

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: white;
}

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

.btn-success {
  background-color: var(--accent-success);
  color: white;
}

.btn-danger {
  background-color: var(--accent-danger);
  color: white;
}

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

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-card-hover);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background-color: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.875rem;
  transition: border-color var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* =========================================
   Login Page
   ========================================= */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.login-container {
  width: 100%;
  max-width: 800px;
  padding: 2rem;
  text-align: center;
}

.login-header {
  margin-bottom: 3rem;
}

.login-header h1 {
  font-size: 3rem;
  background: linear-gradient(to right, #3b82f6, #10b981);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

.members-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.member-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 180px;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.member-card:hover {
  transform: translateY(-5px);
  background-color: var(--bg-card-hover);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}

.member-avatar {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.member-avatar-big {
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.member-name {
  font-size: 1.25rem;
  font-weight: 600;
}

.member-role {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* PIN Keypad */
.pin-display {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.pin-dot {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-color);
  background-color: transparent;
  transition: all var(--transition-fast);
}

.pin-dot.filled {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 300px;
  margin: 0 auto;
}

.pin-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-full);
  background-color: var(--bg-card-hover);
  color: var(--text-main);
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.pin-btn:hover {
  background-color: var(--accent-primary);
}

.pin-btn:active {
  transform: scale(0.95);
}

.pin-btn.text-btn {
  font-size: 1rem;
  font-weight: 600;
}

/* =========================================
   Display Kiosk Mode
   ========================================= */

.display-page {
  padding: 2rem;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.display-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.display-time {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.display-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  flex: 1;
  overflow: hidden;
}

.display-col {
  flex: 1;
  min-width: 300px;
  background-color: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

.display-col h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.items-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-right: 0.5rem;
}

/* Item Cards */
.item-card {
  background-color: var(--bg-dark);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-left: 4px solid var(--border-color);
}

.item-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.item-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.badge {
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--bg-card-hover);
}

.badge-high {
  color: var(--priority-high);
  border: 1px solid var(--priority-high);
}

.badge-medium {
  color: var(--priority-medium);
  border: 1px solid var(--priority-medium);
}

.badge-low {
  color: var(--priority-low);
  border: 1px solid var(--priority-low);
}

/* =========================================
   Modals
   ========================================= */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

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

/* =========================================
   Admin Panel Tables
   ========================================= */

.panel {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-top: 1.5rem;
}

.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.text-success {
  color: var(--accent-success);
  font-weight: 600;
}

.text-warning {
  color: var(--accent-warning);
  font-weight: 600;
}

.header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

/* =========================================
   Due Date Highlights
   ========================================= */

.due-overdue {
  color: var(--accent-danger);
  font-weight: 700;
}

.due-urgent {
  color: #f97316;
  font-weight: 700;
}

/* orange - < 3 days */
.due-warning {
  color: var(--accent-warning);
  font-weight: 600;
}

.due-ok {
  color: var(--text-main);
}

.due-none {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 400;
}

/* =========================================
   Toast Notifications
   ========================================= */

.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  min-width: 250px;
  max-width: 380px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: toastIn 0.3s ease, toastOut 0.4s ease 2.6s forwards;
  pointer-events: all;
  font-size: 0.9rem;
}

.toast-success {
  border-left: 4px solid var(--accent-success);
}

.toast-error {
  border-left: 4px solid var(--accent-danger);
}

.toast-info {
  border-left: 4px solid var(--accent-primary);
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* =========================================
   Avatar Selectors
   ========================================= */

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.avatar-option {
  font-size: 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.25rem;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.avatar-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.avatar-option.selected {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
}

/* =========================================
   Recurring Task Badge
   ========================================= */

.badge-recurring {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =========================================
   History Panel
   ========================================= */

.history-entry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.875rem;
}

.history-entry:last-child {
  border-bottom: none;
}

.history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent-primary);
}

.history-dot.done {
  background: var(--accent-success);
}

.history-dot.reverted {
  background: var(--accent-warning);
}

/* =========================================
   THEME: Minecraft
   ========================================= */
.theme-minecraft .panel,
.theme-minecraft .modal-content,
.theme-minecraft .task-card,
.theme-minecraft .member-card { border-radius: 0 !important; }

.theme-minecraft .btn {
  border-radius: 2px !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  border-bottom: 3px solid rgba(0,0,0,0.4);
}

.theme-minecraft .panel {
  border: 2px solid var(--accent-primary);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.6);
}

.theme-minecraft .sidebar { border-right: 3px solid var(--accent-primary); }

.theme-minecraft h1, .theme-minecraft h2, .theme-minecraft h3 {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.theme-minecraft .nav-btn.active {
  border-left: 4px solid var(--accent-primary);
  background: rgba(90,160,44,0.15);
  color: #74d43a;
  border-radius: 0;
}

/* =========================================
   THEME: Roblox
   ========================================= */
.theme-roblox .btn {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

.theme-roblox .panel { border-top: 3px solid var(--accent-primary); }

.theme-roblox .nav-btn.active {
  border-left: 4px solid var(--accent-primary);
  background: rgba(233,41,41,0.1);
  color: var(--accent-primary);
}

/* =========================================
   THEME: Space (default)
   ========================================= */
.theme-space .nav-btn.active {
  border-left: 3px solid #7c3aed;
  background: rgba(124,58,237,0.12);
  color: #a78bfa;
}

/* Theme Picker Cards */
.theme-cards { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.theme-card {
  width: 148px; padding: 1rem; border-radius: var(--radius-md);
  border: 2px solid var(--border-color); cursor: pointer;
  background: var(--bg-card); text-align: center;
  transition: all 0.2s ease;
}
.theme-card:hover { transform: translateY(-2px); border-color: var(--accent-primary); }
.theme-card.active { border-color: var(--accent-primary); }
.theme-card-preview {
  height: 60px; border-radius: 4px; margin-bottom: 0.75rem;
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
}
.theme-card-name { font-weight: 600; font-size: 0.85rem; }
.theme-card.active .theme-card-name { color: var(--accent-primary); }
