/* ===================================================
   Dev Task Tracker — Frontend CSS  v1.1
   =================================================== */

.dtt-wrap * { box-sizing: border-box; }

.dtt-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
  color: #1e293b;
}

/* ── Notice ─────────────────────────────────────── */
.dtt-notice {
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 24px; text-align: center; color: #64748b;
}

/* ── Header ──────────────────────────────────────── */
.dtt-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.dtt-header-left    { display: flex; align-items: center; gap: 12px; }
.dtt-header-actions { display: flex; align-items: center; gap: 8px; }
.dtt-title    { margin: 0; font-size: 1.45rem; font-weight: 700; color: #0f172a; }
.dtt-subtitle { margin: 2px 0 0; font-size: 0.83rem; color: #64748b; }

/* ── Buttons ─────────────────────────────────────── */
.dtt-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: none;
  cursor: pointer; font-size: 14px; font-weight: 500;
  transition: all .15s; line-height: 1; white-space: nowrap;
}
.dtt-btn-primary   { background: #6366f1; color: #fff; }
.dtt-btn-primary:hover { background: #4f46e5; transform: translateY(-1px); box-shadow: 0 4px 12px #6366f140; }
.dtt-btn-secondary { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.dtt-btn-secondary:hover { background: #e2e8f0; }
.dtt-btn-ghost  { background: transparent; color: #64748b; border: 1px solid #e2e8f0; }
.dtt-btn-ghost:hover { background: #f8fafc; color: #334155; border-color: #cbd5e1; }
.dtt-btn-danger { background: #ef4444; color: #fff; }
.dtt-btn-danger:hover { background: #dc2626; }
.dtt-btn-icon {
  padding: 6px 8px; background: transparent; color: #94a3b8;
  border: none; cursor: pointer; border-radius: 6px; line-height: 0;
}
.dtt-btn-icon:hover        { background: #f1f5f9; color: #475569; }
.dtt-btn-icon-danger:hover { background: #fee2e2; color: #ef4444; }

/* ── Filters ─────────────────────────────────────── */
.dtt-filters {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 12px; padding: 14px 18px; margin-bottom: 18px;
}
.dtt-filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.dtt-filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.dtt-filter-group label {
  font-size: 10px; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .06em;
}
.dtt-filter-group select,
.dtt-filter-group input[type="date"] {
  border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 7px 10px; font-size: 13px; color: #334155;
  background: #f8fafc; outline: none; transition: border-color .15s;
}
.dtt-filter-group select:focus,
.dtt-filter-group input:focus { border-color: #6366f1; background: #fff; box-shadow: 0 0 0 3px #6366f115; }
.dtt-filter-actions { flex-direction: row !important; align-items: center; gap: 6px; padding-top: 14px; }

/* ── Summary cards ───────────────────────────────── */
.dtt-summary-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px;
}
.dtt-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px 20px;
}
.dtt-card-stat { display: flex; align-items: center; gap: 14px; }
.dtt-stat-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dtt-stat-value { font-size: 1.5rem; font-weight: 700; color: #0f172a; line-height: 1; }
.dtt-stat-label { font-size: 11px; color: #64748b; margin-top: 4px; }

/* ── Category breakdown ──────────────────────────── */
.dtt-breakdown-card { margin-bottom: 16px; }
.dtt-section-title  { margin: 0 0 14px; font-size: .95rem; font-weight: 600; color: #0f172a; }
.dtt-cat-bars { display: flex; flex-wrap: wrap; gap: 12px; }
.dtt-cat-bar-item { flex: 1; min-width: 130px; }
.dtt-cat-bar-label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: #64748b; margin-bottom: 5px;
}
.dtt-cat-bar-label span:first-child { font-weight: 500; color: #334155; }
.dtt-cat-bar-track { background: #f1f5f9; border-radius: 4px; height: 7px; overflow: hidden; }
.dtt-cat-bar-fill  { height: 7px; border-radius: 4px; transition: width .5s cubic-bezier(.4,0,.2,1); }

/* ── Task list header ────────────────────────────── */
.dtt-list-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.dtt-list-header-right { display: flex; align-items: center; gap: 10px; }
.dtt-task-count { font-size: 12px; color: #94a3b8; }

.dtt-export-btn { font-size: 12px; padding: 6px 12px; }
.dtt-export-btn:hover { color: #6366f1; border-color: #6366f1; }

/* ── Date grouping ───────────────────────────────── */
.dtt-date-divider {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0 6px; margin-top: 6px;
  border-bottom: 1px solid #f1f5f9;
}
.dtt-date-divider:first-child { margin-top: 0; }
.dtt-date-label {
  font-size: 12px; font-weight: 700; color: #475569; letter-spacing: .02em;
}
.dtt-today-label {
  color: #6366f1;
}
.dtt-date-meta { font-size: 11px; color: #94a3b8; }

/* ── Task item ───────────────────────────────────── */
.dtt-task-list { display: flex; flex-direction: column; }
.dtt-task-item {
  background: #fafbfc; border: 1px solid #f1f5f9; border-radius: 10px;
  padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start;
  margin-top: 8px; transition: border-color .15s, transform .2s, opacity .2s;
}
.dtt-task-item:hover { border-color: #c7d2fe; background: #fff; }
.dtt-task-body  { flex: 1; min-width: 0; }
.dtt-task-top   { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.dtt-task-dev   {
  font-size: 11px; color: #6366f1; font-weight: 600;
  background: #eef2ff; padding: 2px 7px; border-radius: 4px;
}
.dtt-task-title { font-size: 14px; font-weight: 600; color: #0f172a; margin-bottom: 4px; word-break: break-word; }
.dtt-task-desc  { font-size: 12px; color: #64748b; line-height: 1.55; margin-bottom: 6px; word-break: break-word; }
.dtt-task-meta  { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dtt-task-hours { font-size: 11px; color: #64748b; display: flex; align-items: center; gap: 3px; }
.dtt-task-actions { display: flex; gap: 2px; flex-shrink: 0; padding-top: 2px; }

/* ── Badges ──────────────────────────────────────── */
.dtt-badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
}

/* ── Empty / Loading ─────────────────────────────── */
.dtt-empty, .dtt-loading {
  text-align: center; padding: 40px 20px; color: #94a3b8; font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.dtt-empty kbd {
  background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 5px;
  padding: 1px 6px; font-size: 12px; font-family: monospace; color: #475569;
}

/* ── Spinner ─────────────────────────────────────── */
.dtt-spinner {
  display: inline-block; width: 16px; height: 16px; border: 2px solid #e2e8f0;
  border-top-color: #6366f1; border-radius: 50%;
  animation: dtt-spin .7s linear infinite; flex-shrink: 0;
}
@keyframes dtt-spin { to { transform: rotate(360deg); } }

/* ── Modal ───────────────────────────────────────── */
.dtt-modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  z-index: 99999; display: flex; align-items: center; justify-content: center;
  padding: 16px; backdrop-filter: blur(2px);
}
.dtt-modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 580px;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  animation: dttSlideIn .18s ease;
}
.dtt-modal-sm { max-width: 380px; }
@keyframes dttSlideIn { from { opacity:0; transform:translateY(-12px) scale(.98); } to { opacity:1; transform:none; } }
.dtt-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px 0;
}
.dtt-modal-header h2 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.dtt-modal-close { background:none; border:none; font-size:22px; cursor:pointer; color:#94a3b8; line-height:1; padding:4px; border-radius:4px; }
.dtt-modal-close:hover { color:#334155; background:#f8fafc; }
.dtt-modal-body   { padding: 18px 24px; }
.dtt-modal-footer { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 8px; }

/* ── Form ────────────────────────────────────────── */
.dtt-form-row   { display: flex; gap: 12px; }
.dtt-form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.dtt-col-4 { flex: 4; } .dtt-col-8 { flex: 8; }
.dtt-form-group label { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .05em; }
.dtt-form-group input,
.dtt-form-group select,
.dtt-form-group textarea {
  border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 9px 12px; font-size: 14px; color: #0f172a;
  font-family: inherit; resize: vertical; outline: none; background: #f8fafc;
  transition: border-color .15s, box-shadow .15s;
}
.dtt-form-group input:focus,
.dtt-form-group select:focus,
.dtt-form-group textarea:focus { border-color: #6366f1; background: #fff; box-shadow: 0 0 0 3px #6366f118; }
.dtt-field-error { border-color: #ef4444 !important; box-shadow: 0 0 0 3px #ef444418 !important; animation: dttShake .3s; }
@keyframes dttShake { 0%,100%{transform:none} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }

/* ── Toast ───────────────────────────────────────── */
#dtt-toast-wrap {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.dtt-toast {
  background: #1e293b; color: #fff; padding: 10px 16px;
  border-radius: 10px; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); pointer-events: auto;
  border-left: 3px solid #6366f1; max-width: 280px;
  opacity: 0; transform: translateX(16px);
  transition: opacity .25s, transform .25s;
}
.dtt-toast.dtt-toast-in { opacity: 1; transform: translateX(0); }
.dtt-toast-icon { font-weight: 700; font-size: 14px; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 720px) {
  .dtt-summary-cards { grid-template-columns: 1fr 1fr; }
  .dtt-form-row { flex-direction: column; }
  .dtt-filter-row { flex-direction: column; }
}
@media (max-width: 420px) {
  .dtt-summary-cards { grid-template-columns: 1fr; }
  .dtt-modal { border-radius: 12px; }
}
