:root {
    --primary-color: #0400DE;
    --secondary-color: #1a0fff;
    --bg-color: #ffffff;
    --text-color: #333333;
    --card-bg: #ffffff;
    --border-color: #e9ecef;
    --shadow-color: rgba(4, 0, 222, 0.1);
}

[data-theme="dark"] {
    --primary-color: #6366f1;
    --secondary-color: #0400DE;
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --card-bg: #2d2d2d;
    --border-color: #404040;
    --shadow-color: rgba(255, 255, 255, 0.1);
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-color) 0%, #f8f9ff 100%);
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23e5e7eb" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    z-index: 0;
}

.login-card {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 15px 35px var(--shadow-color);
    border: 1px solid var(--border-color);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.login-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1.5" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.5;
}

.login-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.login-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.login-body {
    padding: 2rem;
}

.form-floating {
    margin-bottom: 1.5rem;
}

.form-control {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem 0.75rem;
    transition: all 0.3s ease;
    background: var(--card-bg);
    color: var(--text-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(4, 0, 222, 0.25);
}

.btn-login {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 10px;
    padding: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    width: 100%;
    color: white;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(4, 0, 222, 0.3);
    color: white;
}

.btn-register {
    background: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    width: 100%;
    color: var(--primary-color);
}

.btn-register:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(4, 0, 222, 0.3);
}

.auth-toggle {
    text-align: center;
    margin-top: 1rem;
}

.auth-toggle a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dashboard-container {
    display: block;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 250px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px var(--shadow-color);
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .sidebar-toggle {
    right: -15px;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-header h3 {
    opacity: 1 !important;
    width: auto !important;
    overflow: visible !important;
    display: block !important;
    color: white !important;
}

.sidebar-toggle {
    position: absolute;
    top: 1.5rem;
    right: -15px;
    background: #0400DE;
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    pointer-events: auto;
}

.sidebar-toggle:hover {
    background: #1a0fff;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-item {
    margin: 0.5rem 1rem;
}

.sidebar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

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

.sidebar-nav .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
}

.sidebar.collapsed .sidebar-nav .nav-link span {
    opacity: 1 !important;
    width: auto !important;
    overflow: visible !important;
    display: inline !important;
    color: white !important;
}

.sidebar.collapsed .sidebar-nav .nav-link i {
    margin-right: 0.75rem !important;
}

.main-content {
    margin-left: 250px;
    transition: all 0.3s ease;
    min-height: 100vh;
    background: var(--bg-color);
}

.main-content.expanded {
    margin-left: 70px;
}

.top-navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px var(--shadow-color);
    position: relative;
    z-index: 1000;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-color);
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

.content-area {
    padding: 2rem;
    min-height: calc(100vh - 80px);
    overflow-y: auto;
}

.welcome-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.dashboard-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: all 0.3s ease;
    height: 100%;
    background: var(--card-bg);
    color: var(--text-color);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-card {
    border-left: 4px solid var(--primary-color);
}

.client-card {
    border-left: 4px solid #17a2b8;
}

.page-container {
    display: none;
    padding: 2rem;
    min-height: calc(100vh - 160px);
    overflow-y: auto;
}

.page-container.active {
    display: block;
}

#dashboardContent {
    min-height: calc(100vh - 160px);
    overflow-y: auto;
}

.chart-container {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    height: 350px;
    position: relative;
    overflow: hidden;
}

.chart-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
    text-align: center;
}

.chart-container canvas {
    max-height: 280px !important;
    width: 100% !important;
    height: auto !important;
}

.chart-placeholder {
    height: 300px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-color);
    font-weight: 500;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .sidebar-nav .nav-link span {
        opacity: 1 !important;
        width: auto !important;
        overflow: visible !important;
        display: inline !important;
        color: white !important;
    }
    
    .sidebar-nav .nav-link i {
        margin-right: 0.75rem !important;
    }
    
    .login-card {
        margin: 1rem;
        max-width: none;
    }
    
    .login-header {
        padding: 1.5rem;
    }
    
    .login-body {
        padding: 1.5rem;
    }
    
    .welcome-section {
        padding: 1.5rem;
    }
    
    .card-icon {
        font-size: 2.5rem;
    }
    
    .content-area {
        padding: 1rem;
        margin-left: 0;
    }
}

@media (max-width: 576px) {
    .login-header h1 {
        font-size: 1.5rem;
    }
    
    .welcome-section h2 {
        font-size: 1.5rem;
    }
    
    .dashboard-card {
        margin-bottom: 1rem;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: 0 10px 30px var(--shadow-color);
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) 1;
}

