/* ==========================================================
   PAGE LAYOUT
========================================================== */

.page-container {
    padding: 20px;
    margin: 0 auto;
    max-width: 1200px;
    box-sizing: border-box;
}

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

.page-header h1 {
    margin: 0 0 22px 0;
    font-size: 22px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.school-year-selector {
    margin-top: 4px;
    font-size: 13px;
    color: #666;
}

.school-year-selector select {
    margin-left: 6px;
    height: 30px;
    font-size: 13px;
}


/* ==========================================================
   GROUP GRID & CARDS
========================================================== */

.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.group-card {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.group-card:hover {
    background: #f6f7f8;
}

.group-card h3 {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 600;
    color: #2f2f2f;
}

.group-card p {
    margin: 0;
    font-size: 13px;
    color: #666;
}


/* ==========================================================
   EMPTY STATE
========================================================== */

.empty-state {
    margin-top: 16px;
    color: #555;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

p.empty-state-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #777;
    font-style: italic;
    padding-top: 4px;
}


/* ==========================================================
   MODAL BASE STYLES
========================================================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    padding: 20px;
    width: 400px;
    border-radius: 6px;
}

.modal-lg {
    max-width: 600px;
}


/* ==========================================================
   MODAL FORMS
========================================================== */

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}

.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.form-row label {
    font-size: 13px;
    margin-bottom: 4px;
    color: #475569;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    margin-top: 6px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.form-section {
    margin-bottom: 20px;
}

.form-section h3 {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}


/* ==========================================================
   CLONE MODAL – OPTIONS
========================================================== */

.clone-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.clone-options .option-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.clone-options .option-row label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    color: #475569;
    font-size: 13px;
}

.clone-options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex: 0 0 auto;
}


/* ==========================================================
   MODAL ACTIONS
========================================================== */

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-content .form-error {
    margin-right: auto;
    padding: 6px 10px;
    font-size: 13px;
    color: #a50e0e;
    background: #fdecea;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    line-height: 1.4;
}


/* ==========================================================
   BUTTONS
========================================================== */

.primary-btn,
.secondary-btn {
    height: 34px;
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
}

.primary-btn {
    background: #ffffff;
    border: 1px solid #ccc;
}

.primary-btn:not(:disabled):hover {
    background: #f6f7f8;
    border-color: #999;
}

.secondary-btn {
    background: #e0e0e0;
    border: 1px solid #ccc;
}

.secondary-btn:not(:disabled):hover {
    background: #f5f7fb;
}

.tertiary-btn {
    height: 24px;
    padding: 3px 6px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid #ccc;
}

.tertiary-btn:not(:disabled):hover {
    background: #f6f7f8;
    border-color: #666;
}


.primary-sbtn,
.secondary-sbtn {
    height: 24px;
    padding: 3px 6px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
}

.primary-sbtn {
    background: #ffffff;
    border: 1px solid #ccc;
}

.primary-sbtn:not(:disabled):hover {
    background: #f6f7f8;
    border-color: #999;
}

.secondary-sbtn {
    background: #e0e0e0;
    border: 1px solid #ccc;
}

.secondary-sbtn:not(:disabled):hover {
    background: #f5f7fb;
}


/* ==========================================================
   DISABLED BUTTONS
========================================================== */

.primary-btn:disabled,
.secondary-btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    background-color: #e5e5e5;
    border-color: #ccc;
    color: #777;
}


/* ==========================================================
   UTILITY
========================================================== */

.hidden {
    display: none !important;
}