/**
 * Custom Styles - DualBiz Manager
 * ================================
 */

/* Sidebar Styling */
.sidebar {
    min-height: 100vh;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar .nav-link {
    font-weight: 500;
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin: 0.125rem 0.5rem;
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar .nav-link.active {
    background-color: #0d6efd;
    color: #fff;
}

.sidebar .nav-link i {
    font-size: 1rem;
}

/* Main Content */
main {
    padding-top: 1.5rem;
}

/* Card Widget Styling */
.widget-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.widget-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.widget-card .card-body {
    padding: 1.5rem;
}

.widget-card .card-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.5rem;
}

.widget-card .card-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0;
}

/* Stok Card Special */
.stok-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stok-card .card-title {
    color: rgba(255, 255, 255, 0.8);
}

/* Form Styling */
.form-label {
    font-weight: 500;
    color: #495057;
}

.form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Table Styling */
.table-container {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    overflow: hidden;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

/* Dynamic Form Fields */
.dynamic-field {
    display: none;
    animation: fadeIn 0.3s ease;
}

.dynamic-field.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Badge Custom */
.badge-masuk {
    background-color: #198754;
}

.badge-keluar {
    background-color: #0d6efd;
}

.badge-pecah {
    background-color: #dc3545;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Print Styles for Export */
@media print {
    .sidebar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .table-container {
        box-shadow: none;
    }
}

/* ===========================================
   MOBILE RESPONSIVE IMPROVEMENTS
   =========================================== */

/* Mobile Navbar */
.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* Offcanvas Sidebar Mobile */
.offcanvas {
    width: 280px !important;
}

.offcanvas .nav-link {
    font-size: 1rem;
    padding: 0.875rem 1rem;
}

.offcanvas .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile Main Content Adjustment */
@media (max-width: 767.98px) {
    /* Sidebar desktop hidden */
    .sidebar {
        display: none !important;
    }
    
    /* Main content full width */
    main {
        padding-top: 0.5rem;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Widget cards smaller on mobile */
    .widget-card {
        margin-bottom: 0.75rem;
    }
    
    .widget-card .card-body {
        padding: 1rem;
    }
    
    .widget-card .card-value {
        font-size: 1.25rem;
    }
    
    .widget-card .card-title {
        font-size: 0.75rem;
    }
    
    /* Tables horizontal scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
    
    /* Form inputs larger on mobile */
    .form-control, .form-select, .btn {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 44px; /* Touch friendly */
    }
    
    /* Page header smaller */
    .border-bottom h1, .border-bottom h2 {
        font-size: 1.25rem;
    }
    
    /* Flash message adjust */
    #flash-message {
        min-width: 90% !important;
        left: 5% !important;
        transform: none !important;
    }
}

/* Extra small devices */
@media (max-width: 575.98px) {
    .widget-card .card-value {
        font-size: 1.1rem;
    }
    
    /* Stack buttons vertically */
    .d-flex.gap-2 {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
    .sidebar {
        width: 220px !important;
    }
    
    .widget-card .card-value {
        font-size: 1.5rem;
    }
}
