/* ==========================================================================
   Soft UI Dashboard - Custom Design System
   Built on Bootstrap 5 | Inspired by Creative Tim Soft UI Dashboard
   ========================================================================== */

/* ==========================================================================
   1. CSS Custom Properties
   ========================================================================== */
:root {
    /* Colors - primary comes from tema.js (--bs-primary) */
    --sui-secondary: #8392ab;
    --sui-success: #82d616;
    --sui-info: #17c1e8;
    --sui-warning: #fbcf33;
    --sui-danger: #ea0606;
    --sui-dark: #344767;
    --sui-light: #e9ecef;

    /* Shadows */
    --sui-shadow: 0 20px 27px 0 rgba(0, 0, 0, 0.05);
    --sui-shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.04);
    --sui-shadow-lg: 0 23px 45px -11px rgba(0, 0, 0, 0.12);
    --sui-shadow-btn: 0 3px 5px -1px rgba(0, 0, 0, 0.09), 0 2px 3px -1px rgba(0, 0, 0, 0.07);
    --sui-shadow-btn-hover: 0 14px 26px -12px rgba(var(--bs-primary-rgb), 0.4);

    /* Border Radius */
    --sui-radius: 1rem;
    --sui-radius-sm: 0.5rem;
    --sui-radius-lg: 1.25rem;
    --sui-radius-xl: 1.5rem;

    /* Sidebar */
    --sui-sidenav-width: 250px;
    --sui-sidenav-bg: #ffffff;

    /* Transitions */
    --sui-transition: all 0.15s ease;
    --sui-transition-long: all 0.3s ease;

    /* Body */
    --sui-body-bg: #f8f9fa;
    --sui-body-color: #344767;
    --sui-text-secondary: #67748e;
}

[data-bs-theme="dark"] {
    --sui-body-bg: #1a2035;
    --sui-body-color: #ffffffcc;
    --sui-text-secondary: #ffffff99;
    --sui-shadow: 0 20px 27px 0 rgba(0, 0, 0, 0.15);
    --sui-shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.12);
    --sui-shadow-lg: 0 23px 45px -11px rgba(0, 0, 0, 0.25);
    --sui-sidenav-bg: #1e1e2f;
}

/* ==========================================================================
   2. Global / Body / Typography
   ========================================================================== */
body {
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--sui-body-bg) !important;
    color: var(--sui-body-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-bs-theme="dark"] body {
    background-color: var(--sui-body-bg) !important;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 700;
    color: var(--sui-dark);
    letter-spacing: -0.02em;
}

[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6,
[data-bs-theme="dark"] .h1,
[data-bs-theme="dark"] .h2,
[data-bs-theme="dark"] .h3,
[data-bs-theme="dark"] .h4,
[data-bs-theme="dark"] .h5,
[data-bs-theme="dark"] .h6 {
    color: #ffffffee;
}

.text-muted {
    color: var(--sui-text-secondary) !important;
}

/* Text xxs for table headers (Soft UI pattern) */
.text-xxs {
    font-size: 0.65rem !important;
}

/* ==========================================================================
   3. Bootstrap Component Overrides
   ========================================================================== */

/* --- 3a: Cards --- */
.card {
    border: 0 !important;
    border-radius: var(--sui-radius) !important;
    box-shadow: var(--sui-shadow);
    transition: var(--sui-transition-long);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--sui-shadow-lg);
}

[data-bs-theme="dark"] .card {
    background-color: #202940 !important;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
    padding: 1.25rem 1.5rem 1rem;
}

[data-bs-theme="dark"] .card-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.card-body {
    padding: 1.25rem 1.5rem;
}

