/* ===================================================================
   SmartCRM デザインシステム
   モダンで落ち着いた業務アプリ向けの配色・コンポーネントスタイル
   =================================================================== */

:root {
  --sc-bg: #f5f7fb;
  --sc-surface: #ffffff;
  --sc-border: #e6e9f0;
  --sc-text: #1f2733;
  --sc-text-muted: #6b7688;
  --sc-primary: #4f46e5;
  --sc-primary-dark: #4338ca;
  --sc-primary-soft: #eef2ff;
  --sc-accent: #0ea5e9;
  --sc-success: #10b981;
  --sc-warning: #f59e0b;
  --sc-danger: #ef4444;
  --sc-info: #06b6d4;
  --sc-radius: 14px;
  --sc-radius-sm: 10px;
  --sc-shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --sc-shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
  --sc-shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  --sc-sidebar: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
}

html {
  font-size: 15px;
  position: relative;
  min-height: 100%;
}

body {
  background-color: var(--sc-bg);
  color: var(--sc-text);
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, -apple-system, sans-serif;
  margin-bottom: 64px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--sc-primary);
  text-decoration: none;
}

a:hover {
  color: var(--sc-primary-dark);
  text-decoration: underline;
}

/* ---------- Navbar ---------- */
.sc-navbar {
  background: var(--sc-sidebar);
  box-shadow: var(--sc-shadow-md);
  padding-top: .6rem;
  padding-bottom: .6rem;
}

.sc-navbar .navbar-brand {
  font-weight: 700;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #fff;
}

.sc-navbar .navbar-brand .sc-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .5);
}

.sc-navbar .nav-link {
  color: rgba(255, 255, 255, .78) !important;
  font-weight: 500;
  border-radius: 8px;
  padding: .4rem .8rem !important;
  margin: 0 .1rem;
  transition: background-color .15s ease, color .15s ease;
}

.sc-navbar .nav-link:hover {
  color: #fff !important;
  background-color: rgba(255, 255, 255, .12);
}

.sc-navbar .nav-link.active {
  color: #fff !important;
  background-color: rgba(255, 255, 255, .18);
}

/* ---------- Cards ---------- */
.card {
  background: var(--sc-surface);
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  box-shadow: var(--sc-shadow-sm);
  transition: box-shadow .18s ease, transform .18s ease;
}

.card.shadow-sm {
  box-shadow: var(--sc-shadow-sm) !important;
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--sc-border);
  font-weight: 600;
  padding: .9rem 1.1rem;
}

/* ---------- Stat cards (dashboard) ---------- */
.sc-stat {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: var(--sc-radius);
  color: #fff;
}

.sc-stat .card-body {
  padding: 1.15rem 1.25rem;
}

.sc-stat .sc-stat-label {
  font-size: .82rem;
  opacity: .9;
  font-weight: 500;
}

.sc-stat .sc-stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: .25rem;
}

.sc-stat .sc-stat-icon {
  position: absolute;
  right: -8px;
  bottom: -10px;
  font-size: 4rem;
  opacity: .18;
  line-height: 1;
}

.sc-stat-primary { background: linear-gradient(135deg, #6366f1, #4338ca); }
.sc-stat-info    { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.sc-stat-success { background: linear-gradient(135deg, #10b981, #047857); }
.sc-stat-warning { background: linear-gradient(135deg, #f59e0b, #b45309); }
.sc-stat-danger  { background: linear-gradient(135deg, #ef4444, #b91c1c); }

/* ---------- Tables ---------- */
.table {
  --bs-table-hover-bg: var(--sc-primary-soft);
  color: var(--sc-text);
  margin-bottom: 0;
}

.table > thead {
  background: #f9fafc;
}

.table > thead th {
  text-transform: none;
  font-size: .82rem;
  font-weight: 600;
  color: var(--sc-text-muted);
  letter-spacing: .02em;
  border-bottom: 1px solid var(--sc-border);
  padding-top: .8rem;
  padding-bottom: .8rem;
}

.table > tbody td {
  vertical-align: middle;
  border-bottom: 1px solid #f0f2f7;
  padding-top: .7rem;
  padding-bottom: .7rem;
}

.table-hover > tbody > tr {
  transition: background-color .12s ease;
}

/* ---------- Buttons ---------- */
.btn {
  border-radius: var(--sc-radius-sm);
  font-weight: 600;
  padding: .5rem 1.1rem;
  transition: transform .08s ease, box-shadow .15s ease, background-color .15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--sc-primary);
  border-color: var(--sc-primary);
}

.btn-primary:hover {
  background-color: var(--sc-primary-dark);
  border-color: var(--sc-primary-dark);
  box-shadow: 0 6px 16px rgba(79, 70, 229, .35);
}

.btn-outline-secondary {
  border-color: var(--sc-border);
  color: var(--sc-text-muted);
}

.btn-outline-secondary:hover {
  background-color: #f1f3f8;
  border-color: #d7dbe6;
  color: var(--sc-text);
}

.btn:focus, .btn:active:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
  box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .25);
}

/* ---------- Forms ---------- */
.form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--sc-text-muted);
  margin-bottom: .3rem;
}

.form-control, .form-select {
  border-radius: var(--sc-radius-sm);
  border-color: var(--sc-border);
  padding: .5rem .8rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--sc-primary);
}

/* ---------- Badges ---------- */
.badge {
  font-weight: 600;
  padding: .4em .7em;
  border-radius: 999px;
}

/* ---------- Pagination ---------- */
.pagination {
  --bs-pagination-color: var(--sc-text-muted);
  --bs-pagination-active-bg: var(--sc-primary);
  --bs-pagination-active-border-color: var(--sc-primary);
  --bs-pagination-hover-color: var(--sc-primary-dark);
  --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .25);
}

.page-link {
  border-radius: 8px !important;
  margin: 0 .15rem;
  border-color: var(--sc-border);
}

/* ---------- Page heading ---------- */
.sc-page-title {
  font-weight: 700;
  letter-spacing: -.01em;
}

/* ---------- Footer ---------- */
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 60px;
  line-height: 60px;
  background: var(--sc-surface);
  border-top: 1px solid var(--sc-border);
  font-size: .85rem;
}

/* ---------- Hero (landing) ---------- */
.sc-hero {
  background: var(--sc-sidebar);
  border-radius: 20px;
  color: #fff;
  padding: 3.5rem 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--sc-shadow-lg);
}

.sc-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(14, 165, 233, .45), transparent 70%);
  border-radius: 50%;
}

.sc-hero h1 {
  font-weight: 800;
  letter-spacing: -.02em;
}

.sc-hero .lead {
  color: rgba(255, 255, 255, .82);
}

/* ---------- Feature cards (landing) ---------- */
.sc-feature {
  height: 100%;
  border-radius: var(--sc-radius);
}

.sc-feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--sc-shadow-md);
}

.sc-feature .sc-feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: .9rem;
  background: var(--sc-primary-soft);
  color: var(--sc-primary);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}