/* =====================================================
   勤怠管理システム — フロントエンドスタイル
   モバイルファースト設計
===================================================== */

/* --- カラー変数 --- */
:root {
    --att-bg:          #f0f2f7;
    --att-surface:     #ffffff;
    --att-primary:     #4f46e5;
    --att-primary-dk:  #3730a3;
    --att-text:        #1e293b;
    --att-muted:       #64748b;
    --att-border:      #e2e8f0;
    --att-radius:      16px;
    --att-radius-sm:   10px;
    --att-shadow:      0 4px 24px rgba(0,0,0,.08);
    --att-shadow-sm:   0 2px 8px  rgba(0,0,0,.06);

    /* 打刻ボタン色 */
    --att-clock-in:    #16a34a;
    --att-clock-in-lt: #dcfce7;
    --att-clock-out:   #dc2626;
    --att-clock-out-lt:#fee2e2;
    --att-break-out:   #d97706;
    --att-break-out-lt:#fef3c7;
    --att-break-in:    #2563eb;
    --att-break-in-lt: #dbeafe;
}

/* --- リセット・ベース --- */
.att-wrap *,
.att-wrap *::before,
.att-wrap *::after {
    box-sizing: border-box;
}

.att-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
    color: var(--att-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* =====================================================
   レイアウト共通
===================================================== */
.att-wrap {
    min-height: 100vh;
    background: var(--att-bg);
    padding-bottom: 48px;
}

.att-card {
    background: var(--att-surface);
    border-radius: var(--att-radius);
    box-shadow: var(--att-shadow);
    padding: 32px 28px;
}

/* =====================================================
   アプリヘッダー
===================================================== */
.att-app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--att-surface);
    border-bottom: 1px solid var(--att-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.att-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
}

.att-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--att-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.att-user-name {
    font-weight: 600;
    font-size: 15px;
}

.att-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--att-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--att-muted);
    transition: background .15s;
    padding: 0;
}
.att-icon-btn:hover { background: var(--att-border); }
.att-icon-btn svg { width: 18px; height: 18px; }

/* =====================================================
   ログイン画面
===================================================== */
.att-login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    min-height: 100vh;
}

.att-login-card {
    width: 100%;
    max-width: 400px;
}

.att-brand {
    text-align: center;
    margin-bottom: 32px;
}

.att-brand-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--att-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 4px 16px rgba(79,70,229,.35);
}
.att-brand-icon svg { width: 36px; height: 36px; }

.att-brand-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--att-text);
    margin: 0;
}

/* フォーム */
.att-form { display: flex; flex-direction: column; gap: 18px; }

.att-field { display: flex; flex-direction: column; gap: 6px; }

.att-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--att-muted);
    letter-spacing: .04em;
}

.att-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 2px solid var(--att-border);
    border-radius: var(--att-radius-sm);
    font-size: 16px;
    color: var(--att-text);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.att-input:focus {
    border-color: var(--att-primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.att-password-wrap { position: relative; }
.att-password-wrap .att-input { padding-right: 48px; }

.att-pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--att-muted);
}
.att-eye-icon { width: 20px; height: 20px; display: block; }

/* ボタン共通 */
.att-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 24px;
    border-radius: var(--att-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform .12s, box-shadow .12s, opacity .12s;
}
.att-btn:active { transform: scale(.97); }

.att-btn-primary {
    background: var(--att-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79,70,229,.3);
}
.att-btn-primary:hover { background: var(--att-primary-dk); }

.att-btn-block { width: 100%; }

/* ローディングスピナー */
.att-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: att-spin .7s linear infinite;
}
@keyframes att-spin { to { transform: rotate(360deg); } }

/* お知らせ */
.att-notice {
    padding: 12px 14px;
    border-radius: var(--att-radius-sm);
    font-size: 14px;
    font-weight: 500;
}
.att-notice-error   { background: #fee2e2; color: #b91c1c; }
.att-notice-success { background: #dcfce7; color: #15803d; }

/* =====================================================
   打刻画面
===================================================== */
.att-punch-wrap { max-width: 480px; margin: 0 auto; }

/* 日時カード */
.att-datetime-card {
    text-align: center;
    padding: 28px 20px 20px;
}
.att-current-date {
    font-size: 15px;
    color: var(--att-muted);
    margin: 0 0 4px;
}
.att-current-time {
    font-size: 52px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--att-text);
    margin: 0;
    font-variant-numeric: tabular-nums;
}

/* ステータスバッジ */
.att-status-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 20px 20px;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    background: var(--att-border);
    color: var(--att-muted);
    transition: background .3s, color .3s;
}
.att-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.att-status-since {
    font-weight: 400;
    opacity: .8;
}

.att-status-badge.att-status-clock-in  { background: var(--att-clock-in-lt);   color: var(--att-clock-in);  }
.att-status-badge.att-status-clock-out { background: var(--att-clock-out-lt);  color: var(--att-clock-out); }
.att-status-badge.att-status-break-out { background: var(--att-break-out-lt);  color: var(--att-break-out); }
.att-status-badge.att-status-break-in  { background: var(--att-break-in-lt);   color: var(--att-break-in);  }

/* 打刻ボタングリッド */
.att-punch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 0 20px 20px;
}

.att-punch-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 120px;
    border-radius: var(--att-radius);
    border: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    position: relative;
    overflow: hidden;
}
.att-punch-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
    transition: opacity .12s;
}
.att-punch-btn:active::after { opacity: .15; }
.att-punch-btn:not(.att-punch-disabled):active { transform: scale(.95); }

.att-punch-btn.att-punch-disabled {
    opacity: .35;
    cursor: not-allowed;
    filter: grayscale(.4);
}

