/* ===============================
   Milseong Attendance V2
   Common CSS
================================ */

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    font-size: 16px;
}

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f6f8;
    color: #111827;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
}

.app-body {
    min-height: 100vh;
}


/* ===============================
   Loading
================================ */

.loading {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.82);
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}


/* ===============================
   Toast
================================ */

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    min-width: 220px;
    max-width: calc(100% - 40px);
    padding: 14px 18px;
    border-radius: 999px;
    background: #111827;
    color: white;
    font-size: 0.95rem;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.25s ease;
    z-index: 99999;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* ===============================
   Login
================================ */

.login-page {
    min-height: 100vh;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 28px 22px;
    border-radius: 28px;
    background: white;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.app-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: white;
    font-weight: 900;
    font-size: 1rem;
}

.login-card h1 {
    margin: 0;
    text-align: center;
    font-size: 1.8rem;
    letter-spacing: -0.04em;
}

.sub-text {
    margin: 10px 0 22px;
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
}


/* ===============================
   Tabs
================================ */

.tab-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 5px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: #eef2f7;
}

.tab {
    border: 0;
    padding: 12px;
    border-radius: 999px;
    background: transparent;
    color: #6b7280;
    font-weight: 800;
    font-size: 1rem;
}

.tab.active {
    background: white;
    color: #2563eb;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}


/* ===============================
   Forms
================================ */

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.9rem;
    font-weight: 800;
    color: #374151;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    padding: 15px 14px;
    font-size: 1rem;
    background: white;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}


/* ===============================
   Buttons
================================ */

.primary-btn {
    width: 100%;
    border: 0;
    border-radius: 18px;
    padding: 16px;
    background: #2563eb;
    color: white;
    font-size: 1.05rem;
    font-weight: 900;
}

.primary-btn:active {
    transform: scale(0.98);
}

.secondary-btn {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 18px;
    padding: 15px;
    background: white;
    color: #111827;
    font-size: 1rem;
    font-weight: 800;
}

.danger-btn {
    width: 100%;
    border: 0;
    border-radius: 18px;
    padding: 15px;
    background: #ef4444;
    color: white;
    font-size: 1rem;
    font-weight: 900;
}


/* ===============================
   Mobile App Layout
================================ */

.mobile-app {
    max-width: 520px;
    min-height: 100vh;
    margin: 0 auto;
    background: #f5f6f8;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 18px 18px 12px;
    background: rgba(245, 246, 248, 0.92);
    backdrop-filter: blur(12px);
}

.app-title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.app-subtitle {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.app-content {
    padding: 12px 18px 28px;
}

.card {
    padding: 18px;
    margin-bottom: 14px;
    border-radius: 24px;
    background: white;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.card-title {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 900;
}

.muted {
    color: #6b7280;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #2563eb;
    font-size: 0.8rem;
    font-weight: 900;
}

.status-good {
    color: #2563eb;
    font-weight: 900;
}

.status-warn {
    color: #f59e0b;
    font-weight: 900;
}

.status-bad {
    color: #ef4444;
    font-weight: 900;
}


/* ===============================
   Lists
================================ */

.simple-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    padding: 14px;
    border-radius: 18px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.list-main {
    font-weight: 900;
}

.list-sub {
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.9rem;
}


/* ===============================
   Admin Base
================================ */

.admin-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px 1fr;
    background: #f3f4f6;
}

.admin-sidebar {
    background: #111827;
    color: white;
    padding: 24px 18px;
}

.admin-main {
    padding: 28px;
}

.admin-card {
    padding: 22px;
    border-radius: 20px;
    background: white;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}


/* ===============================
   Responsive
================================ */

@media (max-width: 700px) {
    .admin-layout {
        display: block;
    }

    .admin-sidebar {
        border-radius: 0 0 24px 24px;
    }

    .admin-main {
        padding: 18px;
    }
}