/* ==========================================================
   GUIDANCE COUNSELING SESSIONS
========================================================== */

* {
    box-sizing: border-box;
}

.main-content {
    width: calc(100% - 260px) !important;
    max-width: none !important;
    margin-left: 260px !important;
    padding: 30px;
    min-height: 100vh;
    background: #f6f8fb;
}

/* ==========================================================
   PAGE HEADER
========================================================== */

.page-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0 0 6px;
    font-size: 28px;
    color: #1f2937;
}

.page-header p {
    margin: 0;
    color: #6b7280;
}

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

.primary-btn,
.secondary-btn {
    border: 0;
    border-radius: 9px;
    padding: 11px 17px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.primary-btn {
    background: #1f4e79;
    color: #fff;
}

.primary-btn:hover {
    background: #173d60;
}

.secondary-btn {
    background: #e5e7eb;
    color: #374151;
}

/* ==========================================================
   STATISTICS
========================================================== */

.stats-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card {
    min-width: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .04);
}

.stat-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 11px;
    background: #eef4f9;
    color: #1f4e79;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-card span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 4px;
}

.stat-card strong {
    font-size: 25px;
    color: #1f2937;
}

/* ==========================================================
   MAIN PANEL
========================================================== */

.panel {
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .04);
    overflow: hidden;
}

/* ==========================================================
   PANEL TOOLBAR
========================================================== */

.panel-toolbar {
    width: 100%;
    padding: 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid #e5e7eb;
}

/* ==========================================================
   SEARCH
========================================================== */

.search-box {
    width: min(540px, 100%);
    position: relative;
}

.search-box i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.search-box input,
.filter-group select,
.filter-group input {
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    padding: 0 12px;
    outline: none;
    font-size: 14px;
}

.search-box input {
    width: 100%;
    padding-left: 38px;
}

.search-box input:focus,
.filter-group select:focus,
.filter-group input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #1f4e79;
    box-shadow: 0 0 0 3px rgba(31, 78, 121, .10);
}

/* ==========================================================
   FILTER
========================================================== */

.filter-group {
    display: flex;
    gap: 10px;
}

/* ==========================================================
   TABLE
========================================================== */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.session-table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
}

.session-table th,
.session-table td {
    padding: 15px 16px;
    border-bottom: 1px solid #edf0f3;
    text-align: left;
    font-size: 14px;
    vertical-align: middle;
}

.session-table th {
    background: #fafbfc;
    color: #4b5563;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.student-cell strong,
.session-table td strong {
    display: block;
    color: #1f2937;
}

.student-cell small,
.session-table td small {
    display: block;
    color: #8a94a3;
    margin-top: 3px;
}

/* ==========================================================
   STATUS BADGES
========================================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-scheduled {
    background: #fff7ed;
    color: #c2410c;
}

.status-confirmed {
    background: #ecfdf3;
    color: #15803d;
}

.status-completed {
    background: #eff6ff;
    color: #1d4ed8;
}

.status-cancelled {
    background: #fef2f2;
    color: #b91c1c;
}

.status-no-show {
    background: #f3f4f6;
    color: #4b5563;
}

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

.action-buttons {
    display: flex;
    gap: 6px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #1f4e79;
    border-radius: 7px;
    cursor: pointer;
}

.icon-btn:hover {
    background: #f1f5f9;
}

.icon-btn.danger {
    color: #b91c1c;
}

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

.empty-state {
    text-align: center !important;
    padding: 50px !important;
    color: #8a94a3;
}

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

.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .55);
}

.modal.show {
    display: flex;
}

body.modal-open {
    overflow: hidden;
}

.modal-card {
    width: min(780px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .20);
}

.view-card {
    width: min(700px, 100%);
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    padding: 20px 22px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.modal-header h2 {
    margin: 0 0 5px;
    color: #1f2937;
}

.modal-header p {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

.close-modal {
    border: 0;
    background: transparent;
    font-size: 27px;
    color: #6b7280;
    cursor: pointer;
}

/* ==========================================================
   FORM
========================================================== */

#sessionForm {
    padding: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.form-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 13px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 7px;
}

.form-group label span {
    color: #dc2626;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
    outline: none;
    background: #fff;
}

.form-group input[readonly] {
    background: #f8fafc;
    color: #64748b;
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    margin-top: 22px;
    padding-top: 17px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==========================================================
   VIEW MODAL
========================================================== */

.view-grid {
    padding: 22px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.view-grid > div {
    padding: 14px;
    border: 1px solid #edf0f3;
    border-radius: 9px;
    background: #fafbfc;
}

.view-grid > div.full {
    grid-column: 1 / -1;
}

.view-grid span {
    display: block;
    color: #7b8491;
    font-size: 12px;
    margin-bottom: 6px;
    font-weight: 700;
    text-transform: uppercase;
}

.view-grid strong {
    color: #1f2937;
}

.view-grid p {
    margin: 0;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ==========================================================
   TOAST
========================================================== */

.toast {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 10000;
    min-width: 280px;
    max-width: 420px;
    padding: 13px 16px;
    border-radius: 9px;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    transform: translateY(25px);
    opacity: 0;
    pointer-events: none;
    transition: .25s;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: #15803d;
}

.toast.error {
    background: #b91c1c;
}

/* ==========================================================
   MOBILE SIDEBAR TOGGLE
   DO NOT CHANGE sidebar.js
========================================================== */

@media screen and (max-width: 992px) {

    body.sidebar-open #menuToggle,
    body.sidebar-open .menu-toggle,
    body.sidebar-open button#menuToggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* ==========================================================
   TABLET
========================================================== */

@media (max-width: 1100px) {

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }
}

/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 800px) {

    .main-content {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        padding: 20px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid,
    .view-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full,
    .view-grid > div.full {
        grid-column: auto;
    }

    .filter-group {
        flex-direction: column;
    }
}

/* ==========================================================
   SMALL MOBILE
========================================================== */

@media (max-width: 560px) {

    .main-content {
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 8px;
    }

    .modal-card {
        max-height: calc(100vh - 16px);
    }
}









/* ==========================================================
   FLEXIBLE GUIDANCE CASE SEARCH
   ========================================================== */
.case-search-group {
    position: relative;
}

.case-search-control {
    position: relative;
    width: 100%;
}

.case-search-control > i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #8a94a3;
    pointer-events: none;
}

.case-search-control input {
    width: 100%;
    min-height: 44px;
    padding-left: 40px !important;
}

.case-search-hint {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 12px;
}

.case-value-select {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.case-suggestions {
    position: absolute;
    top: calc(100% - 25px);
    left: 0;
    right: 0;
    z-index: 10020;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .16);
}

.case-suggestions[hidden] {
    display: none !important;
}

.case-suggestion-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    padding: 11px 14px;
    border: 0;
    border-bottom: 1px solid #edf0f3;
    background: #fff;
    color: #1f2937;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.case-suggestion-item:last-child {
    border-bottom: 0;
}

.case-suggestion-item:hover,
.case-suggestion-item:focus {
    background: #f1f5f9;
    outline: none;
}

.case-suggestion-item strong {
    color: #1f2937;
    font-size: 14px;
}

.case-suggestion-item span {
    color: #6b7280;
    font-size: 12px;
}

.case-suggestion-empty {
    padding: 14px;
    color: #6b7280;
    font-size: 13px;
}







