/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --info-color: #3a86ff;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --sidebar-width: 250px;
    --navbar-height: 60px;
    --transition-speed: 0.3s;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fb;
    color: #333;
    line-height: 1.6;
    font-size: 14px;
}

/* Login Page */
.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 90%;
    max-width: 400px;
    margin: 20px;
}

.login-header {
    background: var(--primary-color);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.login-header h2 {
    margin-bottom: 10px;
    font-weight: 600;
}

.login-header p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.login-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    border: 2px solid #e0e6ed;
    border-radius: var(--radius-sm);
    padding: 12px 15px;
    transition: all var(--transition-speed);
    font-size: 15px;
    width: 100%;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

.btn-login {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    width: 100%;
    transition: all var(--transition-speed);
    cursor: pointer;
}

.btn-login:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* =========================
   SIDEBAR UTAMA
========================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark-color);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: all var(--transition-speed);
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    overflow-x: hidden;
}

/* =========================
   HEADER SIDEBAR
========================= */
.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* =========================
   MENU SIDEBAR
========================= */
.sidebar-menu {
    padding: 15px 10px 30px;
}

.sidebar-menu li {
    list-style: none;
    margin-bottom: 8px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sidebar-menu li a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-menu li.active a {
    background: rgba(255, 255, 255, 0.18);
    font-weight: 600;
}

/* =========================
   SUB MENU
========================= */
.sidebar-menu li ul {
    margin-top: 6px;
    padding-left: 20px;
}

.sidebar-menu li ul li {
    margin-bottom: 6px;
}

.sidebar-menu li ul li a {
    padding: 8px 12px;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* =========================
   SCROLLBAR
========================= */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-speed);
    border-left: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-color);
}

.nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-speed);
    width: calc(100% - var(--sidebar-width));
    min-width: 0; /* Important for responsive */
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: white;
    height: var(--navbar-height);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 0 20px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-color);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-speed);
}

.sidebar-toggle:hover {
    background: #f8f9fa;
    transform: scale(1.05);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-speed);
}

.user-info:hover {
    background: #f8f9fa;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 3px 10px rgba(67, 97, 238, 0.3);
    flex-shrink: 0;
}

/* Dropdown styling */
.dropdown-toggle {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 5px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-speed);
}

.dropdown-toggle:hover {
    color: var(--dark-color);
    background: #f8f9fa;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    padding: 10px 0;
    min-width: 200px;
    border: 1px solid #f1f3f4;
}

.dropdown-menu-end {
    right: 0 !important;
    left: auto !important;
    transform: translate(0, 38px) !important;
}

.dropdown-item {
    padding: 10px 20px;
    color: #495057;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
}

.dropdown-item:hover {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
}

.dropdown-divider {
    margin: 8px 0;
    border-color: #f1f3f4;
}

.dropdown-item.text-danger:hover {
    background-color: rgba(247, 37, 133, 0.1);
    color: var(--danger-color);
}

/* ==================== CONTENT AREA ==================== */
.content {
    padding: 30px;
    min-height: calc(100vh - var(--navbar-height) - 70px);
    width: 100%;
    overflow-x: hidden; /* Mencegah scroll horizontal */
}

.content-header {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.content-header h1 {
    color: var(--dark-color);
    margin-bottom: 0;
    font-size: 1.8rem;
    font-weight: 600;
    word-break: break-word;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.breadcrumb-item {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
    transition: color var(--transition-speed);
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 500;
}

/* Flash Message */
.flash-message-container {
    margin-bottom: 25px;
}

.flash-message-container .alert {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 15px 20px;
}

.flash-message-container .alert-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: #155724;
}

.flash-message-container .alert-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #856404;
}

.flash-message-container .alert-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: #721c24;
}

.flash-message-container .alert-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #0c5460;
}

.flash-message-container .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
    margin-left: 15px;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    margin-bottom: 25px;
    overflow: hidden;
    background: white;
    width: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: white;
    border-bottom: 1px solid #f1f3f4;
    padding: 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h5 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.card-body {
    padding: 20px;
    overflow-x: auto; /* Untuk konten yang terlalu lebar */
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 25px;
    border-radius: var(--radius-md);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-height: 120px;
}

