/* ==========================================================================
   GLOBAL APP TOKENS & RESET
   ========================================================================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    background-color: #F3F4F6 !important;
    color: #111827 !important;
    font-size: 0.875rem !important;
}

.content-wrapper {
    background-color: #F3F4F6 !important;
}

a {
    cursor: pointer;
    color: #3B82F6;
    transition: color 0.15s ease-in-out;
}
a:hover {
    color: #1D4ED8;
    text-decoration: none;
}

.orka-bg {
    background-color: #1E3A8A !important;
}

/* Full-width brand logo in sidebar */
.brand-link {
    padding: 8px 12px !important;
    display: block !important;
}

.brand-link .brand-image {
    float: none !important;
    margin: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 6px;
    display: block;
}

.orka-text {
    color: #1E3A8A !important;
}

.help-block {
   margin-bottom: 0.5px;
}

.help-block > strong {
    font-size: 10px;
    color: #EF4444;
}

.orka-loader {
    display: none;
    transition: opacity 500ms ease-in;
}
.htmx-request .orka-loader,
.htmx-request.orka-loader {
    display: inline-block;
}

.page-size-select {
    margin-right: 5px;
    width: 15px;
}

.form-inline .form-group {
    margin: 4px;
}

.d-none {
    display: none !important;
}

#orkaScrollToTopButton {
    display: none;
    position: fixed;
    bottom: 40px;
    right: 30px;
    z-index: 99;
}

.django-ckeditor-widget {
    width: 100%;
}

/* ==========================================================================
   NAVBAR — Institute Badge
   ========================================================================== */
.orka-institute-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px 5px 6px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    text-decoration: none !important;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    max-width: 260px;
}

.orka-institute-badge:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.orka-institute-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(59, 130, 246, 0.25);
    flex-shrink: 0;
}

.orka-institute-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1E3A8A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.orka-logout-btn {
    color: #EF4444 !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
    transition: background 0.15s !important;
}

.orka-logout-btn:hover {
    background: rgba(239, 68, 68, 0.08) !important;
}



/* ==========================================================================
   GLOBAL CONTAINER SPACING, SHADOWS, & BORDER RADII
   ========================================================================== */
.card, .box, .info-box {
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
    background-color: #FFFFFF !important;
    overflow: hidden;
    margin-bottom: 24px;
    padding: 0 !important;
}

.card-header {
    background-color: #FFFFFF !important;
    border-bottom: 1px solid #E5E7EB !important;
    padding: 16px 20px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    color: #1E3A8A !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    margin: 0 !important;
    float: none !important;    /* reset AdminLTE float; parent is now flex */
    flex: 1 1 auto;            /* take available space but allow card-tools to sit beside it */
}

/* Fix: card-tools was invisible because AdminLTE uses float:right
   which is ignored inside a flexbox container. Explicitly position
   it at the right end of the flex row with auto left-margin. */
