* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 45%, #ecfeff 100%);
    color: #1f2937;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: 0;
    width: 420px;
    height: 420px;
    border-radius: 999px;
    filter: blur(24px);
    opacity: 0.35;
    pointer-events: none;
}

body::before {
    top: -120px;
    left: -140px;
    background: radial-gradient(circle, #818cf8 0%, transparent 70%);
}

body::after {
    bottom: -140px;
    right: -140px;
    background: radial-gradient(circle, #22d3ee 0%, transparent 70%);
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.88);
    color: #111827;
    border-bottom: 1px solid #dbeafe;
    backdrop-filter: blur(8px);
}

.brand h1 {
    margin: 0;
    font-size: 24px;
    letter-spacing: 0.5px;
}

.brand p {
    margin: 3px 0 0;
    font-size: 12px;
    color: #6366f1;
}

.user-badge {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
}

.site-header h1 {
    margin: 0;
    font-size: 22px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.container {
    max-width: 1080px;
    margin: 28px auto;
    padding: 0 18px 24px;
    position: relative;
    z-index: 1;
}

.card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #dbeafe;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.08);
    margin-bottom: 20px;
}

.card h2 {
    margin-top: 0;
}

.auth-card {
    max-width: 420px;
    margin: 80px auto 0;
    text-align: center;
}

.auth-page .site-header {
    justify-content: center;
}

.auth-page .header-right {
    display: none;
}

.hint {
    color: #6b7280;
}

.form-grid {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 14px;
    align-items: center;
}

.row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

label {
    font-weight: 600;
    color: #374151;
}

input,
button,
select {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
}

input,
select {
    background: #ffffff;
    color: #111827;
    transition: all 0.2s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

button {
    border: none;
    background: linear-gradient(120deg, #6366f1 0%, #2563eb 100%);
    color: #ffffff;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.28);
}

button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.btn-secondary {
    background: linear-gradient(120deg, #6366f1 0%, #2563eb 100%);
}

.btn-danger {
    background: linear-gradient(120deg, #6366f1 0%, #2563eb 100%);
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.segment-row {
    display: grid;
    grid-template-columns: 120px 28px 120px 1fr 80px;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    border: 1px solid #dbeafe;
    background: #f8fbff;
    border-radius: 10px;
    padding: 10px;
}

.flash-wrap {
    margin-bottom: 12px;
}

.flash {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid transparent;
}

.flash.success {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.flash.error {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 10px;
}

th,
td {
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 10px;
    text-align: left;
}

th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
}

tbody tr:hover {
    background: #f8fbff;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 14px;
    background: linear-gradient(120deg, #6366f1 0%, #2563eb 100%);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}

.btn-link:hover {
    filter: brightness(0.95);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.stat-box {
    border: 1px solid #dbeafe;
    border-radius: 10px;
    padding: 14px;
    background: #f8fbff;
}

.stat-title {
    color: #64748b;
    font-size: 13px;
}

.stat-value {
    font-size: 24px;
    margin-top: 6px;
    font-weight: 700;
}

.user-manage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.stack-form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-row input {
    width: 16px;
    height: 16px;
}

.total-hours-box {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
}

.total-hours-box strong {
    color: #4338ca;
    font-size: 18px;
}

.center-title {
    text-align: center;
}

.field-block {
    margin-bottom: 8px;
}

.form-section-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #334155;
}

.login-form {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.full-btn {
    width: 100%;
}

.inline-input {
    width: 100%;
    min-width: 140px;
    padding: 6px 8px;
    font-size: 13px;
}

.time-input {
    min-width: 96px;
}

.op-cell {
    display: flex;
    gap: 8px;
    align-items: center;
}

.op-cell form {
    margin: 0;
}

@media (max-width: 760px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .segment-row {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .row {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid,
    .user-manage-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        margin: 28px auto 0;
        max-width: 100%;
        padding: 16px;
    }

    .login-form {
        gap: 10px;
    }
}
