:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #273449;
  --border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --danger: #ef4444;
  --success: #22c55e;
  --warn: #f59e0b;
  --wa: #25d366;
  --wa-hover: #128c7e;
  --accent-purple: #8b5cf6;
  --accent-purple-2: #6366f1;
  --radius: 12px;
}

* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.full { width: 100%; }

.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  flex-shrink: 0;
  pointer-events: none;
}

.native-select-hidden { display: none !important; }

/* ======== CUSTOM SELECT ======== */
.custom-select { position: relative; display: inline-block; width: 100%; }
.custom-select .cs-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.2;
}
.custom-select .cs-trigger:hover { border-color: #475569; }
.custom-select.open .cs-trigger { border-color: var(--primary); box-shadow: 0 0 0 3px #3b82f655; }
.custom-select .cs-value { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.custom-select .cs-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s;
}
.custom-select.open .cs-arrow { transform: rotate(180deg); color: var(--primary); }
.custom-select .cs-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  max-height: 260px;
  overflow-y: auto;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s 0.15s;
  pointer-events: none;
}
.custom-select.open .cs-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s 0s;
  pointer-events: auto;
}
.custom-select .cs-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  font-family: inherit;
  transition: background 0.12s;
  position: relative;
}
.custom-select .cs-option:hover,
.custom-select .cs-option:focus { background: var(--surface-2); outline: none; }
.custom-select .cs-option.selected {
  background: linear-gradient(135deg, #8b5cf622, #6366f122);
  color: #a78bfa;
  font-weight: 600;
}
.custom-select .cs-option.selected::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 5px;
  height: 9px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
}
.toolbar .custom-select { flex: 0 0 auto; width: auto; min-width: 160px; }
.task-input-row .custom-select { flex-shrink: 0; width: auto; min-width: 110px; }
.task-filter-row .custom-select { flex: 1; min-width: 0; width: auto; }

/* ======== LOGIN ======== */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background:
    radial-gradient(circle at 20% 20%, #1e3a8a55, transparent 60%),
    radial-gradient(circle at 80% 80%, #7c3aed44, transparent 60%),
    var(--bg);
}
.login-card {
  background: var(--surface);
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-card form { display: flex; flex-direction: column; gap: 0.75rem; }

input, select, textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px #3b82f655;
}
input[type="time"], input[type="date"] {
  font-variant-numeric: tabular-nums;
}
label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.6rem;
  margin-bottom: 0.3rem;
}

.btn {
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); color: white; }
.btn.danger:hover { background: #dc2626; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.75rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.8rem;
}
.brand-block h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.brand-block.small { flex-direction: row; align-items: center; gap: 0.7rem; margin-bottom: 0; flex-wrap: wrap; }
.brand-block.small h1 { font-size: 1.3rem; }
.brand-block.small #user-email { margin-left: 0.4rem; padding-left: 0.7rem; border-left: 1px solid var(--border); }

.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 164px;
  height: 64px;
  padding-bottom: 10px;
  border-radius: 16px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.logo-wrap::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 22px;
  z-index: -1;
  opacity: 0.6;
  pointer-events: none;
}
.logo-wrap.small { padding-top: 8px; width: 80px; height: 50px; }
.logo-wrap.small::after { display: none; }
.logo { width: 100%; height: 100%; display: block; object-fit: contain; border-radius: inherit; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 1rem;
}
.topbar-actions { display: flex; gap: 0.5rem; }

.container { padding: 2rem; max-width: 1200px; margin: 0 auto; }

/* ======== INFO BAR ======== */
.info-bar {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1rem;
  align-items: stretch;
  flex-wrap: wrap;
}
.info-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
}
.info-bubble-clock {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
  min-width: 280px;
  flex: 0 0 auto;
}
.info-clock-main { display: flex; align-items: baseline; gap: 0.4rem; line-height: 1; }
.info-clock-time {
  font-size: clamp(2.6rem, 5.5vw, 3.8rem);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.info-clock-tz { font-size: 0.78rem; font-weight: 700; color: var(--muted); letter-spacing: 0.08em; }
.info-clock-detail { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: nowrap; }
.info-date {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.2;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.info-weather {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-shrink: 0;
}
.info-weather-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warn);
  flex-shrink: 0;
}
.info-weather-icon .icon { width: 20px; height: 20px; }
.info-weather-temp { font-size: 1rem; font-weight: 800; color: var(--text); line-height: 1; font-variant-numeric: tabular-nums; }

