/* ============================================
   ふぁぶふぁむ 利用希望提出確認システム
   style.css
   ============================================ */

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

:root {
    --primary:       #2a9d8f;
    --primary-dark:  #21867a;
    --primary-light: #e0f5f3;
    --danger:        #e63946;
    --warning:       #f4a261;
    --success:       #2d9e5f;
    --text:          #2d3436;
    --text-sub:      #535d61;
/*    --border:        #dfe6e9;	*/
    --border:        #b2bbbf;
	--bg:            #f0f7f6;
	--bg2:           #2D3436;
    --surface:       #ffffff;
    --shadow:        0 2px 8px rgba(0,0,0,.08);
    --shadow-md:     0 4px 16px rgba(0,0,0,.12);
    --radius:        12px;
    --radius-sm:     8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont,
                 'Hiragino Sans', 'Hiragino Kaku Gothic ProN',
                 'Noto Sans JP', 'Yu Gothic', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
}

/* ============ ヘッダー ============ */
.app-header {
    background: var(--primary);
    color: white;
    padding: .65rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.app-header-inner {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.app-header .logo {
    font-size: .95rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    letter-spacing: .02em;
}
.app-header .header-user {
    font-size: .8rem;
    color: rgba(255,255,255,.85);
    display: flex;
    align-items: center;
    gap: .75rem;
}
.app-header .header-user a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    padding: .25rem .55rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,.35);
    font-size: .78rem;
    transition: background .2s;
}
.app-header .header-user a:hover { background: rgba(255,255,255,.18); }

/* 管理者ヘッダー */
.app-header.admin { background: #2d3436; }
.app-header.admin .logo::before { content: '⚙️ '; }

/* ============ レイアウト ============ */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3.5rem;
}
.container-wide {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3.5rem;
}

/* ============ カード ============ */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.4rem;
    margin-bottom: 1rem;
}
.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.1rem;
    padding-bottom: .65rem;
    border-bottom: 2px solid var(--primary-light);
}

/* ============ フォーム ============ */
.form-group { margin-bottom: 1.15rem; }
.form-label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    margin-bottom: .35rem;
}
.form-label .required { color: var(--danger); margin-left: .2rem; }
.form-hint { font-size: .78rem; color: var(--text-sub); margin-top: .3rem; }

.form-control {
    width: 100%;
    padding: .72rem .95rem;
    font-size: 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42,157,143,.15);
}
.form-control::placeholder { color: #b2bec3; }
.form-control:disabled, .form-control[readonly] {
    background: #f8f9fa;
    color: var(--text-sub);
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%23636e72' d='M5 6 0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    padding-right: 2.2rem;
    cursor: pointer;
}


.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

/* ============ ボタン ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .72rem 1.4rem;
    font-size: .95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    -webkit-appearance: none;
    appearance: none;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}
.btn-primary  { background: var(--primary);  color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); }
.btn-secondary { background: #eaecee; color: var(--text); }
.btn-secondary:hover { background: #dde1e4; }
.btn-danger   { background: var(--danger);   color: #fff; }
.btn-danger:hover   { background: #c8303c; }
.btn-warning  { background: var(--warning);  color: #fff; }
.btn-success  { background: var(--success);  color: #fff; }
.btn-full     { width: 100%; }
.btn-sm       { padding: .4rem .85rem; font-size: .82rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* ============ アラート ============ */
.alert {
    padding: .8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: .85rem;
    font-size: .875rem;
    line-height: 1.5;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info    { background: var(--primary-light); color: #005f57; border: 1px solid #b2e0db; }

/* ============ 認証ページ ============ */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem 3rem;
    background: var(--bg);
}
.auth-box { width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo .auth-site-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: .04em;
}
.auth-logo .auth-sub {
    font-size: .78rem;
    color: var(--text-sub);
    margin-top: .2rem;
}
.auth-footer-link {
    text-align: center;
    margin-top: .85rem;
    font-size: .85rem;
    color: var(--text-sub);
}
.auth-footer-link a { color: var(--primary); text-decoration: none; }
.auth-footer-link a:hover { text-decoration: underline; }

/* ============ ダッシュボード ============ */
.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.1rem;
    display: flex;
    align-items: center;
    gap: .45rem;
}
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .875rem;
    margin-bottom: 1rem;
}
.menu-item {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.2rem .875rem;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: all .2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .45rem;
    border: 2px solid transparent;
}
.menu-item:hover, .menu-item:active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.menu-item .menu-icon { font-size: 1.8rem; }
.menu-item .menu-label { font-size: .85rem; font-weight: 600; line-height: 1.3; }
.menu-item-full { grid-column: span 2; }

/* ============ バッジ ============ */
.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 100px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.badge-draft     { background: #fff3cd; color: #856404; }
.badge-confirmed { background: #d4edda; color: #155724; }
.badge-none      { background: #f0f0f0; color: #636e72; }
.badge-overdue   { background: #f8d7da; color: #721c24; }
.badge-completed { background: #cce5ff; color: #004085; }

/* ============ テーブル ============ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
    min-width: 500px;
}
.table th {
    background: #f4f6f8;
    padding: .55rem .75rem;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid var(--border);
    font-size: .78rem;
    white-space: nowrap;
    color: var(--text-sub);
}
.table td {
    padding: .6rem .75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafcfc; }

/* ============ 今日の日付 ============ */
.today-date {
    font-size: 1.05rem;
    color: var(--text-sub);
    text-align: center;
    margin-bottom: .5rem;
}

/* ============ ステータス情報カード ============ */
.status-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
}
.status-card .status-month {
    font-size: 1.05rem;
    font-weight: 700;
}
.status-card .status-deadline {
    font-size: .82rem;
    color: var(--text-sub);
    margin-top: .15rem;
}

/* ============ ユーティリティ ============ */
.text-sub     { color: var(--text-sub); font-size: .875rem; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.fw-bold      { font-weight: 700; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }

/* ============ フッター ============ */
.app-footer {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--surface);
	font-size: .72rem;
    background: var(--bg2);
}

/* ============ 締め切りカウントダウン ============ */
.deadline-countdown {
    margin: .5rem 0 0;
    padding: .55rem .9rem;
    border-radius: 6px;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.4;
}
.countdown-normal  { background: #e8f5e9; color: #2d7a4f; }
.countdown-soon    { background: #fff8e1; color: #b07600; }
.countdown-urgent  { background: #fff3e0; color: #d06000; }
.countdown-overdue { background: #fdecea; color: #c0392b; }

/* ============ レスポンシブ ============ */
@media (max-width: 480px) {
    body { font-size: 14px; }
    .container, .container-wide { padding: 1rem .875rem 3rem; }
    .card { padding: 1.1rem; }
    .btn { padding: .7rem 1.1rem; font-size: .9rem; }
    .form-row { grid-template-columns: 1fr; }
}
