/* =====================================================
   勤怠管理システム テーマ CSS
===================================================== */

/* --- リセット --- */
*, *::before, *::after { box-sizing: border-box; }

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background: var(--att-bg, #f0f2f7);
    font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }

/* =====================================================
   サイト構造
===================================================== */
.kintai-site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.kintai-main {
    flex: 1;
    /* ヘッダーの高さ分だけ上部に余白 */
    padding-top: 60px;
}

.kintai-page-content {
    /* プラグインの .att-wrap はここの中に入る */
}

/* =====================================================
   ヘッダー
===================================================== */
.kintai-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: 60px;
    background: var(--kintai-header-bg, #ffffff);
    border-bottom: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.kintai-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* ロゴ */
.kintai-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.kintai-logo a,
.kintai-logo img {
    display: block;
    max-height: 36px;
    width: auto;
}

.kintai-logo-text {
    font-size: 17px;
    font-weight: 800;
    color: var(--kintai-header-txt, #1e293b);
    letter-spacing: -.02em;
}

/* ハンバーガーボタン */
.kintai-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: none;
    border: none;
    border-radius: 8px;
    transition: background .15s;
    flex-shrink: 0;
}

.kintai-hamburger:hover {
    background: rgba(0,0,0,.05);
}

.kintai-hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--kintai-header-txt, #1e293b);
    border-radius: 2px;
    transition: transform .25s, opacity .25s;
    transform-origin: center;
}

/* ハンバーガーをXに変化 */
.kintai-hamburger.is-open .kintai-hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.kintai-hamburger.is-open .kintai-hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.kintai-hamburger.is-open .kintai-hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =====================================================
   ドロワーオーバーレイ
===================================================== */
.kintai-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(2px);
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}

.kintai-overlay.is-open {
    opacity: 1;
    pointer-events: all;
}

/* =====================================================
   ドロワーメニュー
===================================================== */
.kintai-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 76%;
    max-width: 300px;
    background: var(--kintai-drawer-bg, #1f2937);
    z-index: 400;
    display: flex;
    flex-direction: column;
    padding: 0 0 24px;
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    border-radius: 24px 0 0 24px;
}

.kintai-drawer.is-open {
    transform: translateX(0);
}

/* 閉じるボタン */
.kintai-drawer-close {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 20px 20px 8px;
    background: none;
    border: none;
    color: rgba(255,255,255,.5);
    transition: color .15s;
}
.kintai-drawer-close:hover { color: #fff; }
.kintai-drawer-close svg { width: 22px; height: 22px; }

/* メニューリスト */
.kintai-drawer-list {
    padding: 8px 12px;
    flex: 1;
}

.kintai-drawer-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    color: rgba(255,255,255,.35);
    padding: 16px 12px 6px;
    text-transform: uppercase;
}

.kintai-drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,.75);
    transition: background .15s, color .15s;
}

.kintai-drawer-item:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.kintai-drawer-item.is-active {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.kintai-drawer-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: .7;
    line-height: 0;
}
.kintai-drawer-icon svg { width: 20px; height: 20px; }
.kintai-drawer-item.is-active .kintai-drawer-icon,
.kintai-drawer-item:hover .kintai-drawer-icon {
    opacity: 1;
}

/* ユーザー情報 */
.kintai-drawer-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 12px 0;
    padding: 14px;
    background: rgba(255,255,255,.06);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.08);
}

.kintai-drawer-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--att-primary, #4f46e5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.kintai-drawer-userinfo {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.kintai-drawer-username {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kintai-drawer-logout {
    background: none;
    border: none;
    font-size: 11px;
    color: rgba(255,255,255,.45);
    padding: 0;
    text-align: left;
    transition: color .15s;
}
.kintai-drawer-logout:hover { color: rgba(255,255,255,.8); }

/* =====================================================
   プラグイン側のヘッダーを非表示
   （テーマのヘッダーで代替するため）
===================================================== */
.att-app-header {
    display: none !important;
}

/* プラグインの .att-wrap がテーマヘッダーと
   重ならないよう上部paddingを調整 */
.att-punch-wrap,
.att-records-wrap,
.att-login-wrap {
    padding-top: 0;
}

/* ログイン画面：画面全体を使う */
.att-login-wrap {
    min-height: calc(100vh - 60px);
}

/* =====================================================
   レスポンシブ
===================================================== */
@media (min-width: 480px) {
    .kintai-drawer {
        max-width: 320px;
    }
}

@media (min-width: 768px) {
    .kintai-header-inner {
        padding: 0 32px;
    }
}
