/* Custom CSS untuk Sistem Inventaris SMK */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #0891b2;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    overflow-x: hidden; /* Prevent horizontal scrolling */
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Login Page */
.min-vh-100 {
    min-height: 100vh;
}

.card {
    border: none;
    border-radius: 12px;
}

.card-body {
    padding: 2rem;
}

/* Layout Container */
.app-container {
    display: flex;
    min-height: 100vh;
    background-color: #f8fafc;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    width: 100%;
    position: relative;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), #1d4ed8);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    z-index: 1050;
    transition: transform 0.3s ease;
}

/* Desktop: sidebar visible */
@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0);
    }
}

/* Mobile: sidebar hidden by default */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding-bottom: 2rem;
}

.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 0.875rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: white;
    background-color: rgba(255,255,255,0.15);
    transform: translateX(5px);
}

.sidebar-nav .nav-link i {
    width: 18px;
    margin-right: 10px;
    text-align: center;
    font-size: 0.875rem;
}

.sidebar-nav .nav-link span {
    flex: 1;
}

.sidebar-nav .nav-link .fa-chevron-down {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.sidebar-nav .nav-link[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.sidebar-nav .submenu {
    margin-left: 1rem;
    margin-top: 0.5rem;
}

.sidebar-nav .submenu .nav-link {
    padding: 0.5rem 1rem;
    margin: 0.125rem 0;
    font-size: 0.8125rem;
}

.sidebar-divider {
    border-color: rgba(255,255,255,0.2);
    margin: 1rem 0;
}

/* Main Content */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f8fafc;
    margin-left: 260px;
    width: calc(100% - 260px);
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Mobile: no margin for main wrapper, add top padding for fixed mobile navbar */
@media (max-width: 991.98px) {
    .main-wrapper {
        margin-left: 0;
        width: 100%;
        padding-top: 60px; /* Space for fixed mobile navbar */
        overflow-x: hidden;
    }
}

.main-content {
    flex: 1;
    background-color: #f8fafc;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    padding: 2rem;
}

/* Footer positioning */
footer {
    margin-top: auto;
    background-color: #fff !important;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 0;
    width: 100%;
    flex-shrink: 0;
}

/* Ensure footer doesn't overlap with mobile bottom nav */
@media (max-width: 991.98px) {
    footer {
        margin-bottom: 70px; /* Account for mobile bottom navigation */
    }
}

.content-wrapper {
    background-color: white;
    min-height: calc(100vh - 80px);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Page Header */
.page-header {
    background-color: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem 2rem;
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .page-header {
        padding: 1rem;
    }
}

/* Cards */
.stat-card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.bg-primary { background: linear-gradient(135deg, var(--primary-color), #3b82f6); }
.stat-icon.bg-success { background: linear-gradient(135deg, var(--success-color), #10b981); }
.stat-icon.bg-warning { background: linear-gradient(135deg, var(--warning-color), #f59e0b); }
.stat-icon.bg-danger { background: linear-gradient(135deg, var(--danger-color), #ef4444); }

/* Stat Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    margin-bottom: 0.5rem;
}

.stat-icon.bg-primary { 
    background: linear-gradient(135deg, var(--primary-color), #3b82f6); 
}

.stat-icon.bg-success { 
    background: linear-gradient(135deg, var(--success-color), #10b981); 
}

.stat-icon.bg-warning { 
    background: linear-gradient(135deg, var(--warning-color), #f59e0b); 
}

.stat-icon.bg-danger { 
    background: linear-gradient(135deg, var(--danger-color), #ef4444); 
}

.stat-icon.bg-info { 
    background: linear-gradient(135deg, var(--info-color), #06b6d4); 
}

/* List Group */
.list-group-item {
    border: none;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.5rem;
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background-color: #f8fafc;
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        z-index: 1050;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0;
        width: 100%;
        overflow-x: hidden;
    }
    
    .main-content {
        padding: 1rem;
        width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
        padding-bottom: 160px; /* Space for footer + bottom navigation */
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    /* Mobile navbar is visible */
    .mobile-navbar {
        display: flex !important;
    }
    
    /* Mobile bottom nav is visible */
    .mobile-bottom-nav {
        display: block !important;
    }
    
    /* Desktop navbar is hidden */
    .navbar {
        display: none !important;
    }
    
    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 0.75rem;
        width: 100%;
        overflow-x: hidden;
        padding-bottom: 85px; /* Adjust for smaller bottom nav */
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .table-responsive {
        font-size: 0.8125rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .d-flex.gap-2 .btn {
        width: 100%;
    }
    
    .mobile-navbar .navbar-brand {
        font-size: 0.8rem;
    }
    
    .mobile-navbar .btn {
        padding: 0.2rem 0.4rem;
    }
    
    /* Prevent horizontal scroll on cards */
    .card {
        width: 100%;
        box-sizing: border-box;
    }
    
    .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .col-lg-3, .col-md-6, .col-6 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 0.5rem !important;
        width: 100%;
        overflow-x: hidden;
        padding-bottom: 80px; /* Adjust for compact bottom nav */
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .navbar-brand {
        font-size: 0.75rem;
    }
    
    .btn {
        font-size: 0.8125rem;
        padding: 0.4rem 0.75rem;
    }
    
    .btn-sm {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .mobile-navbar {
        padding: 0.5rem 0.75rem;
        height: 55px;
    }
    
    .mobile-navbar .navbar-brand {
        font-size: 0.75rem;
    }
    
    /* Extra small screen adjustments */
    .col-lg-3, .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 0.75rem;
    }
    
    .stat-card {
        margin-bottom: 0.75rem;
    }
}

/* Desktop specific */
@media (min-width: 992px) {
    .mobile-navbar {
        display: none !important;
    }
    
    .mobile-bottom-nav {
        display: none !important;
    }
    
    .navbar {
        display: flex !important;
    }
    
    .main-content {
        padding-bottom: 0; /* No bottom nav on desktop */
    }
}

/* Mobile Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1040;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* Prevent text selection and touch actions that might cause scrolling */
.mobile-navbar, .sidebar {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Ensure all containers don't overflow */
.container, .container-fluid, .row, .col-* {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Mobile Navigation Bar */
.mobile-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: white;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    z-index: 1040;
    padding: 0.75rem 1rem;
    height: 60px;
    display: none;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.mobile-navbar .container-fluid {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.mobile-navbar .navbar-brand {
    font-weight: 600;
    color: var(--primary-color) !important;
    font-size: 0.9rem;
    margin: 0;
    text-decoration: none;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-navbar .btn {
    border: 1px solid #dee2e6;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.mobile-navbar .dropdown {
    position: relative;
    flex-shrink: 0;
}

.mobile-navbar .dropdown-menu {
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 8px;
    min-width: 180px;
    right: 0;
    left: auto;
}

.mobile-navbar .dropdown-item {
    padding: 0.5rem 1rem;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
}

.mobile-navbar .dropdown-item:hover {
    background-color: #f8fafc;
}

.mobile-navbar .nav-link {
    padding: 0.25rem;
    text-decoration: none;
}

/* Show mobile navbar on mobile devices */
@media (max-width: 991.98px) {
    .mobile-navbar {
        display: flex !important;
    }
}

/* Hide mobile navbar on desktop */
@media (min-width: 992px) {
    .mobile-navbar {
        display: none !important;
    }
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: 1030;
    padding: 0.5rem 0;
    display: none;
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #6b7280;
    padding: 0.5rem 0.25rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-width: 60px;
    flex: 1;
    max-width: 80px;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
    text-decoration: none;
}

.bottom-nav-item i {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.bottom-nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
    line-height: 1;
}

/* Show bottom nav on mobile */
@media (max-width: 991.98px) {
    .mobile-bottom-nav {
        display: block !important;
    }
    
    /* Add bottom padding to main content to account for bottom nav */
    .main-content {
        padding-bottom: 150px; /* Space for footer + bottom navigation */
    }
}

/* Adjust for very small screens */
@media (max-width: 576px) {
    .bottom-nav-item {
        min-width: 50px;
        padding: 0.4rem 0.2rem;
    }
    
    .bottom-nav-item i {
        font-size: 1rem;
    }
    
    .bottom-nav-item span {
        font-size: 0.65rem;
    }
    
    .mobile-bottom-nav {
        padding: 0.4rem 0;
    }
}

/* Navbar (Desktop only) */
.navbar {
    background-color: white !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1040;
    padding: 0.5rem 1rem;
    min-height: 60px;
}

.navbar .container-fluid {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.navbar-brand {
    font-weight: 600;
    color: var(--primary-color) !important;
    font-size: 1rem;
    margin-bottom: 0;
}

.navbar-nav {
    gap: 0.5rem;
}

.nav-item .nav-link {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
}

.nav-item .nav-link:hover {
    background-color: #f8fafc;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 8px;
    min-width: 200px;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background-color: #f8fafc;
}

/* Mobile navbar adjustments */
@media (max-width: 991.98px) {
    .navbar {
        display: none !important;
    }
    
    .mobile-navbar {
        display: flex !important;
    }
    
    .mobile-navbar .navbar-brand {
        font-size: 0.85rem;
    }
    
    .mobile-navbar .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

@media (min-width: 992px) {
    .mobile-navbar {
        display: none !important;
    }
    
    .navbar {
        display: flex !important;
    }
}

/* Breadcrumb */
.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--secondary-color);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--secondary-color);
}

/* Form Controls */
.form-control, .form-select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    border: none;
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Breadcrumb */
.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--secondary-color);
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Alert */
.alert {
    border-radius: 8px;
    border: none;
}

/* Breadcrumb */
.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--secondary-color);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}
/* Inventaris Module - Simple & Clean Styles */
.table th {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--dark-color);
    border-bottom: 2px solid #e2e8f0;
    padding: 0.75rem 0.5rem;
}

.table td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
    font-size: 0.875rem;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Compact form controls */
.form-control-sm, .form-select-sm {
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
}

/* Badge kondisi styling */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Responsive table improvements */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.8125rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .table th, .table td {
        padding: 0.5rem 0.25rem;
    }
}

/* Code styling for kode barang */
code {
    background-color: #f1f5f9;
    color: var(--primary-color);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.8125rem;
}

/* Improved empty state */
.card-body .fa-inbox {
    opacity: 0.6;
}
/* Detail page improvements */
.card .row {
    margin-bottom: 0.5rem;
}

.card .row:last-child {
    margin-bottom: 0;
}

.card hr {
    margin: 0.75rem 0;
    opacity: 0.3;
}

/* Form improvements */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Alert improvements */
.alert {
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
}

.alert .fas {
    margin-right: 0.5rem;
}

/* Mobile responsive improvements */
@media (max-width: 576px) {
    .main-content {
        padding: 1rem !important;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.15rem 0.3rem;
        font-size: 0.7rem;
    }
    
    .table-responsive {
        border: none;
    }
    
    .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .d-flex.gap-2 .btn {
        width: 100%;
    }
}

/* Loading state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Image preview improvements */
.img-thumbnail {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.25rem;
}

/* Empty state improvements */
.text-center .fa-inbox {
    color: #6c757d;
    margin-bottom: 1rem;
}

/* Table improvements for mobile */
@media (max-width: 768px) {
    .table-responsive table {
        font-size: 0.75rem;
    }
    
    .table th, .table td {
        padding: 0.4rem 0.2rem;
        white-space: nowrap;
    }
    
    .table .btn-group {
        flex-direction: column;
    }
    
    .table .btn-group .btn {
        margin-bottom: 0.2rem;
        border-radius: 4px !important;
    }
}
/* Unit Module - Card Layout Styles */
.unit-card {
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.unit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.unit-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
}

.unit-card .border-end {
    border-color: #e2e8f0 !important;
}

.unit-card .fw-bold {
    font-size: 1.1rem;
}

.unit-card .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

/* Badge colors for unit types */
.badge.bg-primary { background-color: var(--primary-color) !important; }
.badge.bg-info { background-color: var(--info-color) !important; }
.badge.bg-success { background-color: var(--success-color) !important; }
.badge.bg-warning { background-color: var(--warning-color) !important; }
.badge.bg-secondary { background-color: var(--secondary-color) !important; }

/* Responsive adjustments for unit cards */
@media (max-width: 768px) {
    .unit-card .row.text-center {
        margin-bottom: 1rem;
    }
    
    .unit-card .col-6 {
        margin-bottom: 0.5rem;
    }
    
    .unit-card .border-end {
        border-right: none !important;
        border-bottom: 1px solid #e2e8f0 !important;
        padding-bottom: 0.5rem;
    }
    
    .unit-card .d-flex.gap-1 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .unit-card .btn-sm {
        width: 100%;
    }
}

/* Grid layout improvements */
@media (min-width: 992px) {
    .unit-card {
        min-height: 280px;
    }
}

/* Empty state for unit cards */
.card-body .fa-building {
    opacity: 0.6;
}

/* Statistics display in cards */
.unit-card .fw-bold {
    line-height: 1.2;
}

.unit-card small.text-muted {
    font-size: 0.75rem;
    line-height: 1.3;
}
/* Progress bar improvements for unit cards */
.progress {
    background-color: #f1f5f9;
    border-radius: 3px;
}

.progress-bar {
    transition: width 0.3s ease;
}

/* Unit card layout improvements */
.unit-card .card-body {
    display: flex;
    flex-direction: column;
}

.unit-card .d-flex.gap-1 {
    margin-top: auto;
}

.unit-card .fs-5 {
    font-size: 1.1rem !important;
}

/* Badge positioning fix */
.unit-card .badge {
    flex-shrink: 0;
}

/* Consistent card heights */
@media (min-width: 768px) {
    .unit-card {
        min-height: 320px;
    }
}

/* Mobile responsive for unit cards */
@media (max-width: 576px) {
    .unit-card .row.text-center .col-6:first-child .border-end {
        border-right: none !important;
        border-bottom: 1px solid #e2e8f0 !important;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .unit-card .row.text-center .col-6:last-child .ps-2 {
        padding-left: 0 !important;
    }
    
    .unit-card .d-flex.gap-1 .btn-sm {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Tooltip for progress bar */
.progress {
    cursor: help;
}

/* Empty state spacing */
.unit-card p.card-text {
    line-height: 1.4;
}
/* User Module - Card Layout Styles */
.user-card {
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.user-card.user-inactive {
    opacity: 0.7;
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

.user-card.user-inactive:hover {
    transform: none;
    box-shadow: none !important;
}

.user-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-color);
}

.user-card .border-end {
    border-color: #e2e8f0 !important;
}

.user-card .fw-bold {
    font-size: 1rem;
}

.user-card .fs-5 {
    font-size: 0.95rem !important;
}

.user-card .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

/* Role badge styling with icons */
.user-card .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

.user-card .badge .fas {
    font-size: 0.7rem;
}

/* Email styling */
.user-card .fa-envelope {
    font-size: 0.7rem;
}

/* User card layout improvements */
.user-card .card-body {
    display: flex;
    flex-direction: column;
}

.user-card .d-flex.gap-1 {
    margin-top: auto;
}

/* Responsive adjustments for user cards */
@media (max-width: 768px) {
    .user-card .row.text-center .col-6:first-child .border-end {
        border-right: none !important;
        border-bottom: 1px solid #e2e8f0 !important;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .user-card .row.text-center .col-6:last-child .ps-2 {
        padding-left: 0 !important;
    }
    
    .user-card .d-flex.gap-1 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .user-card .btn-sm {
        width: 100%;
    }
    
    .user-card .text-end {
        text-align: left !important;
        margin-top: 0.5rem;
    }
    
    .user-card .d-flex.justify-content-between {
        flex-direction: column;
    }
}

/* Grid layout improvements */
@media (min-width: 992px) {
    .user-card {
        min-height: 280px;
    }
}

/* Empty state for user cards */
.card-body .fa-users {
    opacity: 0.6;
}

/* Statistics display in user cards */
.user-card .fw-bold {
    line-height: 1.2;
}

.user-card small.text-muted {
    font-size: 0.75rem;
    line-height: 1.3;
}

/* Disabled button styling */
.user-card .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Badge positioning improvements */
.user-card .text-end .badge {
    display: inline-block;
    margin-bottom: 0.25rem;
}

/* Code styling for username */
.user-card code {
    font-size: 0.8125rem;
    padding: 0.2rem 0.4rem;
}
/* Report Module Styles */
.report-stats .card {
    transition: transform 0.2s ease;
}

.report-stats .card:hover {
    transform: translateY(-2px);
}

.report-stats .fw-bold {
    font-size: 1.1rem;
}

/* Export dropdown styling */
.dropdown-menu .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.dropdown-menu .dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-menu .fas {
    width: 16px;
}

/* Table improvements for reports */
.table-responsive .table {
    margin-bottom: 0;
}

.table th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 10;
}

.table .unit-header {
    background-color: #e9ecef !important;
    font-weight: 600;
}

.table .unit-header td {
    padding: 0.75rem 0.5rem;
}

/* Print specific improvements */
@media print {
    .table .unit-header {
        background-color: #e9ecef !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .table tfoot {
        background-color: #343a40 !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .badge {
        border: 1px solid #000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Responsive improvements for reports */
@media (max-width: 768px) {
    .report-stats .col-6 {
        margin-bottom: 0.5rem;
    }
    
    .report-stats .card-body {
        padding: 0.75rem 0.5rem;
    }
    
    .report-stats .fw-bold {
        font-size: 1rem;
    }
    
    .table-responsive {
        font-size: 0.8125rem;
    }
    
    .dropdown-menu {
        min-width: 150px;
    }
}

/* Loading state for export buttons */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
/* Profile Module Styles */
.stat-icon-sm {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    margin: 0 auto;
}

.stat-icon-sm.bg-primary { 
    background: linear-gradient(135deg, var(--primary-color), #3b82f6); 
}

.stat-icon-sm.bg-success { 
    background: linear-gradient(135deg, var(--success-color), #10b981); 
}

.stat-icon-sm.bg-warning { 
    background: linear-gradient(135deg, var(--warning-color), #f59e0b); 
}

.stat-item {
    padding: 0.5rem;
}

.info-item {
    padding: 0.5rem 0;
}

.info-item:not(:last-child) {
    border-bottom: 1px solid #f1f5f9;
}

/* Input group improvements */
.input-group-text {
    background-color: #f8fafc;
    border-color: #e2e8f0;
}

.input-group .form-control:focus + .input-group-text {
    border-color: var(--primary-color);
}

/* Progress bar for profile stats */
.progress {
    background-color: #f1f5f9;
    border-radius: 3px;
}

.progress-bar {
    transition: width 0.3s ease;
}

/* Profile card improvements */
.profile-card .card-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.profile-card .card-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Role and unit styling */
.input-group-text .fas {
    font-size: 0.875rem;
}

/* Responsive improvements for profile */
@media (max-width: 768px) {
    .stat-item {
        margin-bottom: 1rem;
    }
    
    .info-item {
        padding: 0.75rem 0;
    }
    
    .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .d-flex.gap-2 .btn {
        width: 100%;
    }
}

/* Badge improvements */
.badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

.badge .fas {
    font-size: 0.7rem;
}

/* Card header consistency */
.card-header.py-3 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dark-color);
}

/* Form improvements */
.form-control:read-only {
    background-color: #f8fafc;
    opacity: 1;
}

.form-control:read-only:focus {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    box-shadow: none;
}

/* Statistics layout improvements */
.stat-item .fw-bold {
    font-size: 1.1rem;
    line-height: 1.2;
}

.stat-item small {
    font-size: 0.75rem;
    line-height: 1.3;
}
/* Real-time clock styling */
#realTimeClock {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #4a5568;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    display: inline-block;
    min-width: 140px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#realTimeClock:hover {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Clock icon animation */
#realTimeClock .fa-clock {
    animation: clockTick 1s infinite;
}

@keyframes clockTick {
    0%, 50%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(6deg);
    }
    75% {
        transform: rotate(-6deg);
    }
}

/* Footer improvements */
footer {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95) !important;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}

/* Mobile footer adjustments */
@media (max-width: 768px) {
    #realTimeClock {
        font-size: 0.75rem;
        min-width: 120px;
        padding: 0.2rem 0.4rem;
    }
    
    footer .col-md-6 {
        text-align: center !important;
        margin-bottom: 0.5rem;
    }
    
    footer .col-md-6:last-child {
        margin-bottom: 0;
    }
}

/* Digital clock effect */
@media (prefers-reduced-motion: no-preference) {
    #realTimeClock {
        position: relative;
        overflow: hidden;
    }
    
    #realTimeClock::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
        transition: left 0.5s;
    }
    
    #realTimeClock:hover::before {
        left: 100%;
    }
}
/* Camera interface styling */
.photo-capture-section {
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    background-color: #f8fafc;
    transition: all 0.3s ease;
}

.photo-capture-section:hover {
    border-color: #cbd5e0;
    background-color: #f1f5f9;
}

.camera-container {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.camera-preview-wrapper {
    position: relative;
    display: inline-block;
}

#cameraPreview {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.camera-controls {
    margin-top: 1rem;
}

.photo-preview {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#previewImage {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.photo-actions-main {
    text-align: center;
    padding: 0.5rem 0;
}

/* Camera button styling */
#openCameraBtn {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
}

#openCameraBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

#captureBtn {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
    transition: all 0.3s ease;
}

#captureBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

/* Mobile camera optimizations */
@media (max-width: 768px) {
    #cameraPreview {
        width: 100% !important;
        max-width: 100% !important;
        height: 250px !important;
    }
    
    #previewImage {
        width: 100% !important;
        max-width: 100% !important;
        height: 250px !important;
    }
    
    .camera-controls .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    .photo-actions .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
}

/* Camera access animation */
.camera-container {
    animation: fadeInUp 0.3s ease-out;
}

.photo-preview {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Camera permission indicator */
.camera-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.camera-status.granted {
    background-color: #dcfce7;
    color: #166534;
}

.camera-status.denied {
    background-color: #fef2f2;
    color: #991b1b;
}

/* Loading spinner for camera initialization */
.camera-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Activity Badge Colors */
.badge.bg-success { background-color: var(--success-color) !important; }
.badge.bg-secondary { background-color: var(--secondary-color) !important; }
.badge.bg-primary { background-color: var(--primary-color) !important; }
.badge.bg-warning { background-color: var(--warning-color) !important; }
.badge.bg-danger { background-color: var(--danger-color) !important; }
.badge.bg-info { background-color: var(--info-color) !important; }
.badge.bg-dark { background-color: var(--dark-color) !important; }