@charset "UTF-8";

/* DEV HUB Ver.1.0.0 */
/* 共通デザインシステム */

:root {
  color-scheme: light;

  --primary: #0068E8;
  --accent: #4295FF;
  --bg: #F4F7FC;
  --card: #FFFFFF;
  --text: #10141D;
  --muted: #52647B;
  --border: #DCE4EF;
  --input: #F4F7FC;
  --active-bg: #E4EFFF;
  --active-text: #0059C7;

  --success: #087A45;
  --warning: #A64B00;
  --danger: #C62828;
  --purple: #7541C8;
  --gray: #52647B;

  --radius: 16px;
  --nav-width: 248px;
  --nav-height: 72px;
  --shadow: 0 4px 16px rgba(16, 20, 29, 0.06);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #080A0E;
  --card: #151922;
  --text: #FFFFFF;
  --muted: #AAB5C6;
  --border: #293343;
  --input: #10141D;
  --active-bg: #10294A;
  --active-text: #4295FF;

  --success: #34D399;
  --warning: #FDBA74;
  --danger: #F87171;
  --purple: #C4B5FD;
  --gray: #AAB5C6;

  --shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]),
  :root[data-theme="system"] {
    color-scheme: dark;

    --bg: #080A0E;
    --card: #151922;
    --text: #FFFFFF;
    --muted: #AAB5C6;
    --border: #293343;
    --input: #10141D;
    --active-bg: #10294A;
    --active-text: #4295FF;

    --success: #34D399;
    --warning: #FDBA74;
    --danger: #F87171;
    --purple: #C4B5FD;
    --gray: #AAB5C6;

    --shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  }
}

/* 基本設定 */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont,
    "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

a {
  color: var(--active-text);
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

/* 文字 */

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  font-weight: 750;
  line-height: 1.3;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

h3 {
  font-size: 16px;
  font-weight: 650;
}

small,
.caption,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.number {
  font-variant-numeric: tabular-nums;
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-danger {
  color: var(--danger);
}

/* アプリ全体 */

.app-shell {
  min-height: 100dvh;
}

.app-main {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 16px;
  padding-top: calc(
    20px + env(safe-area-inset-top, 0px)
  );
  padding-bottom: calc(
    var(--nav-height) + 24px +
    env(safe-area-inset-bottom, 0px)
  );
}

.app-header,
.page-header,
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

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

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
}

.brand-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1px;
}

.section {
  margin-bottom: 24px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.space-between {
  justify-content: space-between;
}

/* カード */

.card {
  min-width: 0;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  min-width: 0;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
}

.stat-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.project-card {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--text);
}

.project-card:active {
  border-color: var(--accent);
}

.today-card {
  border-left: 4px solid var(--primary);
}

/* ボタン */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}

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

.btn-danger {
  background: #B91C1C;
  color: #FFFFFF;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
}

.btn-block {
  width: 100%;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ナビゲーション */

.navigation {
  position: fixed;
  z-index: 100;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: var(--nav-height);
  padding: 8px 4px;
  padding-bottom: calc(
    8px + env(safe-area-inset-bottom, 0px)
  );
  background: var(--card);
  border-top: 1px solid var(--border);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 48px;
  padding: 4px 2px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
  line-height: 1.3;
}

.nav-item.active,
.nav-item[aria-current="page"] {
  background: var(--active-bg);
  color: var(--active-text);
  font-weight: 750;
}

.nav-brand {
  display: none;
}

/* 入力フォーム */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-group label {
  font-weight: 650;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  width: 22px;
  min-height: 22px;
  accent-color: var(--primary);
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

/* ステータス */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
}

.status-not-started {
  color: var(--gray);
}

.status-developing {
  color: var(--active-text);
}

.status-testing {
  color: var(--purple);
}

.status-completed {
  color: var(--success);
}

.status-maintenance {
  color: var(--active-text);
}

.status-paused {
  color: var(--warning);
}

/* 進捗バー */

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  background: var(--border);
  border-radius: 999px;
}

.progress-fill {
  height: 100%;
  max-width: 100%;
  background: var(--primary);
  border-radius: 999px;
}

/* 詳細メニュー */

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: left;
}

.menu-item .chevron {
  margin-left: auto;
  color: var(--muted);
}

/* 空データ・注意表示 */

.empty-state {
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state .btn {
  margin-top: 16px;
}

.notice {
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 12px;
}

.notice-warning {
  border-left-color: var(--warning);
}

.notice-danger {
  border-left-color: var(--danger);
}

.danger-zone {
  margin-top: 32px;
  padding: 16px;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
}

/* ダイアログ */

dialog {
  width: calc(100% - 32px);
  max-width: 480px;
  max-height: 85dvh;
  padding: 24px;
  overflow-y: auto;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

dialog h2 {
  margin-bottom: 16px;
}

/* 操作結果通知 */

.toast {
  position: fixed;
  z-index: 200;
  right: 16px;
  bottom: calc(
    var(--nav-height) + 24px +
    env(safe-area-inset-bottom, 0px)
  );
  left: 16px;
  max-width: 480px;
  margin: auto;
  padding: 14px 16px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.toast.error {
  border-left-color: var(--danger);
}

/* PC・タブレット対応 */

@media (min-width: 768px) {
  .app-shell {
    padding-left: var(--nav-width);
  }

  .app-main {
    padding: 32px;
  }

  .navigation {
    top: 0;
    right: auto;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: var(--nav-width);
    padding: 24px 16px;
    border-top: 0;
    border-right: 1px solid var(--border);
    overflow-y: auto;
  }

  .nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
  }

  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 52px;
    padding: 12px 16px;
    font-size: 15px;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .search-bar {
    grid-template-columns: minmax(0, 1fr) 200px;
  }

  .form-actions {
    flex-direction: row;
    justify-content: flex-end;
  }

  .toast {
    right: 24px;
    bottom: 24px;
    left: auto;
    min-width: 280px;
  }
}

@media (min-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}