/* ============================================================
   Base Theme — CurricularApp UI Moderna
   Extraído de admin/base/base.html e aluno/base/base.html
   ============================================================ */

/* ── Background & Wrapper ── */
body {
    background:
        radial-gradient(circle at top right, rgba(19, 111, 99, 0.14), transparent 26%),
        radial-gradient(circle at bottom left, rgba(195, 140, 47, 0.1), transparent 24%),
        linear-gradient(180deg, #f8fbfd 0%, #eaf2f7 100%);
    color: #173247 !important;
}

#wrapper,
#page-wrapper,
.gray-bg,
.white-bg {
    background: transparent !important;
}

#page-wrapper {
    padding: 0 10px 24px !important;
}

/* ── Sidebar ── */
.navbar-static-side {
    background: linear-gradient(180deg, #0f2432 0%, #0b1a24 100%) !important;
    box-shadow: 12px 0 40px rgba(7, 20, 30, 0.14);
}

.navbar-static-side.ui-sidebar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.navbar-static-side.ui-sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.nav-header {
    background: rgba(255, 255, 255, 0.04) !important;
}

.logo-element {
    background: linear-gradient(135deg, #136f63 0%, #1d8c7d 100%) !important;
    border-radius: 16px;
}

#side-menu > li > a {
    color: rgba(242, 249, 252, 0.9);
    font-weight: 600;
    margin: 4px 12px;
    border-radius: 14px;
    padding: 14px 18px;
}

#side-menu > li.active > a,
#side-menu > li > a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

#side-menu .nav-second-level {
    margin: 0 12px 10px;
    padding: 8px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
}

#side-menu .nav-second-level li a {
    color: rgba(241, 247, 251, 0.82);
    border-radius: 10px;
    padding: 10px 14px;
}

#side-menu .nav-second-level li.active a,
#side-menu .nav-second-level li a:hover {
    color: #fff;
    background: rgba(19, 111, 99, 0.42);
}

/* ── Sidebar Personalizada (Aluno) ── */
body.is-aluno .navbar-static-side {
    background: linear-gradient(180deg, #2d0b4e 0%, #1a0533 100%) !important;
}
body.is-aluno #side-menu .nav-second-level li.active a,
body.is-aluno #side-menu .nav-second-level li a:hover {
    background: rgba(124, 58, 237, 0.42);
}

/* ── Topbar ── */
.ui-topbar {
    margin: 18px 18px 0;
}

.ui-topbar .navbar {
    margin-bottom: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92) !important;
    box-shadow: 0 18px 42px rgba(20, 48, 67, 0.1);
    padding: 10px 16px;
}

.ui-topbar .navbar-header {
    display: inline-flex;
    align-items: center;
    margin-right: 16px;
    padding-right: 14px;
    border-right: 1px solid #d5e1eb;
}

.ui-topbar .navbar-minimalize {
    width: 44px;
    height: 44px;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 14px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #173247 0%, #244864 100%) !important;
    border: 1px solid #0f2432 !important;
    color: #fff !important;
    box-shadow: 0 10px 20px rgba(20, 48, 67, 0.24);
}

.ui-topbar .navbar-minimalize:hover,
.ui-topbar .navbar-minimalize:focus {
    background: linear-gradient(135deg, #1d3e57 0%, #2a5675 100%) !important;
    color: #fff !important;
}

.ui-topbar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 6px;
    margin-left: 2px;
}

.ui-topbar__badge {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #edf5fb 0%, #dfeaf4 100%);
    color: #1e506f;
    border: 1px solid #c8d9e6;
    box-shadow: none;
}

.ui-topbar__eyebrow {
    margin: 0;
    color: #607589;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.12em;
    font-weight: 800;
}

.ui-topbar__title {
    margin: 2px 0 0;
    color: #173247;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.ui-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ui-topbar__actions > li > a {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 10px 14px !important;
    border-radius: 14px;
    background: #f4f8fb;
    color: #173247 !important;
    font-weight: 700;
}

/* ── Page Hero / Heading ── */
.ui-page-hero,
.row.wrapper.page-heading .col-lg-12 {
    position: relative;
    border-radius: 28px;
    padding: 30px 32px 28px;
    background:
        linear-gradient(135deg, rgba(19, 111, 99, 0.08) 0%, rgba(195, 140, 47, 0.06) 100%),
        rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 44px rgba(20, 48, 67, 0.1);
}

.page-heading h2,
.ui-page-hero h2 {
    margin: 0;
    color: #173247;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

/* ── Cards, Panels, Iboxes ── */
.ibox,
.panel,
.grade-shell,
.grade-card,
.compare-box {
    border-radius: 28px;
    box-shadow: 0 18px 44px rgba(20, 48, 67, 0.1);
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.85) !important;
}

