/* ── Reset & Base ─────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

a { color: #4a90d9; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ──────────────────────────────────── */
.header {
    background: #2c3e50;
    color: #fff;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

.header-right a {
    color: #ecf0f1;
    font-size: 13px;
}

.header-nav {
    display: flex;
    gap: 4px;
}

.header-nav a {
    padding: 4px 12px;
    border-radius: 4px;
    color: #bdc3c7 !important;
    transition: background .2s, color .2s;
}

.header-nav a:hover {
    background: rgba(255,255,255,.1);
    color: #fff !important;
    text-decoration: none;
}

.header-nav a.active {
    background: rgba(255,255,255,.15);
    color: #fff !important;
}

.logout-link {
    color: #e74c3c !important;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-title {
    font-size: 20px;
    color: #2c3e50;
}

.page-date {
    font-size: 14px;
    color: #7f8c8d;
}

.empty-msg {
    color: #7f8c8d;
    text-align: center;
    padding: 20px;
}

.container {
    max-width: 960px;
    margin: 24px auto;
    padding: 0 16px;
}

/* ── Cards ───────────────────────────────────── */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    padding: 24px;
    margin-bottom: 20px;
}

.card h2 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ecf0f1;
}

/* ── Stats Row ───────────────────────────────── */
.stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.stat-card .number {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
}

.stat-card .label {
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 4px;
}

/* ── Clock Button ────────────────────────────── */
.clock-area {
    text-align: center;
    padding: 32px 0;
}

.clock-area .current-time {
    font-size: 48px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

.clock-area .current-date {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 24px;
}

.clock-area .status {
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 600;
}

.status.working { color: #27ae60; }
.status.off { color: #7f8c8d; }
.status.on-break { color: #f39c12; }

.btn-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 12px 32px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-clock-in {
    background: #27ae60;
    color: #fff;
    padding: 16px 48px;
    font-size: 20px;
    border-radius: 8px;
}
.btn-clock-in:hover { background: #219a52; }

.btn-break {
    background: #f39c12;
    color: #fff;
    padding: 16px 40px;
    font-size: 20px;
    border-radius: 8px;
}
.btn-break:hover { background: #d68910; }

.btn-break-end {
    background: #3498db;
    color: #fff;
    padding: 16px 40px;
    font-size: 20px;
    border-radius: 8px;
}
.btn-break-end:hover { background: #2980b9; }

.btn-clock-out {
    background: #e74c3c;
    color: #fff;
    padding: 16px 48px;
    font-size: 20px;
    border-radius: 8px;
}
.btn-clock-out:hover { background: #c0392b; }

.btn-primary {
    background: #4a90d9;
    color: #fff;
}
.btn-primary:hover { background: #357abd; }

.btn-secondary {
    background: #ecf0f1;
    color: #333;
}
.btn-secondary:hover { background: #dde4e6; }

.btn-danger {
    background: #e74c3c;
    color: #fff;
    padding: 6px 14px;
    font-size: 13px;
}
.btn-danger:hover { background: #c0392b; }

.btn-excel {
    background: #217346;
    color: #fff;
}
.btn-excel:hover { background: #1a5c38; text-decoration: none; }

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* ── Tables ──────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
    font-size: 14px;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
}

tr:hover { background: #f8f9fa; }

/* ── Wage Ledger Table ───────────────────────── */
.wage-table { font-size: 13px; }
.wage-table th {
    font-size: 11px;
    text-align: center;
    vertical-align: middle;
    padding: 8px 6px;
    line-height: 1.3;
}
.wage-table th small { display: block; font-weight: normal; color: #7f8c8d; }
.wage-table td { text-align: right; padding: 8px 6px; white-space: nowrap; }
.wage-table td:first-child, .wage-table td:nth-child(2) { text-align: left; }
.wage-table tfoot td {
    font-weight: 600;
    border-top: 2px solid #2c3e50;
    background: #f8f9fa;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-working {
    background: #d5f5e3;
    color: #1e8449;
}

.badge-done {
    background: #eaf2f8;
    color: #2e86c1;
}

.badge-missing {
    background: #fdedec;
    color: #c0392b;
}

.badge-doc {
    background: #fef9e7;
    color: #b7950b;
}

/* ── Forms ───────────────────────────────────── */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px rgba(74,144,217,.2);
}

.form-inline {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-inline .form-group {
    margin-bottom: 0;
}

/* ── Flash Messages ──────────────────────────── */
.flash {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.flash-success {
    background: #d5f5e3;
    color: #1e8449;
    border: 1px solid #a9dfbf;
}

.flash-error {
    background: #fdedec;
    color: #c0392b;
    border: 1px solid #f5b7b1;
}

/* ── Nav Tabs ────────────────────────────────── */
.nav-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 0;
}

.nav-tabs a {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #7f8c8d;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .2s;
}

.nav-tabs a:hover {
    color: #2c3e50;
    text-decoration: none;
}

.nav-tabs a.active {
    color: #4a90d9;
    border-bottom-color: #4a90d9;
}

/* ── Login Page ──────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2c3e50, #3498db);
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    width: 100%;
    max-width: 380px;
}

.login-card h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 22px;
}

.login-card .subtitle {
    text-align: center;
    color: #7f8c8d;
    font-size: 13px;
    margin-bottom: 24px;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 640px) {
    .container { padding: 0 12px; }
    .stats { flex-direction: column; }
    .clock-area .current-time { font-size: 36px; }
    .form-inline { flex-direction: column; }
    .header h1 { font-size: 15px; }
    th, td { padding: 8px 6px; font-size: 13px; }
}
