:root {
  --primary:       #0a3d62;
  --primary-dark:  #082d47;
  --primary-light: #1a5276;
  --accent:        #2980b9;
  --text:          #2c3e50;
  --text-light:    #7f8c8d;
  --bg:            #f0f4f8;
  --white:         #ffffff;
  --border:        #dce1e7;
  --danger:        #e74c3c;
  --success:       #27ae60;
}

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

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* ========== Header ========== */
.app-header {
  background: var(--primary);
  color: var(--white);
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.app-header h1 { font-size: 18px; font-weight: 600; }

.app-header .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.app-header a { color: rgba(255,255,255,0.85); text-decoration: none; }
.app-header a:hover { color: var(--white); }

/* ========== Layout ========== */
.main {
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ========== Search bar ========== */
.search-bar {
  background: var(--white);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search-bar input[type="search"] {
  flex: 1;
  min-width: 160px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}

.search-bar input[type="search"]:focus { border-color: var(--accent); }

.search-bar select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
  cursor: pointer;
  outline: none;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn:active { opacity: 0.85; }

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

.btn-secondary { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg); }

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

.btn:disabled  { opacity: 0.6; cursor: not-allowed; }

/* ========== Sort bar ========== */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-light);
}

.count-badge {
  background: var(--primary);
  color: var(--white);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}

/* ========== Card grid ========== */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 600px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

.card-item {
  background: var(--white);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: block;
  border-left: 4px solid var(--primary);
  transition: box-shadow 0.15s, transform 0.1s;
}

.card-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.14);
  transform: translateY(-1px);
}

.card-item .company  { font-size: 12px; color: var(--text-light); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-item .name     { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.card-item .job-title { font-size: 13px; color: var(--text-light); }

/* ========== Empty state ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state p { margin-bottom: 16px; font-size: 16px; }

/* ========== FAB ========== */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: background 0.15s, transform 0.1s;
  z-index: 200;
  line-height: 1;
}

.fab:hover { background: var(--primary-light); transform: scale(1.06); }

/* ========== Forms ========== */
.form-card {
  background: var(--white);
  border-radius: 10px;
  padding: 20px 20px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 14px;
}

.form-card h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

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

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 4px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); }

.form-group textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ========== Page actions ========== */
.page-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ========== Detail view ========== */
.detail-section {
  background: var(--white);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 12px;
}

.detail-section h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
}

.detail-row {
  display: flex;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--bg);
  font-size: 15px;
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
  min-width: 80px;
  font-size: 12px;
  color: var(--text-light);
  padding-top: 2px;
  flex-shrink: 0;
}

.detail-value { flex: 1; word-break: break-word; }
.detail-value a { color: var(--accent); text-decoration: none; }
.detail-value a:hover { text-decoration: underline; }

/* ========== Alerts ========== */
.alert {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 14px;
}

.alert-error   { background: #fde8e8; color: #c0392b; border: 1px solid #f5c6c6; }
.alert-success { background: #eafaf1; color: #1e8449; border: 1px solid #abebc6; }

/* ========== Login ========== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  padding: 16px;
}

.login-box {
  background: var(--white);
  border-radius: 12px;
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.login-box h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 4px;
}

.login-box .subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  margin-bottom: 24px;
}

.login-box .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 16px;
  margin-top: 4px;
}