.ibox-title,
.panel-heading {
    background: linear-gradient(180deg, #fcfeff 0%, #f2f7fa 100%) !important;
    border-bottom: 1px solid #d8e4ec !important;
    color: #173247 !important;
}

.ibox-content,
.panel-body {
    padding: 24px !important;
}

/* ── Tables ── */
.table > thead > tr > th {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
    color: #607589;
    background: #f7fbfd !important;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background: #f9fcfe !important;
}

.table > tbody > tr:hover {
    background: rgba(19, 111, 99, 0.04);
}

.table-responsive {
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e3edf3;
}

/* ── Forms ── */
.form-control,
select.form-control,
textarea.form-control {
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid #c7d6e1;
    background: rgba(249, 252, 253, 0.96);
}

/* ── Chosen Select ── */
.chosen-container {
    width: 100% !important;
    font-size: 14px;
}

.chosen-container-single .chosen-single,
.chosen-container-multi .chosen-choices {
    min-height: 46px;
    border-radius: 14px !important;
    border: 1px solid #c7d6e1 !important;
    background: rgba(249, 252, 253, 0.96) !important;
    box-shadow: none !important;
    padding: 6px 14px !important;
    display: flex;
    align-items: center;
}

.chosen-container-single .chosen-single span {
    color: #173247;
    line-height: 30px;
    margin-right: 28px;
}

.chosen-container-single .chosen-single div {
    right: 8px;
    top: 8px;
}

.chosen-container-active.chosen-with-drop .chosen-single,
.chosen-container-active .chosen-choices {
    border-color: #1d8c7d !important;
    box-shadow: 0 0 0 3px rgba(29, 140, 125, 0.12) !important;
}

.chosen-container .chosen-drop {
    margin-top: 8px;
    border: 1px solid #d8e4ec !important;
    border-radius: 16px !important;
    box-shadow: 0 18px 44px rgba(20, 48, 67, 0.14);
    overflow: hidden;
}

.chosen-container .chosen-results li {
    padding: 10px 14px;
    color: #173247;
}

.chosen-container .chosen-results li.highlighted {
    background: linear-gradient(135deg, #136f63 0%, #1d8c7d 100%) !important;
    color: #fff !important;
}

.chosen-container-multi .chosen-choices li.search-choice {
    background: #e8f5f2 !important;
    border: 1px solid #cde3df !important;
    border-radius: 999px !important;
    color: #136f63;
    padding: 6px 24px 6px 10px !important;
    box-shadow: none !important;
}

.chosen-container-multi .chosen-choices li.search-field input[type="text"] {
    color: #607589 !important;
    margin: 8px 0 !important;
}

/* ── DataTables ── */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 16px;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
    line-height: 1.4;
    overflow: visible;
    color: #4d6274;
    font-weight: 600;
}

.dataTables_wrapper .dataTables_length label > *,
.dataTables_wrapper .dataTables_filter label > * {
    flex: 0 0 auto;
}

.dataTables_wrapper .dataTables_length select {
    min-width: 72px;
    min-height: 34px;
    height: 34px;
    padding: 4px 28px 4px 10px;
    line-height: 1.4;
    border-radius: 10px;
    border: 1px solid #c7d6e1;
    background: #fff;
    vertical-align: middle;
}

.dataTables_wrapper .dataTables_filter input {
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid #c7d6e1;
    background: #fff;
    padding: 0 12px;
}

/* ── Buttons ── */
.btn {
    border-radius: 12px;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(20, 48, 67, 0.08);
}

.btn-primary,
.btn-main {
    background: linear-gradient(135deg, #136f63 0%, #1d8c7d 100%);
    border-color: #136f63;
}

.btn-danger {
    background: linear-gradient(135deg, #c64b4b 0%, #da6464 100%);
    border-color: #b73f3f;
}

.btn-import-csv {
    background-color: #1f7ae0;
    border-color: #1f7ae0;
    color: #fff;
}

.btn-import-csv:hover,
.btn-import-csv:focus,
.btn-import-csv:active {
    background-color: #1767bf;
    border-color: #1767bf;
    color: #fff;
}

/* ── Breadcrumb ── */
.breadcrumb {
    background: transparent !important;
    margin: 12px 0 0 !important;
    padding: 0 !important;
}

.breadcrumb > li,
.breadcrumb > .breadcrumb-item {
    color: #607589;
    font-weight: 600;
}

/* ── Page Actions ── */
.page-heading .pull-right,
.page-heading .page-actions {
    position: absolute;
    top: 30px;
    right: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    max-width: calc(100% - 64px);
    float: none !important;
}

.page-heading .pull-right > .btn,
.page-heading .pull-right > a.btn,
.page-heading .page-actions > .btn,
.page-heading .page-actions > a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    width: auto !important;
    white-space: nowrap;
    flex-shrink: 0;
    float: none !important;
}

.ui-page-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    float: none !important;
}

.modern-card-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.modern-card-footer > .btn,
.modern-card-footer > a.btn,
.modern-card-footer > button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.page-heading h2,
.page-heading .breadcrumb {
    max-width: 100%;
}

.page-heading .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 4px;
}

.page-heading .breadcrumb > .breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.page-heading .breadcrumb-item + .breadcrumb-item::before {
    float: none;
}

/* ── Balance Modal ── */
.balance-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 2050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.balance-modal.is-open {
    display: flex;
}

.balance-modal-dialog {
    width: min(560px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

.balance-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 22px 14px;
    border-bottom: 1px solid #e8eef5;
}

.balance-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #16324f;
}

.balance-modal-subtitle {
    color: #6b7a90;
    font-size: 13px;
    margin-top: 4px;
}

.balance-modal-close {
    border: none;
    background: #eef4fb;
    color: #16324f;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    flex: 0 0 auto;
}

/* ── Responsivo ── */
@media (max-width: 991px) {
    .page-heading .pull-right,
    .page-heading .page-actions {
        position: static;
        top: auto;
        right: auto;
        margin-top: 16px;
        max-width: 100%;
        justify-content: flex-start;
    }

    .page-heading h2,
    .page-heading .breadcrumb {
        max-width: 100%;
    }
}
