/* ===== Google Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+JP:wght@400;500;600;700;800&display=swap');

/* ===== Variables ===== */
:root {
  --bg:        #0d0f14;
  --bg2:       #13161e;
  --bg3:       #1a1e2a;
  --bg4:       #222736;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.12);
  --text:      #e8eaf0;
  --text2:     #8b90a0;
  --text3:     #555b70;
  --accent:    #6c63ff;
  --accent2:   #a78bfa;
  --accent-g:  linear-gradient(135deg, #6c63ff, #a78bfa);
  --gold:      #f59e0b;
  --green:     #10b981;
  --red:       #ef4444;
  --blue:      #3b82f6;
  --cyan:      #06b6d4;
  --radius:    12px;
  --radius-lg: 18px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.6);
  --header-h:  62px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.65;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
textarea { resize: vertical; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  position: relative; overflow: hidden;
}
.login-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(108,99,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108,99,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}
.login-glow {
  position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none;
}
.login-glow-1 { width: 400px; height: 400px; background: rgba(108,99,255,0.15); top: -100px; left: -100px; }
.login-glow-2 { width: 300px; height: 300px; background: rgba(167,139,250,0.1); bottom: -80px; right: -80px; }
.login-card {
  position: relative; z-index: 10;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 24px; padding: 48px 44px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp .5s ease both;
}
.login-logo-wrap { text-align: center; margin-bottom: 32px; }
.login-logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--accent-g);
  font-size: 28px; margin-bottom: 16px;
  box-shadow: 0 8px 32px rgba(108,99,255,0.4);
}
.login-site-name {
  font-size: 22px; font-weight: 800; letter-spacing: 0.06em;
  background: var(--accent-g); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.login-tagline { color: var(--text3); font-size: 12px; margin-top: 4px; letter-spacing: 0.1em; text-transform: uppercase; }
.login-error {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  border-radius: 10px; padding: 10px 14px; color: #fca5a5; font-size: 13px; margin-bottom: 16px;
}
.login-note { text-align: center; color: var(--text3); font-size: 11px; margin-top: 20px; }

/* =============================================
   HEADER
   ============================================= */
.site-header {
  position: sticky; top: 0; z-index: 200; height: var(--header-h);
  background: rgba(13,15,20,0.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.header-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; width: 100%;
}
.header-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 800; letter-spacing: 0.05em;
}
.header-logo-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent-g); display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
}
.header-logo-text {
  background: var(--accent-g); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.header-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--text2); transition: all .2s; white-space: nowrap; cursor: pointer;
  border: none; background: none; font-family: inherit;
}
.nav-link:hover { background: var(--bg3); color: var(--text); }
.nav-link.active { background: rgba(108,99,255,0.15); color: var(--accent2); }
.nav-link.admin-btn {
  background: rgba(245,158,11,0.12); color: var(--gold);
  border: 1px solid rgba(245,158,11,0.25); margin-left: 8px;
}
.nav-link.admin-btn:hover { background: rgba(245,158,11,0.2); }
.header-right { display: flex; align-items: center; gap: 10px; }
.header-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-g); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; cursor: pointer;
  border: 2px solid var(--border2); transition: border-color .2s;
}
.header-avatar:hover { border-color: var(--accent); }
.header-username { font-size: 13px; color: var(--text2); }

/* =============================================
   LAYOUT
   ============================================= */
.page-wrap { max-width: 1180px; margin: 0 auto; padding: 32px 24px; }
.page-wrap.narrow { max-width: 720px; }
.page-wrap.wide   { max-width: 1280px; }
.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.page-title {
  font-size: 22px; font-weight: 800; margin-bottom: 24px;
  display: flex; align-items: center; gap: 10px;
}
.page-title-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text3); margin-bottom: 12px;
}

/* =============================================
   WELCOME BANNER
   ============================================= */