.modal-content {
    background: var(--card-bg);
    color: var(--text-color);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

/* Contract Management Styles */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.page-header h3 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.page-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-size: 1rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-buttons .btn {
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(4, 0, 222, 0.3);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-content {
    text-align: center;
}

.contract-filters {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.contracts-table-container {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Table responsive wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Ensure table has minimum width for mobile scrolling */
@media (max-width: 767.98px) {
    .contracts-table {
        min-width: 700px;
    }
    
    .contracts-table th,
    .contracts-table td {
        min-width: 80px;
    }
    
    /* Specific column widths for better mobile experience */
    .contracts-table th:nth-child(1),
    .contracts-table td:nth-child(1) {
        min-width: 40px; /* Checkbox column */
    }
    
    .contracts-table th:nth-child(2),
    .contracts-table td:nth-child(2) {
        min-width: 120px; /* No. Kontrak */
    }
    
    .contracts-table th:nth-child(3),
    .contracts-table td:nth-child(3) {
        min-width: 150px; /* Nama Proyek */
    }
    
    .contracts-table th:nth-child(4),
    .contracts-table td:nth-child(4) {
        min-width: 80px; /* Jenis */
    }
    
    .contracts-table th:nth-child(5),
    .contracts-table td:nth-child(5) {
        min-width: 100px; /* Nama PIC */
    }
    
    .contracts-table th:nth-child(6),
    .contracts-table td:nth-child(6) {
        min-width: 100px; /* Nilai Kontrak */
    }
    
    .contracts-table th:nth-child(7),
    .contracts-table td:nth-child(7) {
        min-width: 60px; /* Mata Uang */
    }
    
    .contracts-table th:nth-child(8),
    .contracts-table td:nth-child(8) {
        min-width: 100px; /* Tanggal Mulai */
    }
    
    .contracts-table th:nth-child(9),
    .contracts-table td:nth-child(9) {
        min-width: 100px; /* Tanggal Selesai */
    }
    
    .contracts-table th:nth-child(10),
    .contracts-table td:nth-child(10) {
        min-width: 80px; /* Status */
    }
    
    .contracts-table th:nth-child(11),
    .contracts-table td:nth-child(11) {
        min-width: 100px; /* Aksi */
    }
}

.contracts-table {
    margin: 0;
    color: var(--text-color);
    background: var(--card-bg);
}

.contracts-table thead th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem 0.75rem;
    text-align: center !important;
    vertical-align: middle !important;
}

.contracts-table thead th * {
    text-align: center !important;
    vertical-align: middle !important;
}

.contracts-table thead th .form-check {
    display: flex;
    justify-content: center;
    align-items: center;
}

.contracts-table thead th .form-check-input {
    margin: 0;
}

.contracts-table tbody td {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0.75rem;
    vertical-align: middle;
    background: var(--card-bg);
}

.contracts-table tbody tr {
    background: var(--card-bg);
}

.contracts-table tbody tr:hover {
    background: rgba(4, 0, 222, 0.05);
    transition: all 0.3s ease;
}

[data-theme="dark"] .contracts-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

.status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-draft {
    background: #e9ecef;
    color: #6c757d;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-active {
    background: #d1edff;
    color: #0c5460;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-expired {
    background: #f8d7da;
    color: #721c24;
}

.type-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

.type-project {
    background: #e7f3ff;
    color: #004085;
}

.type-service {
    background: #f0f8ff;
    color: #004085;
}

.type-maintenance {
    background: #fff5f5;
    color: #721c24;
}

.type-consultation {
    background: #f0fff4;
    color: #155724;
}

.action-buttons-small {
    display: flex;
    gap: 0.5rem;
}

.action-buttons-small .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 8px;
}

.bulk-actions {
    animation: slideDown 0.3s ease-out;
}

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

.contract-value {
    font-weight: 600;
    color: var(--primary-color);
}

.contract-dates {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Contract Details Modal */
.contract-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.contract-detail-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contract-detail-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0.7;
}

.contract-detail-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
    border-color: var(--primary-color);
}

.contract-detail-card h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contract-detail-card h6 i {
    font-size: 0.8rem;
    opacity: 0.8;
}

.contract-detail-card p {
    margin: 0;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.contract-value {
    font-weight: 700;
    color: var(--success-color);
    font-size: 1.1rem;
}

/* Dark theme contract details */
[data-theme="dark"] .contract-detail-card {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .contract-detail-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .contract-detail-card h6 {
    color: var(--primary-color);
}

[data-theme="dark"] .contract-detail-card p {
    color: var(--text-color);
}

/* Contract Section Styling */
.contract-section {
    margin-bottom: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.3s ease;
}

.contract-section:hover {
    box-shadow: 0 4px 16px var(--shadow-color);
    transform: translateY(-1px);
}

.contract-section .section-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
    position: relative;
}

.contract-section .section-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

.contract-section .contract-details-grid {
    margin-bottom: 0;
}

/* Dark theme contract section */
[data-theme="dark"] .contract-section {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .contract-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .contract-section .section-header {
    border-bottom-color: var(--primary-color);
}

[data-theme="dark"] .contract-section .section-header::after {
    background: var(--primary-color);
}


/* Responsive contract sections */
@media (max-width: 768px) {
    .contract-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .contract-section .section-header {
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
    
    .contract-section .section-header h6 {
        font-size: 0.8rem;
    }
    
    .contract-details-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

@media (max-width: 576px) {
    .contract-section {
        padding: 0.75rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }
    
    .contract-section .section-header h6 {
        font-size: 0.75rem;
    }
    
    .contract-detail-card {
        padding: 0.75rem;
    }
    
    .contract-detail-card h6 {
        font-size: 0.8rem;
    }
    
    .contract-detail-card p {
        font-size: 0.9rem;
    }
}

.contract-timeline {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.timeline-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 0.9rem;
}

.timeline-content h6 {
    margin: 0;
    font-weight: 600;
    color: var(--text-color);
}

.timeline-content p {
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .contract-filters .row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .contracts-table {
        font-size: 0.9rem;
    }
    
    .contracts-table thead th,
    .contracts-table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    .action-buttons-small {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .contract-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .page-header {
        padding: 1.5rem;
    }
    
    .page-header h3 {
        font-size: 1.5rem;
    }
    
    .contracts-table-container {
        padding: 1rem;
    }
    
    .contracts-table {
        font-size: 0.8rem;
    }
    
    .contracts-table thead th,
    .contracts-table tbody td {
        padding: 0.5rem 0.25rem;
    }
}

/* Standalone Contracts Page Styles */
.contracts-page .dashboard-container {
    display: block !important;
}

.contracts-page .sidebar {
    display: block;
}

.contracts-page .main-content {
    transition: all 0.3s ease;
}

.contracts-page .main-content.expanded {
    margin-left: 70px;
}

.contracts-page .sidebar.collapsed {
    width: 70px;
}

.contracts-page .sidebar.collapsed .sidebar-header h3 {
    opacity: 1 !important;
    width: auto !important;
    overflow: visible !important;
    display: block !important;
    color: white !important;
}

.contracts-page .sidebar.collapsed .sidebar-nav .nav-link span {
    opacity: 1 !important;
    width: auto !important;
    overflow: visible !important;
    display: inline !important;
    color: white !important;
}

.contracts-page .sidebar.collapsed .sidebar-nav .nav-link i {
    margin-right: 0.75rem !important;
}

/* Page redirect styles */
.py-5 {
    padding: 3rem 0 !important;
}

.text-center .btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.text-center .btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(4, 0, 222, 0.3);
}

/* Method Selection Modal Styles */
.method-card {
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--card-bg);
    height: 100%;
}

.method-card:hover {
    border-color: var(--primary-color);
    background: rgba(4, 0, 222, 0.05);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.method-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.method-card h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.method-card p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Excel Upload Modal Styles */
.template-section {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 1.5rem;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 15px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(4, 0, 222, 0.05);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(4, 0, 222, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-content h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.file-info {
    animation: slideDown 0.3s ease-out;
}

.preview-section {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 1.5rem;
}

#previewTable {
    font-size: 0.9rem;
    color: var(--text-color);
    background: var(--card-bg);
}

#previewTable th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    border: none;
    padding: 0.75rem;
    text-align: center !important;
    vertical-align: middle !important;
}

#previewTable thead th * {
    text-align: center !important;
    vertical-align: middle !important;
}

#previewTable td {
    border-color: var(--border-color);
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
}

/* Dark Theme Preview Table */
[data-theme="dark"] #previewTable {
    background: var(--card-bg);
    color: white;
}

[data-theme="dark"] #previewTable th {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] #previewTable td {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: white;
}

[data-theme="dark"] #previewTable tbody tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] #previewTable tbody tr {
    background: var(--card-bg);
    color: white;
}

[data-theme="dark"] #previewTable tbody td * {
    color: white !important;
}

/* Modern Section Headers in Forms */
.section-header {
    margin: 2rem 0 1.5rem 0;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    background: linear-gradient(90deg, var(--primary-color) 0%, transparent 100%);
    background-size: 100% 2px;
    background-repeat: no-repeat;
    background-position: 0 100%;
}