.att-punch-icon { line-height: 0; }
.att-punch-icon svg { width: 28px; height: 28px; }

.att-punch-label {
    font-size: 17px;
    font-weight: 700;
}
.att-punch-sub {
    font-size: 11px;
    opacity: .75;
}

/* ボタン個別カラー */
.att-punch-clock-in {
    background: var(--att-clock-in);
    color: #fff;
    box-shadow: 0 6px 20px rgba(22,163,74,.3);
}
.att-punch-clock-out {
    background: var(--att-clock-out);
    color: #fff;
    box-shadow: 0 6px 20px rgba(220,38,38,.3);
}
.att-punch-break-out {
    background: var(--att-break-out);
    color: #fff;
    box-shadow: 0 6px 20px rgba(217,119,6,.3);
}
.att-punch-break-in {
    background: var(--att-break-in);
    color: #fff;
    box-shadow: 0 6px 20px rgba(37,99,235,.3);
}

/* 打刻ログ */
.att-today-log {
    margin: 0 20px;
    background: var(--att-surface);
    border-radius: var(--att-radius);
    padding: 20px;
    box-shadow: var(--att-shadow-sm);
}
.att-section-heading {
    font-size: 13px;
    font-weight: 600;
    color: var(--att-muted);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin: 0 0 12px;
}
.att-empty-log {
    color: var(--att-muted);
    font-size: 14px;
    text-align: center;
    padding: 12px 0;
    margin: 0;
}

.att-log-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--att-radius-sm);
    margin-bottom: 6px;
    font-size: 14px;
}
.att-log-clock-in  { background: var(--att-clock-in-lt);  color: var(--att-clock-in);  }
.att-log-clock-out { background: var(--att-clock-out-lt); color: var(--att-clock-out); }
.att-log-break-out { background: var(--att-break-out-lt); color: var(--att-break-out); }
.att-log-break-in  { background: var(--att-break-in-lt);  color: var(--att-break-in);  }

.att-log-type { font-weight: 600; }
.att-log-time { font-variant-numeric: tabular-nums; font-weight: 500; }

.att-work-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--att-border);
    font-size: 14px;
    color: var(--att-muted);
}
.att-work-total strong { color: var(--att-text); font-size: 16px; }

/* ナビリンク */
.att-nav-links {
    text-align: center;
    padding: 24px 20px 0;
}
.att-text-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--att-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.att-text-link:hover { text-decoration: underline; }
.att-text-link svg { width: 16px; height: 16px; }

/* =====================================================
   打刻完了オーバーレイ
===================================================== */
.att-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity .25s;
}
.att-overlay.att-hidden { display: none; }

.att-overlay-card {
    background: #fff;
    border-radius: 24px;
    padding: 40px 48px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: att-pop .25s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes att-pop {
    from { transform: scale(.7); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}

.att-overlay-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 12px;
}
.att-overlay-label {
    font-size: 22px;
    font-weight: 700;
    color: var(--att-text);
    margin: 0 0 6px;
}
.att-overlay-time {
    font-size: 36px;
    font-weight: 700;
    color: var(--att-primary);
    margin: 0;
    font-variant-numeric: tabular-nums;
}

/* =====================================================
   個人記録ページ
===================================================== */
.att-records-wrap { max-width: 480px; margin: 0 auto; }

.att-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--att-primary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.att-back-btn svg { width: 18px; height: 18px; }

.att-page-title {
    font-size: 22px;
    font-weight: 700;
    padding: 20px 20px 8px;
    margin: 0;
}

/* 月移動 */
.att-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 20px 16px;
    background: var(--att-surface);
    border-radius: var(--att-radius-sm);
    padding: 4px;
    box-shadow: var(--att-shadow-sm);
}
.att-month-arrow {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--att-primary);
    font-size: 22px;
    text-decoration: none;
    transition: background .15s;
}
.att-month-arrow:hover { background: var(--att-bg); }
.att-month-label { font-size: 16px; font-weight: 700; }

/* 月次サマリーカード */
.att-summary-card {
    display: flex;
    align-items: center;
    margin: 0 20px 16px;
    background: var(--att-primary);
    color: #fff;
    border-radius: var(--att-radius);
    padding: 20px 24px;
    box-shadow: 0 6px 20px rgba(79,70,229,.3);
}
.att-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}
.att-summary-label {
    font-size: 12px;
    opacity: .8;
    margin-bottom: 4px;
}
.att-summary-value {
    font-size: 22px;
    font-weight: 700;
}
.att-summary-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,.3);
    margin: 0 16px;
}

/* 日別カード */
.att-day-list { padding: 0 20px; display: flex; flex-direction: column; gap: 10px; }

.att-day-card {
    background: var(--att-surface);
    border-radius: var(--att-radius);
    padding: 16px;
    box-shadow: var(--att-shadow-sm);
}
.att-day-holiday { border-left: 4px solid #fca5a5; }

.att-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.att-day-date-block {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.att-day-num {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}
.att-day-name {
    font-size: 13px;
    color: var(--att-muted);
    font-weight: 600;
}
.att-holiday-color { color: #dc2626; }
.att-day-total {
    font-size: 15px;
    font-weight: 700;
    color: var(--att-primary);
}

.att-day-records { display: flex; flex-direction: column; gap: 4px; }

/* 空ステート */
.att-empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--att-muted);
}
.att-empty-icon svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: .4;
}
.att-empty-text { font-size: 15px; margin: 0; }

/* ユーティリティ */
.att-hidden { display: none !important; }

/* =====================================================
   レスポンシブ（タブレット以上）
===================================================== */
@media (min-width: 480px) {
    .att-punch-btn { height: 140px; }
    .att-current-time { font-size: 64px; }
}