.welcome-banner {
  border-radius: var(--radius-lg); padding: 28px 32px; margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(108,99,255,0.2) 0%, rgba(167,139,250,0.1) 100%);
  border: 1px solid rgba(108,99,255,0.25); position: relative; overflow: hidden;
}
.welcome-banner::before {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(108,99,255,0.15), transparent 70%);
  pointer-events: none;
}
.welcome-name { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.welcome-sub { color: var(--text2); font-size: 13px; }

/* =============================================
   STATS
   ============================================= */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card.c-purple::before { background: var(--accent-g); }
.stat-card.c-gold::before   { background: var(--gold); }
.stat-card.c-red::before    { background: var(--red); }
.stat-card.c-green::before  { background: var(--green); }
.stat-card.c-blue::before   { background: var(--blue); }
.stat-card.c-cyan::before   { background: var(--cyan); }
.stat-icon { font-size: 22px; margin-bottom: 10px; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 11px; color: var(--text3); margin-top: 4px; font-weight: 500; letter-spacing: 0.04em; }
.stat-card.c-purple .stat-value { color: var(--accent2); }
.stat-card.c-gold   .stat-value { color: var(--gold); }
.stat-card.c-red    .stat-value { color: var(--red); }
.stat-card.c-green  .stat-value { color: var(--green); }
.stat-card.c-blue   .stat-value { color: var(--blue); }
.stat-card.c-cyan   .stat-value { color: var(--cyan); }

/* =============================================
   TABS
   ============================================= */
.tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 18px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--bg2); color: var(--text2); font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: inherit; transition: all .2s; white-space: nowrap;
  display: flex; align-items: center; gap: 6px; text-decoration: none;
}
.tab-btn:hover { border-color: var(--border2); color: var(--text); }
.tab-btn.active {
  background: rgba(108,99,255,0.15); border-color: rgba(108,99,255,0.4);
  color: var(--accent2); font-weight: 700;
}
.tab-badge {
  background: var(--red); color: #fff; font-size: 10px; font-weight: 800;
  border-radius: 10px; padding: 1px 6px; min-width: 18px; text-align: center;
}

/* =============================================
   TABLE
   ============================================= */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  padding: 10px 14px; text-align: left; color: var(--text3);
  font-weight: 600; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg3);
}
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table th:first-child, .data-table td:first-child { border-radius: 0; padding-left: 20px; }

/* =============================================
   BADGES
   ============================================= */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 6px; padding: 3px 9px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.03em; white-space: nowrap;
}
.badge-purple  { background: rgba(108,99,255,0.15); color: var(--accent2); border: 1px solid rgba(108,99,255,0.3); }
.badge-gold    { background: rgba(245,158,11,0.12); color: var(--gold);    border: 1px solid rgba(245,158,11,0.3); }
.badge-green   { background: rgba(16,185,129,0.12); color: var(--green);   border: 1px solid rgba(16,185,129,0.3); }
.badge-red     { background: rgba(239,68,68,0.12);  color: #fca5a5;        border: 1px solid rgba(239,68,68,0.3); }
.badge-blue    { background: rgba(59,130,246,0.12); color: #93c5fd;        border: 1px solid rgba(59,130,246,0.3); }
.badge-cyan    { background: rgba(6,182,212,0.12);  color: #67e8f9;        border: 1px solid rgba(6,182,212,0.3); }
.badge-gray    { background: rgba(255,255,255,0.05);color: var(--text3);   border: 1px solid var(--border2); }
.badge-pin     { background: rgba(245,158,11,0.15); color: var(--gold); }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: 9px; padding: 9px 18px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .2s; white-space: nowrap; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn:active { transform: none; }
.btn-primary  { background: var(--accent-g); color: #fff; box-shadow: 0 4px 16px rgba(108,99,255,0.35); }
.btn-ghost    { background: var(--bg3); color: var(--text); border: 1px solid var(--border2); }
.btn-ghost:hover { background: var(--bg4); }
.btn-danger   { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.btn-success  { background: rgba(16,185,129,0.15); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.btn-gold     { background: rgba(245,158,11,0.15); color: var(--gold); border: 1px solid rgba(245,158,11,0.3); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: 11px; }
.btn-block { width: 100%; justify-content: center; }

/* =============================================
   FORMS
   ============================================= */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text2);
  margin-bottom: 7px; letter-spacing: 0.04em;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 9px; color: var(--text); font-size: 14px;
  font-family: inherit; outline: none; transition: border-color .2s, box-shadow .2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}
.form-input::placeholder { color: var(--text3); }
.form-textarea { min-height: 100px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; }
.form-hint { font-size: 11px; color: var(--text3); margin-top: 5px; }

/* ===== Login inputs ===== */
.login-input {
  width: 100%; padding: 12px 16px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 10px; color: var(--text); font-size: 14px;
  font-family: inherit; outline: none; transition: border-color .2s, box-shadow .2s;
}
.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(108,99,255,0.15); }
.login-input::placeholder { color: var(--text3); }
.login-label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text2);
  margin-bottom: 7px; letter-spacing: 0.05em;
}
.login-btn {
  width: 100%; padding: 13px; margin-top: 8px;
  background: var(--accent-g); border: none; border-radius: 10px;
  color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
  font-family: inherit; box-shadow: 0 4px 20px rgba(108,99,255,0.4);
  transition: transform .15s, box-shadow .15s; letter-spacing: 0.04em;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(108,99,255,0.5); }

/* =============================================
   ALERTS / FLASH
   ============================================= */
.alert {
  border-radius: 10px; padding: 12px 18px; font-size: 13px;
  font-weight: 500; margin-bottom: 20px; display: flex; align-items: center; gap: 8px;
}
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.alert-error   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.3);  color: #fca5a5; }
.alert-info    { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; }