.section-header h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin: 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header h6 i {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Form Layout Improvements */
.modal-body .row {
    margin-bottom: 0.5rem;
}

.modal-body .mb-3 {
    margin-bottom: 1.5rem;
}

.modal-body .form-check {
    margin-bottom: 1rem;
}

/* Modern form styling */
.form-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-label i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.form-control,
.form-select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    background: var(--card-bg);
    color: var(--text-color);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(4, 0, 222, 0.1);
    outline: none;
}

.form-control:hover,
.form-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px rgba(4, 0, 222, 0.1);
}

/* Textarea specific styling */
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Placeholder styling */
.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
    font-size: 0.9rem;
}

.form-control:focus::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* Dark theme placeholder */
[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

[data-theme="dark"] .form-control:focus::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Currency input styling */
.input-group-text {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-right: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 0.5rem;
    border-radius: 8px 0 0 8px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group .form-control {
    border-left: none;
    border-radius: 0 8px 8px 0;
}

.input-group:focus-within .input-group-text {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.input-group:focus-within .form-control {
    border-color: var(--primary-color);
}

/* Dark theme currency input */
[data-theme="dark"] .input-group-text {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .input-group:focus-within .input-group-text {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .input-group:focus-within .form-control {
    border-color: var(--primary-color);
}

/* Phone Input Group Styling */
.input-group .form-select {
    border-right: none;
    border-radius: 8px 0 0 8px;
    background: var(--card-bg);
    color: var(--text-color);
    font-weight: 500;
}

.input-group .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(4, 0, 222, 0.1);
}

.input-group:focus-within .form-select {
    border-color: var(--primary-color);
}

.input-group .form-select + .form-control {
    border-left: 1px solid var(--border-color);
    border-radius: 0 8px 8px 0;
}

/* Country Code Dropdown Styling */
#countryCode {
    font-size: 0.9rem;
    padding: 0.75rem 0.5rem;
}

#countryCode option {
    padding: 0.5rem;
    font-size: 0.9rem;
}   

/* Dark theme phone input */
[data-theme="dark"] .input-group .form-select {
    background: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .input-group .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .input-group:focus-within .form-select {
    border-color: var(--primary-color);
}

/* Pagination Styling */
.pagination-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.pagination-info {
    font-size: 0.9rem;
    font-weight: 500;
}

.pagination {
    margin: 0;
}

.pagination .page-item {
    margin: 0 2px;
}

.pagination .page-link {
    color: var(--text-color);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.pagination .page-link:hover {
    color: white;
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(4, 0, 222, 0.2);
}

.pagination .page-item.active .page-link {
    color: white;
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(4, 0, 222, 0.3);
}

.pagination .page-item.disabled .page-link {
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination .page-item.disabled .page-link:hover {
    transform: none;
    box-shadow: none;
}

/* Dark theme pagination */
[data-theme="dark"] .pagination-container {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .pagination .page-link {
    color: var(--text-color);
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .pagination .page-link:hover {
    color: white;
    background: var(--primary-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .pagination .page-item.active .page-link {
    color: white;
    background: var(--primary-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .pagination .page-item.disabled .page-link {
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

/* Responsive pagination */
@media (max-width: 768px) {
    .pagination-container {
        padding: 0.75rem 1rem;
    }
    
    .pagination-info {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .pagination {
        justify-content: center !important;
    }
    
    .pagination .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-width: 35px;
    }
}

@media (max-width: 576px) {
    .pagination-container .row {
        flex-direction: column;
        text-align: center;
    }
    
    .pagination-container .col-md-6 {
        width: 100%;
    }
    
    .pagination .page-item {
        margin: 0 1px;
    }
    
    .pagination .page-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
        min-width: 30px;
    }
}

/* Barang Modal Styling */
#barangDetailsModal .modal-dialog {
    max-width: 1200px;
}

#barangTable {
    margin-bottom: 0;
}

#barangTable th {
    background: var(--primary-color) !important;
    color: white !important;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    border: none;
    padding: 1rem 0.75rem;
}

#barangTable td {
    vertical-align: middle;
    padding: 0.75rem;
    border-color: var(--border-color);
    color: var(--text-color);
    background: var(--card-bg);
}

#barangTable tbody tr {
    background: var(--card-bg);
    color: var(--text-color);
}

#barangTable tbody tr:hover {
    background: var(--bg-secondary);
    color: var(--text-color);
}

#barangTable tbody tr:nth-child(even) {
    background: var(--bg-secondary);
    color: var(--text-color);
}

#barangTable tbody tr:nth-child(even):hover {
    background: var(--primary-color);
    color: white;
}

#barangTable tbody tr:hover td {
    color: var(--text-color);
}

#barangTable tbody tr:nth-child(even):hover td {
    color: white;
}

#barangTable code {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Dark theme for barang table */
[data-theme="dark"] #barangTable th {
    background: var(--primary-color) !important;
    color: white !important;
}

[data-theme="dark"] #barangTable td {
    color: var(--text-color);
    border-color: var(--border-color);
    background: var(--card-bg);
}

[data-theme="dark"] #barangTable tbody tr {
    background: var(--card-bg);
    color: var(--text-color);
}

[data-theme="dark"] #barangTable tbody tr:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--text-color);
}

[data-theme="dark"] #barangTable tbody tr:nth-child(even) {
    background: var(--bg-secondary);
    color: var(--text-color);
}

[data-theme="dark"] #barangTable tbody tr:nth-child(even):hover {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] #barangTable tbody tr:hover td {
    color: var(--text-color);
}

[data-theme="dark"] #barangTable tbody tr:nth-child(even):hover td {
    color: white;
}

[data-theme="dark"] #barangTable code {
    background: var(--primary-color);
    color: white;
}

/* Barang table action buttons */
#barangTable .btn-group .btn {
    border-color: var(--border-color);
    color: var(--text-color);
    background: var(--card-bg);
}

#barangTable .btn-group .btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

[data-theme="dark"] #barangTable .btn-group .btn {
    border-color: var(--border-color);
    color: var(--text-color);
    background: var(--card-bg);
}

[data-theme="dark"] #barangTable .btn-group .btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Add Barang Modal Styling */
#addBarangModal .modal-dialog {
    max-width: 800px;
}

#addBarangModal .form-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#addBarangModal .form-label i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

#addBarangModal .form-control,
#addBarangModal .form-select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    background: var(--card-bg);
    color: var(--text-color);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
}

#addBarangModal .form-control:focus,
#addBarangModal .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(4, 0, 222, 0.1);
    outline: none;
}

#addBarangModal .form-control:hover,
#addBarangModal .form-select:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(4, 0, 222, 0.1);
}

/* Dark theme for add barang modal */
[data-theme="dark"] #addBarangModal .form-label {
    color: var(--text-color);
}

[data-theme="dark"] #addBarangModal .form-label i {
    color: var(--primary-color);
}

[data-theme="dark"] #addBarangModal .form-control,
[data-theme="dark"] #addBarangModal .form-select {
    background: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] #addBarangModal .form-control:focus,
