/* ============================================
   株式会社SYSART 社内ポータル
   共通スタイルシート - Modern & Refined
   ============================================ */

:root {
  /* ブランドカラー */
  --color-primary: #1a2b4a;
  --color-primary-light: #2d4373;
  --color-primary-dark: #0f1b30;
  --color-accent: #c9a961;
  --color-accent-light: #e4c988;

  /* 背景・サーフェス */
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-surface-hover: #f0f2f6;
  --color-surface-alt: #fafbfc;

  /* テキスト */
  --color-text: #1a1a1a;
  --color-text-secondary: #5a6270;
  --color-text-muted: #8b93a0;
  --color-text-inverse: #ffffff;

  /* ボーダー・区切り */
  --color-border: #e5e8ed;
  --color-border-strong: #d1d6dd;
  --color-divider: #eef0f3;

  /* ステータス */
  --color-success: #2e7d5f;
  --color-warning: #c07a1e;
  --color-danger: #b83838;
  --color-info: #2563a8;

  /* シャドウ */
  --shadow-sm: 0 1px 2px rgba(26, 43, 74, 0.05);
  --shadow-md: 0 2px 8px rgba(26, 43, 74, 0.08), 0 1px 3px rgba(26, 43, 74, 0.04);
  --shadow-lg: 0 8px 24px rgba(26, 43, 74, 0.12), 0 2px 6px rgba(26, 43, 74, 0.06);

  /* レイアウト */
  --sidebar-width: 240px;
  --header-height: 64px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 16px;

  /* タイポグラフィ */
  --font-display: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

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

html, body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ============================================
   レイアウト共通
   ============================================ */

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  min-height: 100vh;
}

/* ============================================
   ヘッダー
   ============================================ */

.app-header {
  grid-area: header;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.header-search input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-size: 13px;
  color: var(--color-text);
  transition: all 0.15s ease;
  font-family: inherit;
}

.header-search input:focus {
  outline: none;
  border-color: var(--color-primary-light);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px rgba(45, 67, 115, 0.08);
}

.header-search::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b93a0' stroke-width='2'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.35-4.35'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-notification {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: all 0.15s ease;
}

.header-notification:hover {
  background: var(--color-surface-hover);
  color: var(--color-primary);
}

.header-notification .badge {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--color-accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-md);
  transition: background 0.15s ease;
  cursor: pointer;
}

.header-user:hover {
  background: var(--color-surface-hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
}

.user-dept {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ============================================
   サイドバー
   ============================================ */

.app-sidebar {
  grid-area: sidebar;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 0 24px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

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

.brand-mark {
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-primary-dark);
  font-size: 16px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 28px;
}

.nav-section-title {
  padding: 0 24px 10px;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-inverse);
}

.nav-item.active {
  background: rgba(201, 169, 97, 0.1);
  color: var(--color-accent-light);
  border-left-color: var(--color-accent);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   メインエリア
   ============================================ */

.app-main {
  grid-area: main;
  padding: 32px 40px 48px;
  overflow-y: auto;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-divider);
}

.page-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-breadcrumb {
  font-size: 11px;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

.page-breadcrumb a:hover {
  color: var(--color-primary);
}

.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--color-primary-dark);
  letter-spacing: 0.02em;
}

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

/* ============================================
   ボタン
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

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

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

.btn-accent {
  background: var(--color-accent);
  color: var(--color-primary-dark);
  font-weight: 600;
}

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

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}

.btn-secondary:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary-light);
}

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

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

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

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* ============================================
   カード
   ============================================ */

.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-primary-dark);
  letter-spacing: 0.02em;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-divider);
  background: var(--color-surface-alt);
}

/* ============================================
   バッジ・タグ
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.badge-info {
  background: #e8f0fa;
  color: var(--color-info);
}

.badge-success {
  background: #e6f3ec;
  color: var(--color-success);
}

.badge-warning {
  background: #fbf0dc;
  color: var(--color-warning);
}

.badge-danger {
  background: #fbe9e9;
  color: var(--color-danger);
}

.badge-neutral {
  background: var(--color-surface-hover);
  color: var(--color-text-secondary);
}

.badge-accent {
  background: rgba(201, 169, 97, 0.15);
  color: #8a6f34;
}

.badge-primary {
  background: #e9edf6;
  color: var(--color-primary);
}

.badge-secondary {
  background: #eef0f3;
  color: var(--color-text-secondary);
}

/* ============================================
   フォーム
   ============================================ */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-label .required {
  color: var(--color-danger);
  margin-left: 4px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  transition: all 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(45, 67, 115, 0.08);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.7;
}

.form-help {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ============================================
   テーブル
   ============================================ */

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

.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  padding: 12px 16px;
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-divider);
  font-size: 13px;
  color: var(--color-text);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.1s ease;
}

.data-table tbody tr:hover {
  background: var(--color-surface-alt);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   ユーティリティ
   ============================================ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.text-sm { font-size: 12px; }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }

.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.sample-notice {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: rgba(26, 43, 74, 0.92);
  color: white;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 11px;
  letter-spacing: 0.05em;
  z-index: 200;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
}

/* ============================================
   レスポンシブ
   ============================================ */

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main";
  }
  .app-sidebar { display: none; }
  .app-main { padding: 20px; }
  .header-search { max-width: none; margin-right: 12px; }
  .user-info { display: none; }
}