.card-footer {
    background: transparent !important;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .card-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* --- 3b: Buttons --- */
.btn {
    border-radius: var(--sui-radius-sm);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    padding: 0.625rem 1.5rem;
    transition: var(--sui-transition);
    box-shadow: var(--sui-shadow-btn);
    text-transform: uppercase;
    line-height: 1.4;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--sui-shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.7rem;
    text-transform: none;
    font-weight: 600;
    box-shadow: none;
}

.btn-sm:hover {
    transform: none;
    box-shadow: var(--sui-shadow-sm);
}

.btn-primary {
    background: linear-gradient(310deg, var(--bs-primary) 0%, color-mix(in srgb, var(--bs-primary) 75%, #fff) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(310deg, var(--bs-primary) 0%, color-mix(in srgb, var(--bs-primary) 75%, #fff) 100%);
    box-shadow: 0 14px 26px -12px rgba(var(--bs-primary-rgb), 0.4);
    opacity: 0.92;
}

.btn-success {
    background: linear-gradient(310deg, #17ad37 0%, #98ec2d 100%);
    border: none;
}

.btn-info {
    background: linear-gradient(310deg, #2152ff 0%, #21d4fd 100%);
    border: none;
    color: #fff;
}

.btn-info:hover { color: #fff; }

.btn-warning {
    background: linear-gradient(310deg, #f53939 0%, #fbcf33 100%);
    border: none;
}

.btn-danger {
    background: linear-gradient(310deg, #ea0606 0%, #ff667c 100%);
    border: none;
}

.btn-dark {
    background: linear-gradient(310deg, #141727 0%, #3a416f 100%);
    border: none;
}

.btn-outline-primary {
    border: 1px solid var(--bs-primary);
    color: var(--bs-primary);
    background: transparent;
    box-shadow: none;
}

.btn-outline-primary:hover {
    background: var(--bs-primary);
    color: #fff;
    box-shadow: 0 14px 26px -12px rgba(var(--bs-primary-rgb), 0.4);
}

.btn-outline-secondary {
    border: 1px solid var(--sui-secondary);
    color: var(--sui-secondary);
    background: transparent;
    box-shadow: none;
}

.btn-outline-secondary:hover {
    background: var(--sui-secondary);
    color: #fff;
}

.btn-outline-danger {
    border: 1px solid var(--sui-danger);
    color: var(--sui-danger);
    background: transparent;
    box-shadow: none;
}

.btn-outline-danger:hover {
    background: var(--sui-danger);
    color: #fff;
}

.btn-outline-success {
    border: 1px solid #82d616;
    color: #82d616;
    background: transparent;
    box-shadow: none;
}

.btn-outline-success:hover {
    background: #82d616;
    color: #fff;
}

/* Reset uppercase for pill buttons (nav pills, tags) */
.rounded-pill.btn {
    text-transform: none;
}

/* --- 3c: Tables --- */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table > :not(caption) > * > * {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    padding: 0.75rem 1rem;
}

[data-bs-theme="dark"] .table > :not(caption) > * > * {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.table > thead > tr > th {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sui-text-secondary);
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table-hover > tbody > tr {
    transition: background-color 0.15s ease;
}

.table-hover > tbody > tr:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.03) !important;
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* --- 3d: Forms --- */
.form-control,
.form-select {
    border-radius: var(--sui-radius-sm);
    border: 1px solid #d2d6da;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: var(--sui-transition);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    border-color: rgba(255, 255, 255, 0.15);
    background-color: #1a2035;
    color: #ffffffcc;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.15);
}

.form-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--sui-dark);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.375rem;
}

[data-bs-theme="dark"] .form-label {
    color: #ffffffbb;
}

.form-control-sm,
.form-select-sm {
    border-radius: var(--sui-radius-sm);
    font-size: 0.8rem;
}

.form-check-input {
    border-radius: 0.35rem;
    border: 1px solid #d2d6da;
    width: 1.25rem;
    height: 1.25rem;
    transition: var(--sui-transition);
}

.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 2px rgba(var(--bs-primary-rgb), 0.15);
}

/* Switch - Soft UI style */
.form-switch .form-check-input {
    border-radius: 1rem;
    height: 1.25rem;
    width: 2.5rem;
}

.input-group-text {
    border-radius: var(--sui-radius-sm);
    border: 1px solid #d2d6da;
    background-color: #fff;
    font-size: 0.875rem;
}

[data-bs-theme="dark"] .input-group-text {
    background-color: #202940;
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffffcc;
}

.input-group > .form-control:first-child,
.input-group > .input-group-text:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group > .form-control:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* --- 3e: Badges --- */
.badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.45em 0.775em;
    letter-spacing: 0.02em;
    border-radius: var(--sui-radius-sm);
}

.badge.rounded-pill {
    border-radius: 50rem;
}

/* Subtle badges */
.bg-success-subtle { background-color: rgba(130, 214, 22, 0.12) !important; }
.text-success { color: #82d616 !important; }
.bg-primary-subtle { background-color: rgba(var(--bs-primary-rgb), 0.12) !important; }
.bg-danger-subtle { background-color: rgba(234, 6, 6, 0.12) !important; }
.bg-warning-subtle { background-color: rgba(251, 207, 51, 0.12) !important; }
.bg-info-subtle { background-color: rgba(23, 193, 232, 0.12) !important; }

/* --- 3f: Dropdowns --- */
.dropdown-menu {
    border: 0;
    border-radius: var(--sui-radius-sm);
    box-shadow: var(--sui-shadow-lg);
    padding: 0.5rem 0;
    animation: sui-dropdown-show 0.2s ease;
}

@keyframes sui-dropdown-show {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: var(--sui-radius-sm);
    margin: 0 0.3rem;
    width: auto;
    transition: var(--sui-transition);
}

.dropdown-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.06);
}

.dropdown-divider {
    margin: 0.25rem 0;
}

/* --- 3g: List Groups --- */
.list-group-item {
    border-left: 0;
    border-right: 0;
    border-top: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    padding: 0.875rem 1.25rem;
    transition: var(--sui-transition);
}

[data-bs-theme="dark"] .list-group-item {
    border-bottom-color: rgba(255, 255, 255, 0.06);
    background-color: transparent;
}

.list-group-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.03);
}

/* --- 3h: Modals --- */
.modal-content {
    border: 0;
    border-radius: var(--sui-radius);
    box-shadow: var(--sui-shadow-lg);
}

/* --- 3i: Alerts --- */
.alert {
    border: 0;
    border-radius: var(--sui-radius-sm);
    box-shadow: var(--sui-shadow-sm);
}

/* --- 3j: Breadcrumbs --- */
.breadcrumb {
    font-size: 0.875rem;
    margin-bottom: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: var(--sui-text-secondary);
}

/* --- 3k: Pagination --- */
.page-link {
    border-radius: var(--sui-radius-sm);
    border: 0;
    margin: 0 0.15rem;
    font-size: 0.875rem;
    min-width: 36px;
    text-align: center;
}

/* --- 3l: Nav Tabs/Pills --- */
.nav-pills .nav-link {
    border-radius: var(--sui-radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: var(--sui-transition);
}

.nav-pills .nav-link.active {
    background: var(--bs-primary);
    box-shadow: 0 4px 6px rgba(var(--bs-primary-rgb), 0.3);
}

/* ==========================================================================
   4. Soft UI Sidebar
   ========================================================================== */
.sui-sidenav {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sui-sidenav-width);
    height: 100vh;
    background: var(--sui-sidenav-bg);
    z-index: 1080;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease, width 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.1) transparent;
    border-right: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.sui-sidenav::-webkit-scrollbar {
    width: 4px;
}

.sui-sidenav::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

/* Sidebar Header */
.sui-sidenav-header {
    padding: 1.5rem 1.5rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sui-sidenav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #344767;
}

.sui-sidenav-brand i {
    font-size: 1.25rem;
    color: #344767;
}

.sui-sidenav-brand span {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sui-sidenav-close {
    display: none;
    background: none;
    border: none;
    color: rgba(52, 71, 103, 0.6);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

.sui-sidenav-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.1), transparent);
    margin: 0.75rem 1rem;
}

/* Sidebar Section Header */
.sui-nav-section {
    padding: 1rem 1.5rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(52, 71, 103, 0.5);
}

/* Sidebar Nav Items */
.sui-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sui-nav-item {
    padding: 0 0.75rem;
    margin-bottom: 2px;
}

.sui-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: var(--sui-radius-sm);
    color: #67748e;
    text-decoration: none;
    font-size: 0.825rem;
    font-weight: 600;
    transition: var(--sui-transition);
    white-space: nowrap;
}