.card-header > .card-tools {
    float: none !important;
    margin-right: 0 !important;
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Fix btn-tool negative margin from AdminLTE that squashes widget buttons */
.card-header > .card-tools .btn-tool {
    margin: 0 !important;
    color: #6B7280 !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.card-header > .card-tools .btn-tool:hover {
    background-color: #E0F2FE !important;
    color: #1E3A8A !important;
}

.card-body {
    padding: 20px !important;
}

.card-footer {
    background-color: #FFFFFF !important;
    border-top: 1px solid #E5E7EB !important;
    padding: 16px 20px !important;
}

/* Top Accent Card Header Borders */
.card-header.bg-primary {
    border-left: 4px solid #3B82F6 !important;
    background: transparent !important;
}
.card-header.bg-success {
    border-left: 4px solid #00CC89 !important;
    background: transparent !important;
}
.card-header.bg-warning {
    border-left: 4px solid #FBBF24 !important;
    background: transparent !important;
}
.card-header.bg-danger {
    border-left: 4px solid #EF4444 !important;
    background: transparent !important;
}
.card-header.bg-info {
    border-left: 4px solid #3B82F6 !important;
    background: transparent !important;
}

.card-header.bg-primary .card-title,
.card-header.bg-success .card-title,
.card-header.bg-warning .card-title,
.card-header.bg-danger .card-title,
.card-header.bg-info .card-title {
    color: #1E3A8A !important;
}

/* ==========================================================================
   SIDEBAR & MAIN BRAND OVERRIDES
   ========================================================================== */
.main-sidebar {
    background-color: #F9FAFB !important;
    border-right: 1px solid #E5E7EB !important;
    box-shadow: none !important;
}

.brand-link {
    background-color: #F9FAFB !important;
    border-bottom: 1px solid #E5E7EB !important;
    color: #1E3A8A !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    padding: 15px !important;
    display: flex;
    align-items: center;
}

.brand-link:hover {
    color: #1E3A8A !important;
}

.user-panel {
    border-bottom: 1px solid #E5E7EB !important;
    margin-bottom: 15px !important;
    padding-bottom: 15px !important;
}

.sidebar nav ul {
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
}

.sidebar .nav-link {
    color: #4B5563 !important;
    border-radius: 8px !important;
    margin-bottom: 4px !important;
    padding: 8px 12px !important;
    transition: all 0.2s ease-in-out;
}

.sidebar .nav-link:hover {
    background-color: #E0F2FE !important;
    color: #1E3A8A !important;
}

.sidebar .nav-link.active,
.sidebar .nav-item.menu-open > .nav-link {
    background-color: #E0F2FE !important;
    color: #1E3A8A !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

.sidebar .nav-link.active i,
.sidebar .nav-link:hover i {
    color: #1E3A8A !important;
}

.main-header {
    background-color: #FFFFFF !important;
    border-bottom: 1px solid #E5E7EB !important;
    box-shadow: none !important;
}

.main-header .nav-link {
    color: #4B5563 !important;
}

.main-header .nav-link:hover {
    color: #1E3A8A !important;
}

/* ==========================================================================
   METRIC CARDS (DASHBOARD WIDGETS)
   ========================================================================== */
.small-box {
    background: #FFFFFF !important;
    color: #111827 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
    border-top: 4px solid #D1D5DB !important;
    padding: 20px !important;
    margin-bottom: 24px !important;
    position: relative;
    display: block;
    overflow: hidden;
}

.small-box.bg-primary {
    border-top-color: #3B82F6 !important;
}
.small-box.bg-green, .small-box.bg-success {
    border-top-color: #00CC89 !important;
}
.small-box.bg-yellow, .small-box.bg-warning {
    border-top-color: #FBBF24 !important;
}
.small-box.bg-red, .small-box.bg-danger {
    border-top-color: #EF4444 !important;
}

.small-box .inner {
    padding: 0 !important;
    margin-bottom: 12px !important;
}

.small-box h3 {
    font-size: 2rem !important;
    font-weight: 700 !important;
    margin: 0 0 6px 0 !important;
    color: #111827 !important;
    font-family: 'Inter', sans-serif !important;
    letter-spacing: -0.025em;
}

.small-box p {
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    color: #4B5563 !important;
    margin: 0 !important;
}

.small-box small {
    font-size: 0.75rem !important;
    color: #9CA3AF !important;
}

.small-box .small-box-footer {
    display: inline-flex !important;
    align-items: center;
    background: transparent !important;
    color: #3B82F6 !important;
    font-weight: 600 !important;
    padding: 0 !important;
    font-size: 0.875rem !important;
    text-decoration: none !important;
    transition: color 0.15s ease-in-out;
}

.small-box .small-box-footer:hover {
    color: #1D4ED8 !important;
}

.small-box .small-box-footer i {
    margin-left: 6px !important;
    font-size: 0.8rem !important;
}

.small-box .small-box-footer i.fa-arrow-circle-right::before {
    content: "\f054" !important;
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
}

.small-box .icon {
    display: none !important;
}

/* ==========================================================================
   BUTTONS AND ACTIONS
   ========================================================================== */
.btn {
    border-radius: 8px !important;
    padding: 8px 16px !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    box-shadow: none !important;
    transition: all 0.2s ease-in-out;
    border: none !important;
}

.btn-primary {
    background-color: #3B82F6 !important;
    color: #FFFFFF !important;
}
.btn-primary:hover {
    background-color: #2563EB !important;
}

.btn-success {
    background-color: #00CC89 !important;
    color: #FFFFFF !important;
}
.btn-success:hover {
    background-color: #059669 !important;
}

.btn-danger {
    background-color: #EF4444 !important;
    color: #FFFFFF !important;
}
.btn-danger:hover {
    background-color: #DC2626 !important;
}

.btn-warning {
    background-color: #FBBF24 !important;
    color: #1F2937 !important;
}
.btn-warning:hover {
    background-color: #D97706 !important;
}

/* ==========================================================================
   TABLES & DATA GRIDS
   ========================================================================== */
.table {
    width: 100% !important;
    border-collapse: collapse !important;
    color: #111827 !important;
    background-color: #FFFFFF !important;
}

.table thead th {
    background-color: #F3F4F6 !important;
    color: #111827 !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    font-size: 0.75rem !important;
    padding: 12px 16px !important;
    border: none !important;
    border-bottom: 2px solid #E5E7EB !important;
}

.table tbody td {
    padding: 14px 16px !important;
    border: none !important;
    border-bottom: 1px solid #E5E7EB !important;
    vertical-align: middle !important;
    font-size: 0.875rem !important;
}

.table tbody tr:last-child td {
    border-bottom: none !important;
}

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

.table-hover tbody tr:hover {
    background-color: #F3F4F6 !important;
}

/* Action button overrides as soft-tinted rounded badges */
.table .btn-sm, .table .btn-xs,
.table td a.btn, .table td button.btn {
    padding: 6px 12px !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    display: inline-block;
    text-align: center;
    border: none !important;
}

.table .btn-info, .table td a.btn-info {
    background-color: #E0F2FE !important;
    color: #0369A1 !important;
}
.table .btn-info:hover, .table td a.btn-info:hover {
    background-color: #BAE6FD !important;
    color: #0369A1 !important;
}

.table .btn-success, .table td a.btn-success {
    background-color: #D1FAE5 !important;
    color: #065F46 !important;
}
.table .btn-success:hover, .table td a.btn-success:hover {
    background-color: #A7F3D0 !important;
    color: #065F46 !important;
}

.table .btn-danger, .table td a.btn-danger {
    background-color: #FEE2E2 !important;
    color: #991B1B !important;
}
.table .btn-danger:hover, .table td a.btn-danger:hover {
    background-color: #FCA5A5 !important;
    color: #991B1B !important;
}

.table .btn-warning, .table td a.btn-warning {
    background-color: #FEF3C7 !important;
    color: #92400E !important;
}
.table .btn-warning:hover, .table td a.btn-warning:hover {
    background-color: #FDE68A !important;
    color: #92400E !important;
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-control,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border: 1px solid #D1D5DB !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    font-size: 0.875rem !important;
    color: #111827 !important;
    background-color: #FFFFFF !important;
    box-shadow: none !important;
    height: auto !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.form-control:focus,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #3B82F6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    outline: none !important;
}

label, .control-label {
    font-weight: 500 !important;
    color: #374151 !important;
    margin-bottom: 6px !important;
    font-size: 0.875rem !important;
}

/* Form headers styling in deep indigo */
legend, h4, h5, .form-section-header {
    color: #1E3A8A !important;
    font-weight: 600 !important;
    font-family: 'Inter', sans-serif !important;
    margin-top: 24px !important;
    margin-bottom: 16px !important;
    border: none !important;
}

/* django-select2 overrides */
.select2-selection__choice {
    background-color: #E0F2FE !important;
    border: 1px solid #E0F2FE !important;
    color: #1E3A8A !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #1E3A8A !important;
    margin-right: 6px !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #EF4444 !important;
}

.select2-container {
    width: 100% !important;
}