[data-theme="dark"] #addBarangModal .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] #addBarangModal .form-control:hover,
[data-theme="dark"] #addBarangModal .form-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.1);
}

/* Responsive barang modal */
@media (max-width: 768px) {
    #barangDetailsModal .modal-dialog {
        max-width: 95%;
        margin: 1rem auto;
    }
    
    #barangTable th,
    #barangTable td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    #barangTable th:nth-child(3),
    #barangTable th:nth-child(4),
    #barangTable th:nth-child(5),
    #barangTable th:nth-child(6),
    #barangTable td:nth-child(3),
    #barangTable td:nth-child(4),
    #barangTable td:nth-child(5),
    #barangTable td:nth-child(6) {
        display: none;
    }
}

@media (max-width: 576px) {
    #addBarangModal .modal-dialog {
        max-width: 95%;
        margin: 1rem auto;
    }
    
    #addBarangModal .form-control,
    #addBarangModal .form-select {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Readonly input styling */
.form-control[readonly] {
    background-color: var(--bg-color);
    opacity: 0.7;
    cursor: not-allowed;
}

/* Dark theme form styling */
[data-theme="dark"] .form-label {
    color: var(--text-color);
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .form-control:hover,
[data-theme="dark"] .form-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .form-control[readonly] {
    background-color: var(--bg-color);
    opacity: 0.7;
}

/* Consistent form spacing */
#createContractForm .row:last-child {
    margin-bottom: 0;
}

/* Form section spacing */
#createContractForm .section-header + .row {
    margin-top: 0.5rem;
}


.form-floating > .form-control {
    padding: 1rem 0.75rem 0.5rem 0.75rem;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    border-radius: 8px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
}

.form-floating > .form-control:focus {
    padding: 1rem 0.75rem 0.5rem 0.75rem;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(4, 0, 222, 0.1);
    outline: none;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-control:not([value=""]) ~ label {
    transform: scale(0.75) translateY(-0.5rem) translateX(0.15rem);
    color: var(--primary-color);
    font-weight: 500;
}

/* Form select styling */
.form-floating > .form-select {
    padding: 1rem 0.75rem 0.5rem 0.75rem;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    border-radius: 8px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
}

.form-floating > .form-select:focus {
    padding: 1rem 0.75rem 0.5rem 0.75rem;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(4, 0, 222, 0.1);
    outline: none;
}

.form-floating > .form-select:focus ~ label,
.form-floating > .form-select:not([value=""]) ~ label,
.form-floating > .form-select:not([value="0"]) ~ label {
    transform: scale(0.75) translateY(-0.5rem) translateX(0.15rem);
    color: var(--primary-color);
    font-weight: 500;
}

/* Textarea styling */
.form-floating > textarea.form-control {
    padding: 1rem 0.75rem 0.5rem 0.75rem;
    min-height: 80px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    border-radius: 8px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    resize: vertical;
}

.form-floating > textarea.form-control:focus {
    padding: 1rem 0.75rem 0.5rem 0.75rem;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(4, 0, 222, 0.1);
    outline: none;
}

/* Dark theme form floating */
[data-theme="dark"] .form-floating > label {
    color: var(--text-secondary);
    background: transparent;
}

[data-theme="dark"] .form-floating > .form-control {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .form-floating > .form-control:focus {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--text-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .form-floating > .form-select {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .form-floating > .form-select:focus {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--text-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Modern hover effects */
.form-floating > .form-control:hover,
.form-floating > .form-select:hover,
.form-floating > textarea.form-control:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px rgba(4, 0, 222, 0.1);
}

/* Dark theme hover effects */
[data-theme="dark"] .form-floating > .form-control:hover,
[data-theme="dark"] .form-floating > .form-select:hover,
[data-theme="dark"] .form-floating > textarea.form-control:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.1);
}

/* Ensure labels have no background in all themes */
.form-floating > label {
    background: transparent !important;
    background-color: transparent !important;
}

/* Light theme label background fix */
[data-theme="light"] .form-floating > label {
    background: transparent !important;
    background-color: transparent !important;
}

/* Floating label behavior for inputs with default values */
.form-floating > .form-control[value]:not([value=""]):not([value="0"]) ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-control:focus ~ label {
    transform: scale(0.75) translateY(-0.5rem) translateX(0.15rem);
    color: var(--primary-color);
    font-weight: 500;
}

/* Floating label behavior for selects with default values */
.form-floating > .form-select:not([value=""]):not([value="0"]) ~ label,
.form-floating > .form-select:focus ~ label {
    transform: scale(0.75) translateY(-0.5rem) translateX(0.15rem);
    color: var(--primary-color);
    font-weight: 500;
}

/* Floating label behavior for textareas */
.form-floating > textarea.form-control:not(:placeholder-shown) ~ label,
.form-floating > textarea.form-control:focus ~ label {
    transform: scale(0.75) translateY(-0.5rem) translateX(0.15rem);
    color: var(--primary-color);
    font-weight: 500;
}

/* JavaScript-controlled floating label behavior */
.form-floating > .form-control.has-value ~ label,
.form-floating > .form-control.focused ~ label,
.form-floating > .form-select.has-value ~ label,
.form-floating > .form-select.focused ~ label,
.form-floating > textarea.form-control.has-value ~ label,
.form-floating > textarea.form-control.focused ~ label {
    transform: scale(0.75) translateY(-0.5rem) translateX(0.15rem);
    color: var(--primary-color);
    font-weight: 500;
}

/* Form switch styling */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(4, 0, 222, 0.25);
}

/* Dark theme form switch */
[data-theme="dark"] .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

[data-theme="dark"] .form-check-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
}

/* Form Switch Styling */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(4, 0, 222, 0.25);
}

/* File Input Styling */
.form-control[type="file"] {
    padding: 0.75rem;
}

.form-control[type="file"]::-webkit-file-upload-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    margin-right: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-control[type="file"]::-webkit-file-upload-button:hover {
    background: var(--secondary-color);
}

/* Readonly Input Styling */
.form-control[readonly] {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Dark Theme Table Styling */
[data-theme="dark"] .contracts-table {
    background: var(--card-bg);
    color: white;
}

[data-theme="dark"] .contracts-table tbody tr {
    background: var(--card-bg);
    color: white;
}

[data-theme="dark"] .contracts-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
    color: white;
}

[data-theme="dark"] .contracts-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.15);
    color: white;
}

[data-theme="dark"] .contracts-table tbody td {
    background: transparent;
    border-bottom-color: var(--border-color);
    color: white;
}

[data-theme="dark"] .contracts-table tbody td strong {
    color: white;
}

[data-theme="dark"] .contracts-table tbody td small {
    color: rgba(255, 255, 255, 0.7);
}

/* Ensure all text in table cells is white in dark theme */
[data-theme="dark"] .contracts-table tbody td * {
    color: white !important;
}