.sui-nav-link:hover {
    color: #344767;
    background: rgba(0, 0, 0, 0.04);
}

.sui-nav-link.active {
    color: #344767;
    background: #f0f2f5;
    box-shadow: none;
}

.sui-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 0;
    background: none;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: var(--sui-transition);
}

.sui-nav-link.active .sui-nav-icon {
    background: none;
    color: #344767;
    box-shadow: none;
}

.sui-nav-badge {
    margin-left: auto;
    font-size: 0.6rem;
    padding: 0.2em 0.55em;
}

/* ==========================================================================
   Sidebar Hidden State (Desktop toggle)
   ========================================================================== */
.sui-sidenav.hidden {
    transform: translateX(-100%);
}

.sui-main-content.sidebar-hidden {
    margin-left: 0;
}

/* Sidebar overlay for mobile */
.sui-sidenav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1079;
    backdrop-filter: blur(2px);
}

.sui-sidenav-overlay.show {
    display: block;
}

/* ==========================================================================
   5. Soft UI Navbar
   ========================================================================== */
.sui-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 1040;
    transition: var(--sui-transition-long);
    margin: 0.75rem 0.75rem 0;
    border-radius: var(--sui-radius);
}

.sui-navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: var(--sui-shadow-sm);
}

[data-bs-theme="dark"] .sui-navbar.scrolled {
    background: rgba(26, 32, 53, 0.85);
}

