/* ══════════════════════════════════════════════════════════════
   WILLIAM'S THEME VARIABLES
   ══════════════════════════════════════════════════════════════ */
:root {
  --bg: #1c1c1e;
  --bg-2: #242426;
  --bg-3: #2a2a2e;
  --text: #b8b8bd;
  --bright: #e8e8ed;
  --muted: #5a5a60;
  --accent: #c8a46e;
  --accent-dim: #9a7a4e;
  --border: #2a2a2e;
  --border-mid: #3a3a3e;
  --alert: #c8a46e;
  --alert-bg: rgba(200, 164, 110, 0.1);
  
  --font-head: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;
  
  --radius: 8px;
  --sidebar-width: 300px;
}

/* ══════════════════════════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════════════════════════ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ══════════════════════════════════════════════════════════════
   ALERT BANNER
   ══════════════════════════════════════════════════════════════ */
.alert-banner {
  background: var(--alert-bg);
  border-bottom: 1px solid var(--accent);
  padding: 12px 24px;
  display: none;
}

.alert-banner.active {
  display: block;
}

.alert-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.alert-icon {
  font-size: 18px;
}

.alert-text {
  flex: 1;
  color: var(--bright);
  font-size: 14px;
}

.alert-actions {
  display: flex;
  gap: 8px;
}

.alert-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-body);
  transition: all 0.2s;
}

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

.alert-btn-clear {
  border-color: var(--border-mid);
  color: var(--muted);
}

.alert-btn-clear:hover {
  background: var(--bg-3);
  color: var(--text);
}

/* ══════════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════════ */
.dashboard-header {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.dashboard-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--bright);
  letter-spacing: -0.02em;
}

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

.header-btn {
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-body);
  transition: all 0.2s;
  position: relative;
}

.header-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.alert-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

.user-badge {
  background: var(--bg-3);
  border: 1px solid var(--border-mid);
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--bright);
  font-size: 13px;
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ══════════════════════════════════════════════════════════════ */
.dashboard-container {
  display: flex;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
}

.dashboard-main {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* ══════════════════════════════════════════════════════════════
   CARD COMPONENT
   ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* ══════════════════════════════════════════════════════════════
   TASK SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.task-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 60px;
  margin: 20px 0 20px 20px;
}

.task-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: color 0.2s;
}

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

.task-filters {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.task-search {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border-mid);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font-body);
  margin-bottom: 12px;
}

.task-search:focus {
  outline: none;
  border-color: var(--accent);
}

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

.filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.filter-label input[type="checkbox"] {
  accent-color: var(--accent);
}

.task-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 16px;
}

.task-category {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 20px 0 8px 0;
}

.task-category:first-child {
  margin-top: 0;
}

.task-item {
  padding: 10px;
  margin-bottom: 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.task-item:hover {
  background: var(--bg-3);
}

.task-item.completed {
  opacity: 0.5;
}

.task-checkbox {
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--muted);
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}

.task-due {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-due.overdue {
  color: var(--alert);
}

.task-subtasks {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
}

.task-reminder {
  color: var(--accent);
  font-size: 10px;
}

.task-sidebar-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-actions {
  display: flex;
  justify-content: space-around;
}

/* ══════════════════════════════════════════════════════════════
   SITES GRID
   ══════════════════════════════════════════════════════════════ */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.site-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.site-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.site-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.site-name {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--bright);
  letter-spacing: -0.02em;
}

.site-status {
  font-size: 20px;
}

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

.site-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--bright);
}

.stat-value.warning {
  color: var(--alert);
}

.site-alerts {
  background: var(--alert-bg);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--accent);
  margin-top: 12px;
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  background: var(--bg-3);
  border: 1px solid var(--border-mid);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 500;
  transition: all 0.2s;
}

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

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

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

.btn-secondary {
  background: transparent;
  border-color: var(--border-mid);
  color: var(--muted);
}

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

.btn-add {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border-mid);
  color: var(--accent);
}

.btn-add:hover {
  border-color: var(--accent);
  background: var(--alert-bg);
}

.btn-add-site {
  width: 100%;
  max-width: 400px;
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  text-align: left;
}

.btn-link:hover {
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════════════ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h2 {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--bright);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg-3);
  color: var(--accent);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--bright);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border-mid);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 14px;
  font-family: var(--font-body);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ══════════════════════════════════════════════════════════════
   ALERT LOG
   ══════════════════════════════════════════════════════════════ */
.alert-log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-log-item {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alert-log-item.resolved {
  opacity: 0.5;
  border-color: var(--border);
}

.alert-log-icon {
  font-size: 16px;
  margin-top: 2px;
}

.alert-log-content {
  flex: 1;
}

.alert-log-text {
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
}

.alert-log-meta {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.alert-log-status {
  color: var(--accent);
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .sites-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .dashboard-container {
    flex-direction: column;
  }
  
  .task-sidebar {
    width: 100%;
    max-height: none;
    position: relative;
    margin: 20px;
  }
  
  .dashboard-main {
    padding: 20px;
  }
}

@media (max-width: 600px) {
  .dashboard-header {
    padding: 12px 16px;
  }
  
  .dashboard-title {
    font-size: 16px;
  }
  
  .header-right {
    gap: 8px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════════
   FOCUS STYLES (ACCESSIBILITY)
   ══════════════════════════════════════════════════════════════ */
*:focus {
  outline: none;
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
