:root {
    --bg: #f1f4f8;
    --card: #ffffff;
    --primary: #2b6cb0;
    --text: #1c2430;
    --muted: #6b7785;
    --border: #d7dee8;
    --danger: #c0392b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background: var(--bg);
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #163a63;
    color: #fff;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.brand {
    font-size: 20px;
    font-weight: 600;
}

.nav a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.user {
    margin-top: auto;
    font-size: 14px;
}

.logout {
    color: #dbe7ff;
    text-decoration: none;
    font-size: 13px;
}

.content {
    flex: 1;
    padding: 24px 32px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.month-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.month-nav a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
}

.month-title {
    font-weight: 600;
}

.table-wrap {
    overflow-x: auto;
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.schedule {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.schedule th,
.schedule td {
    border: 1px solid var(--border);
    padding: 6px;
    text-align: center;
    vertical-align: top;
    font-size: 12px;
}

.schedule th {
    background: #edf2f7;
    position: sticky;
    top: 0;
    z-index: 2;
}

.sticky-left {
    position: sticky;
    left: 0;
    background: #f7fafc;
    z-index: 1;
    min-width: 180px;
}

.emp-name {
    font-weight: 600;
}

.emp-role {
    color: var(--muted);
    font-size: 12px;
}

.emp-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 12px;
}

.event {
    padding: 2px 4px;
    border-radius: 6px;
    margin-bottom: 4px;
}

.event.shift {
    background: #2b6cb0;
    color: #fff;
}

.event.absence {
    background: #f6ad55;
    color: #1a202c;
}

.add-event {
    display: inline-block;
    margin-top: 4px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.card-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.card-subtitle {
    color: var(--muted);
    margin-bottom: 12px;
}

.card-list {
    display: grid;
    gap: 10px;
}

.card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.card-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.form-grid label {
    display: grid;
    gap: 6px;
    font-size: 13px;
}

.form-grid input,
.form-grid select {
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
}

button,
.button {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
}

.danger {
    color: var(--danger);
    text-decoration: none;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-card {
    width: 320px;
    background: var(--card);
    padding: 24px;
    border-radius: 14px;
    border: 1px solid var(--border);
    display: grid;
    gap: 12px;
}

.error {
    background: #fed7d7;
    color: #7b1c1c;
    padding: 8px;
    border-radius: 8px;
}

.hint {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 900px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .nav {
        display: flex;
        gap: 12px;
    }
}