.sui-navbar-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.sui-navbar-breadcrumb {
    font-size: 0.75rem;
    color: var(--sui-text-secondary);
}

.sui-navbar-breadcrumb a {
    color: var(--sui-text-secondary);
    text-decoration: none;
}

.sui-navbar-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--sui-dark);
    margin: 0;
}

[data-bs-theme="dark"] .sui-navbar-title {
    color: #ffffffee;
}

.sui-navbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sui-navbar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--sui-dark);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--sui-radius-sm);
    transition: var(--sui-transition);
}

.sui-navbar-toggle:hover {
    background: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] .sui-navbar-toggle {
    color: #ffffffcc;
}

/* Notification buttons in navbar */
.sui-nav-notification {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--sui-radius-sm);
    background: transparent;
    color: var(--sui-dark);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--sui-transition);
    text-decoration: none;
}

[data-bs-theme="dark"] .sui-nav-notification {
    color: #ffffffcc;
}

.sui-nav-notification:hover {
    background: rgba(var(--bs-primary-rgb), 0.06);
    color: var(--bs-primary);
}

.sui-nav-notification .badge {
    position: absolute;
    top: 2px;
    right: 0px;
    font-size: 0.55rem;
    padding: 2px 5px;
    min-width: 16px;
}

/* ==========================================================================
   6. Soft UI Footer
   ========================================================================== */
.sui-footer {
    padding: 0.4rem 1.5rem;
    margin-top: auto;
    font-size: 0.78rem;
    color: var(--sui-text-secondary);
    border-top: 1px solid var(--bs-border-color);
}

/* ==========================================================================
   7. Main Content Area
   ========================================================================== */