[data-theme="dark"] .contracts-table tbody td .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

[data-theme="dark"] .contracts-table tbody td .contract-value {
    color: white !important;
}

[data-theme="dark"] .contracts-table tbody td .contract-dates {
    color: white !important;
}

[data-theme="dark"] .contracts-table tbody td .badge {
    color: white !important;
}

[data-theme="dark"] .contracts-table tbody td .badge.bg-secondary {
    background: rgba(156, 163, 175, 0.8) !important;
    color: white !important;
}

/* Dark Theme Dropdown Styling */
[data-theme="dark"] .dropdown-menu {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px var(--shadow-color);
}

[data-theme="dark"] .dropdown-item {
    color: var(--text-color);
    background: transparent;
}

[data-theme="dark"] .dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-color);
}

[data-theme="dark"] .dropdown-item:focus {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-color);
}

[data-theme="dark"] .dropdown-divider {
    border-top-color: var(--border-color);
}

/* Dark Theme Form Select Styling */
[data-theme="dark"] .form-select {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .form-select:focus {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--text-color);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .form-select option {
    background: var(--card-bg);
    color: var(--text-color);
}

/* Dark Theme Form Control Styling */
[data-theme="dark"] .form-control {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .form-control:focus {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--text-color);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--text-secondary);
}

/* Dark Theme Input Group Styling */
[data-theme="dark"] .input-group-text {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Dark Theme Modal Styling */
[data-theme="dark"] .modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .modal-header {
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .modal-footer {
    border-top-color: var(--border-color);
}

/* Dark Theme Alert Styling */
[data-theme="dark"] .alert-info {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--text-color);
}

[data-theme="dark"] .alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: var(--text-color);
}

[data-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--text-color);
}

/* Dark Theme Badge Styling */
[data-theme="dark"] .badge {
    color: white;
}

[data-theme="dark"] .badge.bg-secondary {
    background: rgba(156, 163, 175, 0.8) !important;
    color: white;
}

/* Dark Theme Type Badge Styling */
[data-theme="dark"] .type-badge {
    color: var(--text-color);
}

