:root {
    --primary-color: #4a90e2;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333;
    --border-color: #e0e0e0;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
}

/* [Admin Menu Responsive Container] */
.admin-menu-container {
    background: white;
    padding: 10px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 10px;
    border: 1px solid #f1f3f5;
    flex-wrap: wrap;
    /* Allow wrapping */
    justify-content: center;
    /* Center items */
    margin-bottom: 20px;
}

/* Mobile specific for admin buttons */
@media (max-width: 768px) {
    .admin-menu-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 10px;
        /* Reduced padding */
    }

    .admin-menu-container .btn-action {
        width: 100%;
        /* Full width in grid cell */
        justify-content: center;
        text-align: center;
        padding: 8px;
        /* Taller touch target */
    }

    /* Hide the divider on mobile or make it full width? Hide it. */
    .admin-menu-divider {
        display: none;
    }

    /* Make label take full width */
    .admin-menu-label {
        grid-column: 1 / -1;
        justify-content: center;
        margin-bottom: 5px;
    }
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #666;
    font-size: 0.9rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.6rem;
        /* Adjusted size */
        word-break: keep-all;
        line-height: 1.4;
    }

    .mobile-break {
        display: block;
        /* Force break on mobile */
        content: "";
        /* Ensure it takes space if needed, though BR usually works */
    }
}

/* Desktop default: Hide break */
.mobile-break {
    display: none;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 20px;
}

.card-header {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 0.95rem;
}

.form-row {
    display: flex;
    gap: 10px;
}

.small-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 2px;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background-color: #357abd;
}

/* Child List Styles - COMPACT REDESIGN */
.child-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 600px;
    overflow-y: auto;
}

.child-item {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    /* Reduced padding */
    margin-bottom: 8px;
    /* Tighter spacing */
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    /* Space between Content and Actions */
    align-items: center;
}

.child-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.child-content {
    flex: 1;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* Space between Header and Meta */
}

/* Row 1: Name, Level, Group */
.child-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.child-name {
    font-size: 1.05rem;
    font-weight: bold;
    color: #333;
}

/* Row 2: Meta Info */
.child-meta-row {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-divider {
    color: #ccc;
    font-size: 0.7rem;
}

.d-day {
    color: #e03131;
    font-weight: bold;
    font-size: 0.8rem;
    margin-left: 3px;
}

/* Badges - Compact */
.group-badge {
    background: #e7f5ff;
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.level-badge {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.level-1 {
    background-color: #d8f5a2;
    color: #5c940d;
}

.level-2 {
    background-color: #ffc078;
    color: #d9480f;
}

.level-3 {
    background-color: #ff8787;
    color: #c92a2a;
}

/* Action Buttons */
.child-actions {
    display: flex;
    gap: 6px;
    margin-left: 15px;
}

.btn-action {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
}

.btn-action:hover {
    background: #f1f3f5;
}

.btn-delete {
    color: #e03131;
    border-color: #ffa8a8;
}

.btn-delete:hover {
    background: #fff5f5;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: white;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
}

.modal-header {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 15px;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 0;
    top: 0;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 1.2rem;
}

/* Child Manager Modal Styles */
.tab-btn {
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn.active {
    border-bottom: 2px solid var(--primary-color) !important;
    color: var(--primary-color) !important;
}

.tab-btn:hover {
    background-color: #f8f9fa !important;
}

.cm-item {
    padding: 10px;
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.1s;
}

.cm-item:hover {
    background: #f8f9fa;
}

.cm-item.terminated label {
    color: #888;
}

.cm-item:last-child {
    border-bottom: none;
}