/* =============================================
   MESSAGE BOARD
   ============================================= */
.board-post {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 12px;
  transition: border-color .2s;
}
.board-post:hover { border-color: var(--border2); }
.board-post.pinned { border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.04); }
.board-post-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.board-author { display: flex; align-items: center; gap: 10px; }
.board-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-g); display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.board-author-name { font-weight: 700; font-size: 14px; }
.board-date { font-size: 11px; color: var(--text3); }
.board-body { color: var(--text); line-height: 1.7; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.board-actions { margin-top: 10px; display: flex; gap: 8px; }
.board-write-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 20px; }

/* =============================================
   FILE LIST
   ============================================= */
.file-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--bg3); border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 10px;
  transition: border-color .2s;
}
.file-item:hover { border-color: var(--border2); }
.file-info { display: flex; align-items: center; gap: 14px; }
.file-icon { font-size: 26px; flex-shrink: 0; }
.file-name { font-weight: 600; font-size: 14px; }
.file-meta { font-size: 11px; color: var(--text3); margin-top: 3px; }
.upload-zone {
  border: 2px dashed var(--border2); border-radius: var(--radius-lg);
  padding: 28px; text-align: center; margin-bottom: 20px;
  background: var(--bg3); transition: border-color .2s;
}
.upload-zone:hover { border-color: var(--accent); }
.upload-zone-icon { font-size: 36px; margin-bottom: 10px; }
.upload-zone p { color: var(--text2); font-size: 13px; margin-bottom: 14px; }

/* =============================================
   APP / CONTACT CARDS
   ============================================= */
.app-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 12px;
}
.app-card.unread { border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.04); }
.app-card.pending { border-color: rgba(239,68,68,0.25); }
.app-name { font-weight: 700; font-size: 15px; }
.app-meta { color: var(--text2); font-size: 12px; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 14px; }
.app-message { margin-top: 10px; background: var(--bg4); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--text2); }
.app-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* =============================================
   SCHEDULE TABLE
   ============================================= */
.sch-note-normal  { color: var(--cyan); }
.sch-note-match   { color: var(--gold); }
.sch-note-special { color: var(--green); }

/* =============================================
   ACCOUNT / PROFILE
   ============================================= */
.profile-hero {
  display: flex; align-items: center; gap: 20px; margin-bottom: 24px;
  padding: 24px; background: var(--bg3); border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.profile-avatar-lg {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-g); display: flex; align-items: center;
  justify-content: center; font-size: 26px; font-weight: 800; color: #fff;
  border: 3px solid rgba(108,99,255,0.4);
}
.profile-info-name { font-size: 20px; font-weight: 800; }
.profile-info-sub  { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* =============================================
   USER MANAGEMENT
   ============================================= */
.user-row-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-g); display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text3); }
.empty-state-icon { font-size: 44px; margin-bottom: 14px; opacity: .5; }
.empty-state-text { font-size: 14px; }

/* =============================================
   UTILITIES
   ============================================= */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mt-20  { margin-top: 20px; }
.mb-16  { margin-bottom: 16px; }
.mb-20  { margin-bottom: 20px; }
.text-sm   { font-size: 13px; }
.text-xs   { font-size: 11px; }
.text-muted { color: var(--text2); }
.text-dim   { color: var(--text3); }
.fw-700    { font-weight: 700; }
.w-full    { width: 100%; }
.divider   { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%,100% { opacity: 1; } 50% { opacity: .5; }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .page-wrap { padding: 20px 16px; }
  .login-card { padding: 32px 24px; margin: 16px; }
  .header-inner { padding: 0 16px; }
  .header-username { display: none; }
  .welcome-banner { padding: 20px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .nav-link span { display: none; }
}