[data-theme="dark"] .type-logistik {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

[data-theme="dark"] .type-penyimpanan {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

[data-theme="dark"] .type-bongkar_muat {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

[data-theme="dark"] .type-transportasi {
    background: rgba(168, 85, 247, 0.2);
    color: #a78bfa;
}

/* Dark Theme Status Badge Styling */
[data-theme="dark"] .status-badge {
    color: var(--text-color);
}

[data-theme="dark"] .status-draft {
    background: rgba(156, 163, 175, 0.2);
    color: #d1d5db;
}

[data-theme="dark"] .status-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

[data-theme="dark"] .status-active {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

[data-theme="dark"] .status-completed {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

[data-theme="dark"] .status-expired {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Dark Theme Text Muted */
[data-theme="dark"] .text-muted {
    color: var(--text-secondary) !important;
}

/* Dark Theme Small Text */
[data-theme="dark"] small {
    color: var(--text-secondary);
}

/* Dark Theme Form Text */
[data-theme="dark"] .form-text {
    color: var(--text-secondary);
}

/* Responsive adjustments for modals */
@media (max-width: 768px) {
    .method-card {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }
    
    .method-icon {
        font-size: 2.5rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
    
    .section-header h6 {
        font-size: 0.9rem;
    }
}

/* ===== QR SCANNER IMPROVEMENTS ===== */
.qr-scanner-section .card {
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.qr-scanner-section .btn {
    transition: all 0.3s ease;
}

.qr-scanner-section .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.qr-scanner-section .btn i.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.qr-scanner-section #previewWrapper {
    position: relative;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.qr-scanner-section #previewWrapper img,
.qr-scanner-section #previewWrapper video {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.qr-scanner-section .qr-result .form-control {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
}

/* ===== RESPONSIVE TABLE IMPROVEMENTS ===== */
.contracts-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.contracts-table {
    min-width: 1000px;
    margin-bottom: 0;
}

.contracts-table th,
.contracts-table td {
    white-space: nowrap;
    vertical-align: middle;
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
}

.contracts-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

.contracts-table td {
    border-top: 1px solid var(--border-color);
    background: white;
}

.contracts-table tbody tr:hover td {
    background: #f8f9fa;
}

.contracts-table .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin: 0 0.125rem;
}

.contracts-table .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* Mobile table improvements */
@media (max-width: 768px) {
    .contracts-table {
        min-width: 800px;
    }
    
    .contracts-table th,
    .contracts-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .contracts-table .btn-sm {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
        margin: 0 0.1rem;
    }
    
    .contracts-table .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 576px) {
    .contracts-table {
        min-width: 700px;
    }
    
    .contracts-table th,
    .contracts-table td {
        padding: 0.4rem 0.2rem;
        font-size: 0.75rem;
    }
    
    .contracts-table .btn-sm {
        padding: 0.15rem 0.3rem;
        font-size: 0.65rem;
        margin: 0 0.05rem;
    }
    
    .contracts-table .badge {
        font-size: 0.6rem;
        padding: 0.15rem 0.3rem;
    }
    
    /* Hide less important columns on very small screens */
    .contracts-table .d-sm-none {
        display: none !important;
    }
}

/* ===== MOBILE SIDEBAR TOGGLE ===== */
.mobile-sidebar-toggle {
    display: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(4, 0, 222, 0.3);
    margin-right: 0.5rem;
    position: relative;
    overflow: hidden;
}

.mobile-sidebar-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.mobile-sidebar-toggle:hover::before {
    left: 100%;
}

.mobile-sidebar-toggle:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(4, 0, 222, 0.4);
}

.mobile-sidebar-toggle:active {
    transform: scale(0.95);
}

.mobile-sidebar-toggle i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.mobile-sidebar-toggle:hover i {
    transform: rotate(90deg);
}

/* ===== MOBILE SIDEBAR CLOSE BUTTON ===== */
.mobile-sidebar-close {
    display: none;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.mobile-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mobile-sidebar-close:active {
    transform: scale(0.95);
}

.mobile-sidebar-close i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.mobile-sidebar-close:hover i {
    transform: rotate(90deg);
}

/* ===== DESKTOP SIDEBAR TOGGLE HIDDEN ===== */
.sidebar-toggle {
    display: none !important;
}

/* ===== FORCE SIDEBAR TEXT WHITE ===== */
.sidebar {
    color: white !important;
}

.sidebar * {
    color: white !important;
}

.sidebar .sidebar-header h3 {
    color: white !important;
}

.sidebar .sidebar-nav .nav-link {
    color: white !important;
}

.sidebar .sidebar-nav .nav-link span {
    color: white !important;
}

.sidebar .sidebar-nav .nav-link i {
    color: white !important;
}

.sidebar .nav-item {
    color: white !important;
}

.sidebar .nav-item * {
    color: white !important;
}

/* Desktop active state - keep normal */
@media (min-width: 768px) {
    .sidebar .nav-link.active {
        background: rgba(255, 255, 255, 0.1) !important;
        color: white !important;
    }
}

/* ===== COMPREHENSIVE RESPONSIVE DESIGN ===== */

/* Extra Small devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    /* Sidebar adjustments */
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
        z-index: 1050;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        overflow-y: auto;
        background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    /* Ensure mobile sidebar text is white and properly styled */
    .sidebar .sidebar-header h3 {
        color: white !important;
        font-weight: 600;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }
    
    .sidebar .sidebar-nav .nav-link {
        color: white !important;
        transition: all 0.3s ease;
        font-weight: 500;
    }
    
    .sidebar .sidebar-nav .nav-link:hover,
    .sidebar .sidebar-nav .nav-link.active {
        color: white !important;
        background: rgba(255, 255, 255, 0.2);
        transform: translateX(5px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar .sidebar-nav .nav-link i {
        color: white !important;
        transition: all 0.3s ease;
    }
    
    .sidebar .sidebar-nav .nav-link:hover i,
    .sidebar .sidebar-nav .nav-link.active i {
        color: white !important;
        transform: scale(1.1);
    }
    
    .sidebar     .sidebar-nav .nav-link span {
        color: white !important;
        font-weight: 500;
        opacity: 1 !important;
        width: auto !important;
        overflow: visible !important;
        display: inline !important;
    }
    
    /* Force all sidebar text to be white - AGGRESSIVE */
    .sidebar * {
        color: white !important;
    }
    
    .sidebar .nav-link,
    .sidebar .nav-link *,
    .sidebar .nav-item,
    .sidebar .nav-item * {
        color: white !important;
    }
    
    .sidebar ul,
    .sidebar ul *,
    .sidebar li,
    .sidebar li * {
        color: white !important;
    }
    
    .sidebar a,
    .sidebar a * {
        color: white !important;
    }
    
    .sidebar i,
    .sidebar i * {
        color: white !important;
    }
    
    .sidebar span,
    .sidebar span * {
        color: white !important;
    }
    
    /* Remove active state on mobile only */
    .sidebar .nav-link.active {
        background: transparent !important;
        color: white !important;
    }
    
    .sidebar .nav-link.active:hover {
        background: rgba(255, 255, 255, 0.2) !important;
    }
    
    /* Mobile sidebar overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        backdrop-filter: blur(2px);
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    /* Mobile toggle button in navbar */
    .mobile-sidebar-toggle {
        display: flex !important;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .mobile-sidebar-toggle i {
        font-size: 16px;
    }
    
    /* Mobile sidebar close button */
    .mobile-sidebar-close {
        display: flex !important;
    }
    
    /* Hide desktop sidebar toggle on mobile */
    .sidebar-toggle {
        display: none !important;
    }
    
    /* Ensure sidebar header is properly styled on mobile */
    .sidebar-header {
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        background: rgba(255, 255, 255, 0.1);
    }
    
    .sidebar-header h3 {
        font-size: 1.1rem;
        margin: 0;
    }
    
    /* Mobile sidebar nav adjustments */
    .sidebar-nav {
        padding: 0.5rem 0;
    }
    
    .sidebar-nav .nav-item {
        margin: 0.25rem 0.5rem;
    }
    
    .sidebar-nav .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        border-radius: 8px;
        margin: 0.125rem 0;
    }
    
    .sidebar-nav .nav-link i {
        width: 20px;
        margin-right: 0.75rem;
        text-align: center;
    }
    
    /* Top navbar adjustments */
    .top-navbar {
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    /* Page header adjustments */
    .page-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-header p {
        font-size: 0.9rem;
    }
    
    /* Action buttons responsive */
    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .action-buttons .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Stats cards responsive */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .stat-card p {
        font-size: 0.8rem;
    }
    
    /* Filters responsive */
    .filters-section {
        padding: 1rem;
    }
    
    .filters-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filters-row .col-md-3,
    .filters-row .col-md-4,
    .filters-row .col-md-5 {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Table responsive - Mobile specific */
    .table-responsive {
        border-radius: 8px;
        margin: 0;
        font-size: 0.8rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .contracts-table {
        font-size: 0.8rem;
        min-width: 600px; /* Ensure minimum width for horizontal scroll */
    }
    
    .contracts-table th,
    .contracts-table td {
        padding: 0.5rem 0.3rem;
        white-space: nowrap;
        vertical-align: middle;
    }
    
    /* Ensure all headers are visible on mobile */
    .contracts-table thead th {
        font-size: 0.75rem;
        padding: 0.5rem 0.3rem;
        text-align: center;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        color: white;
        border: none;
        font-weight: 600;
    }
    
    /* Mobile table cell styling */
    .contracts-table tbody td {
        font-size: 0.75rem;
        padding: 0.5rem 0.3rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    /* Hide some columns on mobile but keep essential ones */
    .contracts-table .d-none-mobile {
        display: none !important;
    }
    
    /* Bulk actions responsive */
    .bulk-actions {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .bulk-actions .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 8px;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
    
    /* Form responsive */
    .modal-body .row {
        margin-bottom: 0;
    }
    
    .modal-body .col-md-6 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .modal-body .form-floating {
        margin-bottom: 1rem;
    }
    
    .section-header {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
    
    .section-header h6 {
        font-size: 0.85rem;
    }
    
    /* Mobile form floating fixes */
    .form-floating > label {
        font-size: 0.9rem;
        transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    }
    
    .form-floating > .form-control {
        font-size: 0.9rem;
        padding-top: 1.5rem;
        padding-bottom: 0.5rem;
    }
    
    .form-floating > .form-control:focus {
        padding-top: 1.5rem;
        padding-bottom: 0.5rem;
    }
    
    .form-floating > .form-select {
        font-size: 0.9rem;
        padding-top: 1.5rem;
        padding-bottom: 0.5rem;
    }
    
    .form-floating > .form-select:focus {
        padding-top: 1.5rem;
        padding-bottom: 0.5rem;
    }
    
    .form-floating > textarea.form-control {
        padding-top: 1.5rem;
        padding-bottom: 0.5rem;
        min-height: 70px;
    }
    
    .form-floating > textarea.form-control:focus {
        padding-top: 1.5rem;
        padding-bottom: 0.5rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Stats cards 2 columns */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* Action buttons in row */
    .action-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .action-buttons .btn {
        flex: 1;
        min-width: 120px;
    }
    
    /* Filters in 2 columns */
    .filters-row {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .filters-row .col-md-3 {
        width: 48%;
    }
    
    .filters-row .col-md-4 {
        width: 48%;
    }
    
    .filters-row .col-md-5 {
        width: 100%;
    }
    
    /* Table adjustments */
    .contracts-table th,
    .contracts-table td {
        padding: 0.6rem 0.4rem;
        font-size: 0.85rem;
    }
    
    /* Form floating adjustments for small screens */
    .form-floating > label {
        font-size: 0.9rem;
    }
    
    .form-floating > .form-control {
        font-size: 0.9rem;
    }
    
    .form-floating > .form-select {
        font-size: 0.9rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Sidebar adjustments */
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-left: 250px;
    }
    
    /* Stats cards 2x2 grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Table adjustments */
    .contracts-table th,
    .contracts-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
    }
    
    /* Modal adjustments */
    .modal-dialog.modal-lg {
        max-width: 90%;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    /* Full sidebar */
    .sidebar {
        width: 280px;
    }
    
    .main-content {
        margin-left: 280px;
    }
    
    /* Full stats grid */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    /* Full table */
    .contracts-table th,
    .contracts-table td {
        padding: 1rem 0.75rem;
        font-size: 1rem;
    }
    
    /* Full modal */
    .modal-dialog.modal-lg {
        max-width: 800px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container-fluid {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2.5rem;
    }
    
    .stat-card {
        padding: 2rem;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .top-navbar,
    .action-buttons,
    .bulk-actions,
    .filters-section {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .contracts-table {
        font-size: 0.8rem;
    }
    
    .contracts-table th,
    .contracts-table td {
        padding: 0.25rem;
        border: 1px solid #000;
    }
}

/* Chat Interface Styles */
.chat-container {
    height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f8f9fa;
    max-height: 400px;
}

.chat-message {
    margin-bottom: 1rem;
    display: flex;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.admin {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    word-wrap: break-word;
}

.message-bubble.user {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.message-bubble.admin {
    background: #e3f2fd;
    color: var(--text-color);
    border: 1px solid #bbdefb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    opacity: 0.7;
}

.chat-input {
    padding: 1rem;
    background: white;
    border-top: 1px solid var(--border-color);
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: #28a745;
}

.status-indicator.offline {
    background-color: #dc3545;
}

.max-w-75 {
    max-width: 75%;
}

@media (max-width: 768px) {
    .max-w-75 {
        max-width: 90%;
    }
    
    .chat-container {
        height: 500px;
    }
    
    .chat-messages {
        max-height: 300px;
    }
}

/* Admin Chat Interface Styles */
.user-item {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.user-item:hover {
    background-color: #f8f9fa !important;
    border-left-color: var(--primary-color);
}

.user-item.bg-primary {
    border-left-color: white;
}

.user-item.bg-primary:hover {
    background-color: var(--primary-color) !important;
}

.user-avatar {
    position: relative;
}

.user-list {
    background-color: white;
}

.user-list::-webkit-scrollbar {
    width: 6px;
}

.user-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.user-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.user-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.cursor-pointer {
    cursor: pointer;
}

.admin-chat-container {
    height: 600px;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    overflow: hidden;
    background: white;
}

.no-chat-selected {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

@media (max-width: 768px) {
    .admin-chat-container {
        height: 500px;
    }
    
    .user-list {
        max-height: 300px;
    }
}

/* Video Call Styles */
.video-call-area {
    background: #000;
    border-radius: 0.375rem;
    overflow: hidden;
    position: relative;
    height: 500px;
    display: flex;
    flex-direction: column;
    border: 2px solid #333;
}

/* Ensure controls panel is always visible */
.video-call-area .video-controls-panel {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1000 !important;
    background: rgba(0, 0, 0, 0.95) !important;
    min-height: 80px !important;
}

.video-call-area * {
    box-sizing: border-box;
}

.video-call-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #000;
    overflow: visible;
    min-height: 0;
}

.video-chat-layout {
    display: flex;
    flex: 1;
    height: 100%;
    min-height: 0;
}

.video-chat-panel {
    width: 300px;
    background: #f8f9fa;
    border-left: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-height: 0;
    padding-bottom: 0.5rem;
}

.chat-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.chat-panel-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

.video-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    max-height: calc(100% - 60px);
}

.video-chat-message {
    margin-bottom: 0.75rem;
    display: flex;
}

.video-chat-message.own {
    justify-content: flex-end;
}

.video-chat-message.other {
    justify-content: flex-start;
}

.video-chat-message .message-content {
    max-width: 80%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    position: relative;
}

.video-chat-message.own .message-content {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.video-chat-message.other .message-content {
    background: #e9ecef;
    color: #333;
    border-bottom-left-radius: 0.25rem;
}

.video-chat-message .message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.video-chat-message .sender-name {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.8;
}

.video-chat-message .message-time {
    font-size: 0.7rem;
    opacity: 0.7;
}

.video-chat-message .message-text {
    font-size: 0.875rem;
    line-height: 1.4;
}

.video-chat-input {
    padding: 0.75rem;
    border-top: 1px solid #dee2e6;
    background: white;
    margin-bottom: 1rem;
}

.video-chat-input .form-control {
    font-size: 0.875rem;
}

.video-chat-input .btn {
    font-size: 0.875rem;
}

.main-video-area {
    position: relative;
    flex: 1;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
}

.main-video-area video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remote-video-container {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 200px;
    height: 150px;
    background: #2a2a2a;
    border-radius: 0.375rem;
    overflow: hidden;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.remote-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}


.video-controls-panel {
    background: rgba(0, 0, 0, 0.95) !important;
    padding: 1rem !important;
    border-top: 1px solid #333 !important;
    position: relative !important;
    z-index: 1000 !important;
    flex-shrink: 0 !important;
    min-height: 80px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    visibility: visible !important;
    opacity: 1 !important;
    order: 999 !important;
    margin-top: 0.5rem;
}

.controls-row {
    display: flex !important;
    justify-content: center !important;
    gap: 1rem !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    max-width: 600px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.control-btn {
    min-width: 45px !important;
    height: 45px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    cursor: pointer !important;
    font-size: 16px !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1001 !important;
    flex-shrink: 0 !important;
}

.control-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.control-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.control-btn.recording {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    animation: pulse 1.5s infinite;
}

.control-btn.transcribing {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    animation: pulse 1.5s infinite;
}

.control-btn.btn-danger {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.control-btn.btn-danger:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
}

.control-btn.active {
    background: rgba(13, 110, 253, 0.8) !important;
    border-color: rgba(13, 110, 253, 0.8) !important;
}

.control-btn.sharing {
    background: rgba(255, 193, 7, 0.8) !important;
    border-color: rgba(255, 193, 7, 0.8) !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Notes Panel */
.notes-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 300px;
    height: 200px;
    background: white;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.notes-header {
    display: flex;
    justify-content: between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
    border-radius: 0.375rem 0.375rem 0 0;
}

.notes-content {
    padding: 0.75rem;
    height: calc(100% - 60px);
    display: flex;
    flex-direction: column;
}

.notes-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

.note-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 0.25rem;
    border-left: 3px solid var(--primary-color);
}

.note-content {
    flex: 1;
    margin-right: 0.5rem;
}

.notes-input {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.notes-input input {
    flex: 1;
}

.notes-input button {
    min-width: 35px;
    height: 35px;
}

/* Video call button in header */
#startVideoCallBtn {
    transition: all 0.3s ease;
}

#startVideoCallBtn:hover {
    transform: scale(1.05);
}

/* Responsive video call */
@media (max-width: 768px) {
    .video-call-area {
        height: 400px;
    }
    
    .video-chat-layout {
        flex-direction: column;
    }
    
    .video-chat-panel {
        width: 100%;
        height: 150px;
        border-left: none;
        border-top: 1px solid #dee2e6;
    }
    
    .remote-video-container {
        width: 150px;
        height: 110px;
        top: 5px;
        right: 5px;
    }
    
    .video-controls-panel {
        padding: 0.5rem !important;
        min-height: 70px !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 1000 !important;
    }
    
    .controls-row {
        gap: 0.5rem;
    }
    
    .control-btn {
        min-width: 40px;
        height: 40px;
        font-size: 0.8rem;
    }
    
    .notes-panel {
        width: 250px;
        height: 180px;
    }
    
    .notes-header {
        padding: 0.5rem;
    }
    
    .notes-content {
        padding: 0.5rem;
    }
    
    .video-chat-messages {
        max-height: 80px;
    }
    
    .video-chat-input {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 480px) {
    .remote-video-container {
        width: 120px;
        height: 90px;
        top: 5px;
        right: 5px;
    }
    
    .video-overlay {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .video-chat-input {
        padding: 0.4rem;
        margin-bottom: 0.5rem;
    }
    
    .video-controls-panel {
        margin-top: 0.25rem !important;
    }
}

/* Dashboard Enhancement Styles */

/* Filter Section */
.filter-section {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.filter-section .form-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

/* Performance Sections */
.performance-section {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
    height: 100%;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.performance-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.performance-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(40, 167, 69, 0.1));
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.performance-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.performance-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.performance-info {
    flex: 1;
}

.performance-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.performance-score {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.performance-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.performance-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Company Metrics */
.company-metrics {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metric-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.metric-icon.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.metric-icon.warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.metric-icon.info {
    background: linear-gradient(135deg, #17a2b8, #007bff);
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.metric-label {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

/* Financial Dashboard */
.financial-dashboard {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.financial-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.financial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px var(--shadow-color);
}

.financial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.financial-card.revenue::before {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.financial-card.expense::before {
    background: linear-gradient(90deg, #dc3545, #fd7e14);
}

.financial-card.profit::before {
    background: linear-gradient(90deg, #007bff, #6f42c1);
}

.financial-card.budget::before {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.financial-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.financial-card.revenue .financial-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.financial-card.expense .financial-icon {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
}

.financial-card.profit .financial-icon {
    background: linear-gradient(135deg, #007bff, #6f42c1);
}

.financial-card.budget .financial-icon {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.financial-content {
    text-align: center;
}

.financial-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.financial-label {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 0.75rem;
}

.financial-change {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    display: inline-block;
}

.financial-change.positive {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.financial-change.negative {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.financial-change.neutral {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* Activity Log Styles */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.table {
    margin-bottom: 0;
}

.table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
}

.table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-color: var(--border-color);
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(0, 123, 255, 0.05);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .chart-container canvas {
        max-height: 230px !important;
    }
}

@media (max-width: 992px) {
    .filter-section .row > div {
        margin-bottom: 1rem;
    }
    
    .performance-grid {
        gap: 0.75rem;
    }
    
    .company-metrics {
        gap: 0.75rem;
    }
    
    .financial-value {
        font-size: 1.5rem;
    }
    
    .metric-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .filter-section {
        padding: 1rem;
    }
    
    .chart-container {
        height: 250px;
        padding: 1rem;
    }
    
    .chart-container canvas {
        max-height: 180px !important;
    }
    
    .performance-section,
    .financial-dashboard {
        padding: 1rem;
    }
    
    .performance-card,
    .metric-card {
        padding: 0.75rem;
    }
    
    .performance-icon,
    .metric-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .financial-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .financial-value {
        font-size: 1.25rem;
    }
    
    .performance-score {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .chart-container {
        height: 200px;
        padding: 0.75rem;
    }
    
    .chart-container canvas {
        max-height: 130px !important;
    }
    
    .chart-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .section-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .performance-card {
        flex-direction: column;
        text-align: center;
    }
    
    .performance-icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .metric-card {
        flex-direction: column;
        text-align: center;
    }
    
    .metric-icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .financial-card {
        padding: 1rem;
    }
    
    .financial-value {
        font-size: 1.1rem;
    }
    
    .financial-label {
        font-size: 0.85rem;
    }
}

/* Visual Indicators for Risk Levels */
.risk-indicator {
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.risk-low {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid #28a745;
}

.risk-medium {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.risk-high {
    background: rgba(253, 126, 20, 0.1);
    color: #fd7e14;
    border: 1px solid #fd7e14;
}

.risk-critical {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid #dc3545;
}

/* Animation Enhancements */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dark Theme Enhancements */
[data-theme="dark"] .table th {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .performance-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
}

[data-theme="dark"] .badge {
    color: white !important;
}

/* QR Scanner Styles */
.qr-scanner-container {
    max-width: 800px;
    margin: 0 auto;
}

.preview-wrapper {
    display: none;
}

.preview-media {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: .5rem;
    box-shadow: 0 6px 18px rgba(22, 28, 45, 0.06);
    background: #000;
}

.preview-actions .btn {
    min-width: 150px;
}

/* Contracts Management Styles */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.contract-filters {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 2px 10px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.contracts-table-container {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow-color);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.contracts-table {
    margin-bottom: 0;
}

.contracts-table thead th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem 0.75rem;
    text-align: center;
    vertical-align: middle;
}

.contracts-table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    border-color: var(--border-color);
    text-align: center;
}

.contracts-table tbody tr:hover {
    background: rgba(0, 123, 255, 0.05);
}

.bulk-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.pagination-container {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 2px 10px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.pagination-info {
    font-size: 0.9rem;
}

/* Method Selection Modal Styles */
.method-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
}

.method-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px var(--shadow-color);
    transform: translateY(-2px);
}

.method-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin: 0 auto 1rem auto;
}

.method-card h6 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.method-card p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.section-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.section-header h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin: 0;
}

/* Responsive adjustments for contracts */
@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .contract-filters .row > div {
        margin-bottom: 0.5rem;
    }
    
    .contracts-table thead th,
    .contracts-table tbody td {
        padding: 0.5rem 0.25rem;
        font-size: 0.85rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
    }
}

@media (max-width: 576px) {
    .contracts-table thead th,
    .contracts-table tbody td {
        padding: 0.25rem;
        font-size: 0.8rem;
    }
    
    .pagination-container .row {
        flex-direction: column;
        text-align: center;
    }
    
    .pagination-container .col-md-6 {
        margin-bottom: 0.5rem;
    }
}