.sui-main-content {
    margin-left: var(--sui-sidenav-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

/* ==========================================================================
   8. Utility Classes
   ========================================================================== */
/* Gradient backgrounds */
.bg-gradient-primary {
    background: linear-gradient(310deg, var(--bs-primary), color-mix(in srgb, var(--bs-primary) 75%, #fff)) !important;
}

.bg-gradient-dark {
    background: linear-gradient(310deg, #141727, #3a416f) !important;
}

.bg-gradient-success {
    background: linear-gradient(310deg, #17ad37, #98ec2d) !important;
}

.bg-gradient-info {
    background: linear-gradient(310deg, #2152ff, #21d4fd) !important;
}

.bg-gradient-warning {
    background: linear-gradient(310deg, #f53939, #fbcf33) !important;
}

.bg-gradient-danger {
    background: linear-gradient(310deg, #ea0606, #ff667c) !important;
}

/* Soft shadow */
.shadow-soft {
    box-shadow: var(--sui-shadow) !important;
}

/* Text gradient */
.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Opacity helper for setting headers */
.opacity-7 {
    opacity: 0.7;
}

/* font-weight helper (Soft UI uses this pattern a lot) */
.font-weight-bolder {
    font-weight: 700 !important;
}

/* ==========================================================================
   9. SweetAlert2 Overrides
   ========================================================================== */
.swal2-popup {
    border-radius: var(--sui-radius) !important;
    box-shadow: var(--sui-shadow-lg) !important;
    font-family: "Open Sans", sans-serif !important;
    padding: 2rem !important;
}

.swal2-title {
    font-weight: 700 !important;
    color: var(--sui-dark) !important;
    font-size: 1.25rem !important;
}

.swal2-html-container {
    color: var(--sui-text-secondary) !important;
    font-size: 0.875rem !important;
}

.swal2-styled.swal2-confirm {
    background: linear-gradient(310deg, var(--bs-primary), color-mix(in srgb, var(--bs-primary) 75%, #fff)) !important;
    border-radius: var(--sui-radius-sm) !important;
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.02em !important;
    padding: 0.625rem 1.5rem !important;
    box-shadow: var(--sui-shadow-btn) !important;
}

.swal2-styled.swal2-cancel {
    background: linear-gradient(310deg, #8392ab, #a8b8d8) !important;
    border-radius: var(--sui-radius-sm) !important;
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    padding: 0.625rem 1.5rem !important;
}

.swal2-styled.swal2-deny {
    background: linear-gradient(310deg, #ea0606, #ff667c) !important;
    border-radius: var(--sui-radius-sm) !important;
}

[data-bs-theme="dark"] .swal2-popup {
    background-color: #202940 !important;
}

[data-bs-theme="dark"] .swal2-title {
    color: #ffffffee !important;
}

[data-bs-theme="dark"] .swal2-html-container {
    color: #ffffff99 !important;
}

/* ==========================================================================
   10. Responsive Overrides
   ========================================================================== */
@media (max-width: 991.98px) {
    .sui-sidenav {
        transform: translateX(-100%);
    }

    .sui-sidenav.show {
        transform: translateX(0);
    }

    .sui-sidenav-close {
        display: block;
    }

    .sui-main-content {
        margin-left: 0;
    }

    .sui-navbar {
        margin: 0.5rem;
    }
}

@media (max-width: 575.98px) {
    .sui-navbar {
        padding: 0.5rem 0.75rem;
    }

    .sui-navbar-right .d-none-sm {
        display: none !important;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 1rem;
    }

    .btn {
        font-size: 0.7rem;
        padding: 0.5rem 1rem;
    }
}

/* ==========================================================================
   11. Dark Mode Specifics
   ========================================================================== */
[data-bs-theme="dark"] .bg-body-tertiary,
[data-bs-theme="dark"] .bg-body-secondary {
    background-color: #1a2035 !important;
}

[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-top {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .text-body {
    color: #ffffffcc !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: #202940 !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #1a2035 !important;
}

[data-bs-theme="dark"] .shadow-sm {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2) !important;
}

/* ==========================================================================
   12. Misc / Animations
   ========================================================================== */

/* Message shake animation (preserved from original) */
@keyframes mesajSalla {
    0%   { transform: rotate(0deg); }
    10%  { transform: rotate(-18deg); }
    20%  { transform: rotate(18deg); }
    30%  { transform: rotate(-14deg); }
    40%  { transform: rotate(14deg); }
    50%  { transform: rotate(-8deg); }
    60%  { transform: rotate(8deg); }
    70%  { transform: rotate(-4deg); }
    80%  { transform: rotate(4deg); }
    90%  { transform: rotate(-2deg); }
    100% { transform: rotate(0deg); }
}

.mesaj-geldi {
    animation: mesajSalla 0.8s ease-in-out;
}

.okunmamis-var .bi-envelope-fill {
    color: var(--sui-danger) !important;
}

/* ==========================================================================
   13. Theme Color Overrides - Clean & Muted Palette
   ========================================================================== */

/* --- Primary Buttons → Orange Gradient --- */
.btn-primary {
    background: linear-gradient(310deg, #E8711E, #F4A261) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 3px 8px rgba(232, 113, 30, 0.25);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: linear-gradient(310deg, #D4600F, #E8711E) !important;
    box-shadow: 0 5px 14px rgba(232, 113, 30, 0.35);
    color: #fff !important;
}
.btn-outline-primary {
    color: #E8711E !important;
    border-color: #E8711E !important;
    background: transparent !important;
}
.btn-outline-primary:hover {
    background: rgba(232, 113, 30, 0.08) !important;
    color: #E8711E !important;
    border-color: #E8711E !important;
}

/* --- Success Buttons → Soft Green --- */
.btn-success {
    background: #50A078 !important;
    border: none !important;
    color: #fff !important;
}
.btn-success:hover {
    background: #458D69 !important;
    color: #fff !important;
}

/* --- Warning Buttons → Muted --- */
.btn-warning {
    background: #f0f2f5 !important;
    border: none !important;
    color: #344767 !important;
}
.btn-warning:hover {
    background: #e2e5ea !important;
    color: #344767 !important;
}

/* --- Info Buttons → Soft Blue --- */
.btn-info {
    background: #568DC5 !important;
    border: none !important;
    color: #fff !important;
}
.btn-info:hover {
    background: #4A7DB2 !important;
    color: #fff !important;
}

/* --- Danger Buttons → Soft Red --- */
.btn-danger {
    background: #BE6464 !important;
    border: none !important;
    color: #fff !important;
}
.btn-danger:hover {
    background: #A85555 !important;
    color: #fff !important;
}

/* --- Secondary/Dark Buttons → Neutral --- */
.btn-secondary {
    background: #f0f2f5 !important;
    border: none !important;
    color: #344767 !important;
}
.btn-secondary:hover {
    background: #e2e5ea !important;
    color: #344767 !important;
}
.btn-dark {
    background: #344767 !important;
    border: none !important;
}

/* --- Badge Overrides → Soft Pastel Backgrounds --- */
.badge.bg-primary {
    background: rgba(232, 113, 30, 0.12) !important;
    color: #E8711E !important;
}
.badge.bg-success {
    background: rgba(80, 160, 120, 0.12) !important;
    color: #50A078 !important;
}
.badge.bg-danger {
    background: rgba(190, 100, 100, 0.12) !important;
    color: #BE6464 !important;
}
.badge.bg-warning {
    background: rgba(209, 160, 65, 0.12) !important;
    color: #D1A041 !important;
}
.badge.bg-info {
    background: rgba(86, 141, 197, 0.12) !important;
    color: #568DC5 !important;
}
.badge.bg-secondary {
    background: rgba(103, 116, 142, 0.1) !important;
    color: #67748e !important;
}

/* Subtle badge variants */
.bg-primary-subtle { background: rgba(232, 113, 30, 0.08) !important; }
.text-primary { color: #E8711E !important; }
.bg-success-subtle { background: rgba(80, 160, 120, 0.08) !important; }
.text-success { color: #50A078 !important; }
.bg-danger-subtle { background: rgba(190, 100, 100, 0.08) !important; }
.text-danger { color: #BE6464 !important; }
.bg-warning-subtle { background: rgba(209, 160, 65, 0.08) !important; }
.text-warning { color: #D1A041 !important; }
.bg-info-subtle { background: rgba(86, 141, 197, 0.08) !important; }
.text-info { color: #568DC5 !important; }

/* --- Card Headers → White with subtle bottom border --- */
.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-info,
.card-header.bg-warning,
.card-header.bg-danger {
    background: #fff !important;
    color: #344767 !important;
    border-bottom: 2px solid #f0f2f5 !important;
}
.card-header.bg-primary.text-white *,
.card-header.bg-success.text-white *,
.card-header.bg-info.text-white *,
.card-header.bg-warning.text-white *,
.card-header.bg-danger.text-white * {
    color: #344767 !important;
}
.card-header.bg-warning.text-dark * {
    color: #344767 !important;
}

/* --- Progress Bar → Orange --- */
.progress-bar {
    background: linear-gradient(310deg, #E8711E, #F4A261) !important;
}

/* --- Form Focus → Orange --- */
.form-control:focus,
.form-select:focus {
    border-color: #E8711E !important;
    box-shadow: 0 0 0 0.2rem rgba(232, 113, 30, 0.15) !important;
}

/* --- Links → Muted --- */
a.text-primary:hover { color: #C44200 !important; }

/* --- Page Header Styling --- */
.page-header-icon {
    color: #E8711E;
}

/* --- Table hover → subtle --- */
.table-hover > tbody > tr:hover {
    background-color: rgba(232, 113, 30, 0.03) !important;
}

/* Smooth page transitions */
.container-fluid {
    animation: sui-fade-in 0.3s ease;
}

@keyframes sui-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Border-0 cards should have no border at all */
.border-0 {
    border: 0 !important;
}

/* Shadow-sm cards get the Soft UI shadow */
.shadow-sm {
    box-shadow: var(--sui-shadow) !important;
}

/* rounded-4 maps to Soft UI radius */
.rounded-4 {
    border-radius: var(--sui-radius) !important;
}

/* Collapse transition */
.collapse,
.collapsing {
    transition: height 0.35s ease;
}

/* Scrollbar styling for main content */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}