.stat-card i {
    font-size: 2.5rem;
    opacity: 0.9;
    flex-shrink: 0;
}

.stat-card-content h3 {
    font-size: 2rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.stat-card-content p {
    opacity: 0.9;
    font-size: 0.9rem;
    margin: 0;
}

.stat-card:nth-child(1) { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-card:nth-child(2) { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.stat-card:nth-child(3) { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.stat-card:nth-child(4) { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }

/* ==================== TABEL RESPONSIF ==================== */

/* Container untuk tabel responsif */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    background: white;
    margin-bottom: 25px;
    -webkit-overflow-scrolling: touch; /* Smooth scroll di iOS */
}

.table-responsive {
    min-height: 0.01%;
    overflow-x: auto;
}

/* Styling tabel dasar */
.table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    min-width: 600px; /* Minimum width sebelum scroll */
}

.table thead {
    background: var(--light-color);
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    padding: 15px 12px;
    color: var(--dark-color);
    white-space: nowrap;
    position: relative;
    vertical-align: middle;
}

.table tbody td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4;
    word-break: break-word;
    max-width: 200px; /* Batas maksimum width cell */
    overflow: hidden;
    text-overflow: ellipsis;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Zebra striping untuk readability */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Responsif untuk tabel dengan banyak kolom */
@media screen and (max-width: 768px) {
    .table thead {
        display: none; /* Sembunyikan header di mobile */
    }
    
    .table, 
    .table tbody, 
    .table tr, 
    .table td {
        display: block;
        width: 100%;
    }
    
    .table tr {
        margin-bottom: 15px;
        border: 1px solid #dee2e6;
        border-radius: var(--radius-sm);
        padding: 10px;
        background: white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    
    .table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #f1f3f4;
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 40px;
    }
    
    .table td:last-child {
        border-bottom: none;
    }
    
    .table td::before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        width: calc(50% - 24px);
        padding-right: 10px;
        font-weight: 600;
        text-align: left;
        color: var(--dark-color);
    }
    
    /* Untuk tombol aksi di mobile */
    .table td .btn-group,
    .table td .d-flex {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .table td .btn {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* Medium devices (tablets) */
@media screen and (max-width: 992px) {
    .table {
        font-size: 13px;
    }
    
    .table thead th,
    .table tbody td {
        padding: 10px 8px;
    }
    
    /* Hide less important columns */
    .table .mobile-hide {
        display: none;
    }
}

/* Untuk tabel dengan konten panjang */
.table-cell-truncate {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

/* Badge dalam tabel */
.table .badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    white-space: nowrap;
}

/* Aksi dalam tabel */
.table-actions {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.table-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
    min-width: 60px;
}

/* Pagination responsif */
.pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.page-link {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid #dee2e6;
    color: var(--primary-color);
    font-size: 14px;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* List group */
.list-group-item {
    border: none;
    border-bottom: 1px solid #f1f3f4;
    padding: 15px;
}

.list-group-item:last-child {
    border-bottom: none;
}

.user-avatar-sm {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: white;
    padding: 20px 30px;
    border-top: 1px solid #eee;
    color: #6c757d;
    font-size: 0.9rem;
}

.footer .container-fluid {
    padding: 0;
}

/* Overlay untuk mobile */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */

/* Large devices (desktops) */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
    
    .content {
        padding: 25px;
    }
}

/* Medium devices (tablets) */
@media (max-width: 992px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        width: 280px; /* Lebih lebar di mobile */
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .main-content.sidebar-active {
        margin-left: 280px;
        width: calc(100% - 280px);
    }
    
    .content {
        padding: 20px;
    }
    
    .card-header {
        padding: 15px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .stat-card {
        padding: 20px;
        min-height: 100px;
    }
    
    .stat-card i {
        font-size: 2rem;
    }
    
    .stat-card-content h3 {
        font-size: 1.8rem;
    }
}

/* Small devices (landscape phones) */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        padding: 0 15px;
    }
    
    .user-info span {
        display: none;
    }
    
    .user-avatar {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .dropdown-menu {
        min-width: 180px;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .content-header h1 {
        font-size: 1.5rem;
    }
    
    .breadcrumb {
        font-size: 0.85rem;
    }
    
    /* Form responsive */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .col {
        width: 100%;
        margin-bottom: 15px;
    }
    
    /* Modal responsive */
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-content {
        border-radius: var(--radius-md);
    }
}

/* Extra small devices (portrait phones) */
@media (max-width: 576px) {
    .sidebar-toggle {
        font-size: 1.3rem;
        padding: 5px 8px;
    }
    
    .content {
        padding: 15px;
    }
    
    .content-header h1 {
        font-size: 1.3rem;
    }
    
    .stat-card {
        padding: 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .stat-card i {
        font-size: 1.8rem;
    }
    
    .stat-card-content h3 {
        font-size: 1.6rem;
    }
    
    .card-header h5 {
        font-size: 1rem;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    /* Flash messages */
    .flash-message-container .alert {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
}

/* Very small devices */
@media (max-width: 375px) {
    .navbar-right {
        gap: 10px;
    }
    
    .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .sidebar-toggle {
        font-size: 1.2rem;
    }
    
    .content {
        padding: 12px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--info-color) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-info { background-color: var(--info-color) !important; }
.bg-light { background-color: var(--light-color) !important; }
.bg-dark { background-color: var(--dark-color) !important; }

.shadow-sm { box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important; }
.shadow-md { box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important; }
.shadow-lg { box-shadow: 0 10px 15px rgba(0,0,0,0.1) !important; }

.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }

/* Flex utilities */
.d-flex { display: flex !important; }
.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.gap-5 { gap: 5px !important; }
.gap-10 { gap: 10px !important; }
.gap-15 { gap: 15px !important; }
.gap-20 { gap: 20px !important; }

/* Margin & Padding utilities */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.me-4 { margin-right: 1.5rem !important; }
.me-5 { margin-right: 3rem !important; }

.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.ms-4 { margin-left: 1.5rem !important; }
.ms-5 { margin-left: 3rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

/* Width utilities */
.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }
.mw-100 { max-width: 100% !important; }

/* Display utilities */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.d-inline { display: inline !important; }

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-inline-block { display: inline-block !important; }
    .d-md-flex { display: flex !important; }
}

@media (max-width: 767px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
}

/* Badge */
.badge {
    padding: 5px 10px;
    font-weight: 500;
    font-size: 0.75rem;
    border-radius: 20px;
    display: inline-block;
}

/* Button styles */
.btn {
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-weight: 500;
    transition: all var(--transition-speed);
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.btn-warning {
    background: var(--warning-color);
    border-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #e68900;
    border-color: #e68900;
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #d11450;
    border-color: #d11450;
    color: white;
}

.btn-success {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #00b4d8;
    border-color: #00b4d8;
    color: white;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* ==================== CRUD STYLES ==================== */

/* Modal Styling */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    max-width: 100%;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-body {
    padding: 25px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    border-top: 1px solid #f1f3f4;
    padding: 20px 25px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Form Styling */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
    display: block;
}

.form-control, .form-select {
    border: 2px solid #e9ecef;
    border-radius: var(--radius-sm);
    padding: 10px 15px;
    transition: all var(--transition-speed);
    width: 100%;
    font-size: 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.15);
}

.form-text {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 5px;
    display: block;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

/* Button Group */
.btn-group {
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: inline-flex;
    flex-wrap: nowrap;
}

.btn-group .btn {
    border-radius: 0;
    padding: 6px 12px;
    flex: 1;
}

.btn-group .btn:first-child {
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}

.btn-group .btn:last-child {
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

/* Table Actions */
.text-center {
    text-align: center;
}

.text-end {
    text-align: right;
}

.text-start {
    text-align: left;
}

/* Required field indicator */
.text-danger {
    color: #dc3545 !important;
}

/* Disabled button */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Search input */
.form-control-sm {
    padding: 8px 12px;
    font-size: 0.875rem;
}

/* Alert styling */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 15px 20px;
    margin-bottom: 20px;
}

.alert-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

/* Print styles */
@media print {
    .sidebar,
    .navbar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .content {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .table {
        border: 1px solid #ddd;
    }
    
    .table thead th {
        background: #f8f9fa !important;
        -webkit-print-color-adjust: exact;
    }
}