.info-bubble-prayer {
  flex: 1;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  justify-content: center;
}
.info-prayer-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  line-height: 1.2;
}
.info-prayer-loc { color: var(--muted); font-weight: 600; }
.info-prayer-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.45rem; }
.info-prayer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.6rem 0.4rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.info-prayer-item .prayer-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
}
.info-prayer-item .prayer-time {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.info-prayer-item.active {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-2));
  border-color: transparent;
  box-shadow: 0 3px 10px #8b5cf640;
}
.info-prayer-item.active .prayer-name,
.info-prayer-item.active .prayer-time { color: white; }

/* ======== CONTACTS ======== */
.contacts-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 1.25rem;
  transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.contacts-panel.minimized { padding: 0.55rem 1rem; }
.contacts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
  transition: margin-bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.contacts-panel.minimized .contacts-header { margin-bottom: 0; }
.contacts-title { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; min-width: 0; }
.contacts-title .icon { width: 13px; height: 13px; color: var(--muted); }
.contacts-title h2 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0;
}
.contacts-mini-icons { display: none; align-items: center; gap: 0.28rem; flex-wrap: wrap; margin-left: 0.35rem; }
.contacts-panel.minimized .contacts-mini-icons { display: flex; }
.contacts-mini-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  flex-shrink: 0;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
  cursor: pointer;
}
.contacts-mini-icon .icon { width: 12px; height: 12px; }
.contacts-mini-icon:hover { transform: scale(1.12); }
.contacts-mini-icon[data-platform="whatsapp"] { background: #25d36622; color: #25d366; }
.contacts-mini-icon[data-platform="instagram"] { background: #e1306c22; color: #e1306c; }
.contacts-mini-icon[data-platform="telegram"] { background: #26a5e422; color: #26a5e4; }
.contacts-mini-icon[data-platform="twitter"] { background: #ffffff18; color: var(--text); }
.contacts-mini-icon[data-platform="github"] { background: #ffffff18; color: var(--text); }
.contacts-mini-icon[data-platform="facebook"] { background: #1877f222; color: #1877f2; }
.contacts-mini-icon[data-platform="linkedin"] { background: #0a66c222; color: #0a66c2; }
.contacts-mini-icon[data-platform="tiktok"] { background: #ffffff18; color: var(--text); }
.contacts-mini-icon[data-platform="youtube"] { background: #ff000022; color: #ff0000; }
.contacts-mini-icon[data-platform="email"] { background: #ea433522; color: #ea4335; }
.contacts-mini-icon[data-platform="generic"] { background: #3b82f622; color: var(--primary); }

.contacts-header-actions { display: flex; align-items: center; gap: 0.4rem; }
.contacts-toggle {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
  padding: 0;
}
.contacts-toggle .icon { width: 16px; height: 16px; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.contacts-toggle:hover { background: var(--surface-2); border-color: var(--primary); color: var(--primary); }
.contacts-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }

.contacts-body {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}
.contacts-body-inner {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.contacts-panel.minimized .contacts-body { grid-template-rows: 0fr; opacity: 0; }

.contacts-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.35rem 0.2rem 0.2rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  max-width: 100%;
  min-width: 0;
  transition: border-color 0.15s, background 0.15s;
}
.contact-item:hover { border-color: var(--primary); background: #273449; }
.contact-item[data-platform="whatsapp"]:hover { border-color: var(--wa); }
.contact-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
}
.contact-icon .icon { width: 12px; height: 12px; }
.contact-item[data-platform="whatsapp"] .contact-icon { background: #25d36622; color: #25d366; }
.contact-item[data-platform="instagram"] .contact-icon { background: #e1306c22; color: #e1306c; }
.contact-item[data-platform="telegram"] .contact-icon { background: #26a5e422; color: #26a5e4; }
.contact-item[data-platform="twitter"] .contact-icon { background: #ffffff18; color: var(--text); }
.contact-item[data-platform="github"] .contact-icon { background: #ffffff18; color: var(--text); }
.contact-item[data-platform="facebook"] .contact-icon { background: #1877f222; color: #1877f2; }
.contact-item[data-platform="linkedin"] .contact-icon { background: #0a66c222; color: #0a66c2; }
.contact-item[data-platform="tiktok"] .contact-icon { background: #ffffff18; color: var(--text); }
.contact-item[data-platform="youtube"] .contact-icon { background: #ff000022; color: #ff0000; }
.contact-item[data-platform="email"] .contact-icon { background: #ea433522; color: #ea4335; }
.contact-item[data-platform="generic"] .contact-icon { background: #3b82f622; color: var(--primary); }

.contact-info { display: flex; align-items: baseline; gap: 0.3rem; min-width: 0; flex: 1; }
.contact-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  flex-shrink: 0;
}
.contact-label::after { content: "·"; margin-left: 0.2rem; margin-right: 0.1rem; color: var(--border); }
.contact-value {
  font-size: 0.78rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.contact-actions {
  display: flex;
  gap: 1px;
  margin-left: 0.1rem;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.contact-item:hover .contact-actions { opacity: 1; }
.contact-actions button,
.contact-actions a {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  font-family: inherit;
  padding: 0;
}
.contact-actions .icon { width: 11px; height: 11px; }
.contact-actions button:hover,
.contact-actions a:hover { background: var(--surface); color: var(--text); }
.contact-actions .act-share:hover { background: #25d36622; color: var(--wa); }
.contact-actions .act-wa:hover { background: var(--wa); color: white; }

.contacts-empty {
  text-align: center;
  padding: 0.9rem 0.8rem;
  color: var(--muted);
  font-size: 0.82rem;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.contacts-hint { margin-bottom: 0.9rem; line-height: 1.4; }

.contact-edit-row { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.5rem; }
.contact-edit-row input { flex: 1; min-width: 0; }
.contact-edit-row .contact-remove {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
}
.contact-edit-row .contact-remove .icon { width: 16px; height: 16px; }
.contact-edit-row .contact-remove:hover { background: var(--danger); color: white; border-color: var(--danger); }
.add-contact-btn {
  margin-top: 0.4rem;
  margin-bottom: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.add-contact-btn .icon { width: 16px; height: 16px; }

/* ======== MAIN TABS ======== */
.main-tabs {
  position: relative;
  display: flex;
  gap: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.35rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  max-width: 340px;
}
.task-tabs {
  position: relative;
  display: flex;
  gap: 0.35rem;
  background: var(--surface-2);
  padding: 0.3rem;
  border-radius: 999px;
  margin-bottom: 1.2rem;
  max-width: 100%;
  overflow-x: auto;
}
.tab-indicator {
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  left: 0;
  width: 0;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-purple-2));
  border-radius: 999px;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s ease;
  box-shadow: 0 4px 12px #8b5cf640;
  will-change: transform, width;
}
.task-tabs .tab-indicator { top: 0.3rem; bottom: 0.3rem; }

.main-tab {
  position: relative;
  z-index: 1;
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease;
  font-family: inherit;
}
.main-tab:hover:not(.active) { color: var(--text); }
.main-tab.active { background: transparent; color: white; box-shadow: none; }

.task-tab-btn {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 90px;
  border: none;
  background: transparent;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}
.task-tab-btn:hover:not(.active) { color: var(--text); }
.task-tab-btn.active { background: transparent; color: white; box-shadow: none; }

.tab-panel:not(.hidden) { animation: tabSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
.task-panel:not(.hidden) { animation: tabSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes tabSlideIn {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ======== TOOLBAR / CARDS ======== */
.toolbar { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.toolbar input { flex: 1; min-width: 200px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: transform 0.15s, border-color 0.15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--primary); }
.card-header { display: flex; justify-content: space-between; align-items: start; gap: 0.5rem; }
.card-title { font-size: 1.05rem; font-weight: 700; word-break: break-word; line-height: 1.3; }
.card-url {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  word-break: break-all;
  line-height: 1.4;
  padding: 0.35rem 0.5rem;
  background: var(--surface-2);
  border-radius: 6px;
  border: 1px solid var(--border);
  max-height: 2.4em;
  overflow: hidden;
}
.badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.badge.active { background: #22c55e22; color: var(--success); }
.badge.wip { background: #f59e0b22; color: var(--warn); }
.badge.archived { background: #64748b33; color: var(--muted); }
.card-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-primary { display: flex; gap: 0.5rem; margin-top: 0.2rem; align-items: stretch; }
.card-primary .btn-open,
.card-primary .btn-copy,
.card-primary .btn-wa {
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 40px;
  text-decoration: none;
}
.card-primary .btn-open {
  flex: 1;
  min-width: 0;
  padding: 0 0.7rem;
  background: var(--primary);
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-primary .btn-open:hover { background: var(--primary-hover); }
.card-primary .btn-open .icon,
.card-primary .btn-copy .icon,
.card-primary .btn-wa .icon { width: 18px; height: 18px; }
.card-primary .btn-copy,
.card-primary .btn-wa { flex: 0 0 40px; width: 40px; padding: 0; }
.card-primary .btn-copy { background: transparent; color: var(--text); border-color: var(--border); }
.card-primary .btn-copy:hover { background: var(--surface-2); border-color: var(--primary); color: var(--primary); }
.card-primary .btn-copy.copied { background: #22c55e22; border-color: var(--success); color: var(--success); }
.card-primary .btn-wa { background: #25d36620; color: var(--wa); border-color: var(--wa); }
.card-primary .btn-wa:hover { background: var(--wa); color: white; border-color: var(--wa); }

.card-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}
.card-actions button {
  flex: 1;
  padding: 0.4rem;
  font-size: 0.78rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.card-actions .icon { width: 14px; height: 14px; }
.card-actions button:hover { background: var(--surface-2); color: var(--text); }
.card-actions .edit:hover { color: var(--primary); border-color: var(--primary); }
.card-actions .del:hover { color: var(--danger); border-color: var(--danger); }

.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.error { color: var(--danger); font-size: 0.85rem; margin-top: 0.8rem; min-height: 1.2em; }

/* ======== TASK APP ======== */
.task-app {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}
.calendar-controls { display: flex; justify-content: flex-end; margin-bottom: 0.6rem; }
#calendar-mode-btn { display: inline-flex; align-items: center; gap: 0.4rem; }
#calendar-mode-icon { display: inline-block; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
#calendar-mode-btn[aria-expanded="true"] #calendar-mode-icon { transform: rotate(180deg); }

.task-calendar-wrap { margin-bottom: 0.8rem; overflow: hidden; }
.task-calendar { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 0.8rem; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.7rem; }
.calendar-month { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.calendar-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
  flex-shrink: 0;
}
.calendar-nav:hover { background: var(--primary); color: white; border-color: var(--primary); }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.2rem; margin-bottom: 0.3rem; }
.calendar-weekdays span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  padding: 0.25rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.2rem; }
.calendar-day {
  min-height: 42px;
  max-height: 72px;
  height: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  transition: all 0.15s;
  border: 1px solid transparent;
  position: relative;
  user-select: none;
}
.calendar-day:hover { background: var(--surface); border-color: var(--border); }
.calendar-day.other-month { opacity: 0.25; cursor: default; pointer-events: none; }
.calendar-day.today { border-color: var(--primary); color: var(--primary); font-weight: 700; }
.calendar-day.selected { background: var(--primary); color: white; font-weight: 700; box-shadow: 0 3px 10px #3b82f640; }
.calendar-day.has-task::after {
  content: "";
  position: absolute;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
}
.calendar-day.today.has-task::after,
.calendar-day.selected.has-task::after { background: white; }

.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem;
  margin-bottom: 0.9rem;
}
.date-nav-title { font-weight: 700; font-size: 0.88rem; text-align: center; flex: 1; color: var(--text); }

.progress-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; }
.progress-bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}
.progress-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 60px;
  text-align: right;
}

.task-input-row { display: flex; gap: 0.5rem; margin-bottom: 0.7rem; flex-wrap: wrap; align-items: center; }
.task-input-row input[type="text"] { flex: 1 1 200px; min-width: 0; }
.task-input-row .btn { flex-shrink: 0; }
.task-input-row .task-time-input { flex: 0 0 auto; width: auto; min-width: 110px; }

.task-filter-row { display: flex; gap: 0.5rem; margin-bottom: 0.9rem; }

.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 4px;
}
.task-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--surface-2);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  animation: taskItemIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes taskItemIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.task-item:hover { border-color: var(--primary); }
.task-item.completed { opacity: 0.7; }
.task-item.completed .task-text { text-decoration: line-through; color: var(--muted); }

/* ====== SHADOW (current day, carried from previous) ====== */
.task-item.task-shadow {
  background: linear-gradient(135deg, #8b5cf60a, #6366f10a);
  border-color: #8b5cf640;
}
.task-item.task-shadow:hover {
  border-color: #8b5cf6;
}

/* ====== HISTORY (original day, task completed after moving) ====== */
.task-item.task-history {
  opacity: 0.55;
  background: transparent;
  border-style: dashed;
  animation: none;
}
.task-item.task-history:hover {
  opacity: 0.75;
  border-color: var(--border);
  border-style: dashed;
}
.task-item.task-history .task-checkbox {
  cursor: not-allowed;
}
.task-item.task-history .task-text {
  color: var(--muted);
}

.task-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  background: var(--surface);
  position: relative;
  margin: 0;
  padding: 0;
}
.task-checkbox:hover:not(:disabled) { border-color: var(--primary); }
.task-checkbox:checked { background: var(--primary); border-color: var(--primary); }
.task-checkbox:checked::after {
  content: "";
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.task-content { flex: 1; display: flex; align-items: center; gap: 0.5rem; min-width: 0; flex-wrap: wrap; }
.task-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
.task-text:hover { color: var(--primary); }
.task-item.task-history .task-text:hover { color: var(--muted); cursor: default; }
.task-meta { display: flex; gap: 0.3rem; flex-shrink: 0; flex-wrap: wrap; align-items: center; }

.badge-mudah { background: #22c55e22; color: var(--success); }
.badge-sedang { background: #f59e0b22; color: var(--warn); }
.badge-sulit { background: #ef444422; color: var(--danger); }

.task-delay-info {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  background: #f59e0b22;
  color: var(--warn);
  white-space: nowrap;
  line-height: 1.2;
}
.task-delay-info .icon { width: 10px; height: 10px; }

.task-time-info {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  background: #3b82f622;
  color: var(--primary);
  white-space: nowrap;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.task-time-info .icon { width: 10px; height: 10px; }

.task-history-info {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  background: #64748b22;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.2;
}
.task-history-info .icon { width: 10px; height: 10px; }

.task-item .btn-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
  padding: 0;
}
.task-item .btn-icon .icon { width: 14px; height: 14px; }
.task-item .btn-icon:hover { background: var(--surface); border-color: var(--border); color: var(--text); }
.task-item .btn-icon.edit:hover { color: var(--primary); border-color: var(--primary); }
.task-item .btn-icon.del:hover { color: var(--danger); border-color: var(--danger); }
.task-item .btn-icon.move:hover { color: var(--warn); border-color: var(--warn); }

.task-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.monthly-summary { max-height: 600px; overflow-y: auto; padding-right: 4px; }
.monthly-day-group { margin-bottom: 1rem; }
.monthly-day-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  padding: 0.4rem 0.6rem;
  background: var(--surface-2);
  border-radius: 8px;
  margin-bottom: 0.4rem;
  border: 1px solid var(--border);
}
.monthly-task-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface-2);
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  margin-bottom: 0.3rem;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  flex-wrap: wrap;
}
.monthly-task-item:hover { border-color: var(--primary); background: var(--surface); }
.monthly-task-item.completed .task-text { text-decoration: line-through; color: var(--muted); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.7rem; margin-bottom: 1rem; }
.stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
}
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stats-detail { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; margin-bottom: 0.7rem; }
.stats-detail h3 { font-size: 0.95rem; margin-bottom: 0.7rem; color: var(--text); }
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}
.stat-row:last-child { border-bottom: none; }
.stat-row span:last-child { font-weight: 700; color: var(--text); }

/* ======== MODAL ======== */
.modal {
  position: fixed;
  inset: 0;
  background: #000000aa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.2s ease;
}
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalCardIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalCardIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-card h2 { margin-bottom: 0.5rem; font-size: 1.2rem; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.2rem; }
.task-delete-text {
  font-weight: 600;
  color: var(--text);
  padding: 0.6rem 0.8rem;
  background: var(--surface-2);
  border-radius: 8px;
  margin-top: 0.6rem;
  word-break: break-word;
}
.task-move-text {
  font-weight: 600;
  color: var(--text);
  padding: 0.6rem 0.8rem;
  background: var(--surface-2);
  border-radius: 8px;
  margin-bottom: 0.4rem;
  word-break: break-word;
  font-size: 0.9rem;
}
.task-move-hint { margin-bottom: 0.5rem; line-height: 1.4; }

/* ======== TOAST ======== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  color: var(--text);
  padding: 0.75rem 1.2rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  max-width: calc(100% - 2rem);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* ======== RESPONSIVE ======== */
@media (max-width: 760px) {
  .info-bar { flex-direction: column; }
  .info-bubble-clock,
  .info-bubble-prayer { width: 100%; min-width: 0; }
}

@media (max-width: 640px) {
  .topbar { padding: 1rem; }
  .container { padding: 1rem; }
  .info-bubble { padding: 0.85rem 0.95rem; }
  .info-clock-time { font-size: 2.6rem; }
  .info-date { font-size: 0.75rem; }
  .info-weather-icon { width: 22px; height: 22px; }
  .info-weather-icon .icon { width: 18px; height: 18px; }
  .info-weather-temp { font-size: 0.92rem; }
  .info-prayer-list { gap: 0.3rem; }
  .info-prayer-item { padding: 0.5rem 0.25rem; border-radius: 8px; }
  .info-prayer-item .prayer-name { font-size: 0.6rem; }
  .info-prayer-item .prayer-time { font-size: 0.92rem; }
  .toolbar { flex-direction: column; }
  .toolbar .custom-select { width: 100%; min-width: 0; }
  .contacts-panel { padding: 0.75rem 0.85rem; }
  .contacts-panel.minimized { padding: 0.5rem 0.85rem; }
  .contact-value { max-width: 130px; }
  .contact-actions { opacity: 1; }
  .main-tabs { max-width: 100%; }
  .main-tab { font-size: 0.85rem; padding: 0.5rem 0.7rem; }
  .task-app { padding: 0.9rem; }
  .card-primary .btn-open { font-size: 0.8rem; padding: 0 0.5rem; }
  .task-input-row { flex-direction: column; align-items: stretch; }
  .task-input-row input[type="text"],
  .task-input-row .btn,
  .task-input-row .custom-select,
  .task-input-row .task-time-input { width: 100%; min-width: 0; }
  .task-item { flex-wrap: wrap; }
  .task-content { flex-wrap: wrap; }
  .task-text { flex: 1 0 100%; }
  .task-meta { order: -1; }
  .calendar-day { font-size: 0.78rem; min-height: 36px; max-height: 60px; }
}

@media (max-width: 420px) {
  .card-primary { flex-wrap: wrap; }
  .card-primary .btn-open { flex: 1 1 100%; }
  .card-primary .btn-copy,
  .card-primary .btn-wa { flex: 1 1 0; width: auto; }
  .contact-value { max-width: 110px; }
  .task-tab-btn { font-size: 0.78rem; }
  .task-tabs { overflow-x: auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 1.4rem; }
  .calendar-day { font-size: 0.72rem; min-height: 32px; max-height: 52px; }
  .contacts-mini-icon { width: 20px; height: 20px; }
  .contacts-mini-icon .icon { width: 11px; height: 11px; }
  .info-clock-time { font-size: 2.2rem; }
  .info-date { font-size: 0.7rem; }
  .info-prayer-item .prayer-name { font-size: 0.55rem; }
  .info-prayer-item .prayer-time { font-size: 0.85rem; }
}