/* Material UI - Clean White Modern Design */

:root {
    --mdc-primary: #1976d2;
    --mdc-primary-light: #42a5f5;
    --mdc-primary-dark: #1565c0;
    --mdc-secondary: #26a69a;
    --mdc-surface: #ffffff;
    --mdc-background: #f5f7fa;
    --mdc-error: #d32f2f;
    --mdc-on-primary: #ffffff;
    --mdc-on-surface: #212121;
    --mdc-on-surface-light: #757575;
    
    /* Subtle colors */
    --border-color: #e0e0e0;
    --border-hover: #bdbdbd;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--mdc-background);
    color: var(--mdc-on-surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - Clean White */
.sidebar {
    width: 260px;
    background: var(--mdc-surface);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    border-right: 1px solid var(--border-color);
    overflow: hidden;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: var(--mdc-primary);
    color: white;
    border: none;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    box-shadow: var(--shadow);
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar .logo {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar .logo h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--mdc-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .logo i {
    font-size: 24px;
    color: var(--mdc-primary);
}

.nav-menu {
    list-style: none;
    padding: 16px 0;
    flex: 1;
    overflow-y: auto;
}

.nav-menu li {
    margin: 4px 12px;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--mdc-on-surface-light);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
}

.nav-menu a:hover {
    background: rgba(25, 118, 210, 0.08);
    color: var(--mdc-primary);
}

.nav-menu a.active {
    background: rgba(25, 118, 210, 0.12);
    color: var(--mdc-primary);
    font-weight: 600;
}

.nav-menu a i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.user-info {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: var(--mdc-background);
}

.user-details {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--mdc-on-surface);
}

.user-details i {
    font-size: 32px;
    color: var(--mdc-primary);
}

.user-details div {
    flex: 1;
}

.user-details strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--mdc-on-surface);
}

.user-role {
    font-size: 12px;
    color: var(--mdc-on-surface-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--mdc-on-surface);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: var(--mdc-background);
    border-color: var(--border-hover);
    color: var(--mdc-error);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    background: var(--mdc-background);
    min-height: 100vh;
}

.header {
    background: var(--mdc-surface);
    padding: 20px 32px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--mdc-on-surface);
    margin: 0;
}

.content-section {
    padding: 24px 32px;
}

.content-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--mdc-on-surface);
    margin-bottom: 20px;
    margin-top: 0;
}

/* Material Cards */
.card {
    background: var(--mdc-surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow);
}

/* Material Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--mdc-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--mdc-primary-dark);
}

.btn-secondary {
    background: var(--mdc-surface);
    color: var(--mdc-on-surface);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--mdc-background);
    border-color: var(--border-hover);
}

.btn-danger {
    background: var(--mdc-error);
    color: white;
}

.btn-danger:hover {
    background: #c62828;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Material Form Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--mdc-on-surface);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    background: var(--mdc-surface);
    transition: all 0.2s ease;
    outline: none;
    color: var(--mdc-on-surface);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--mdc-primary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
    border-color: var(--border-hover);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.required {
    color: var(--mdc-error);
}

/* Material Table */
.table-container {
    background: var(--mdc-surface);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.table-container .data-table {
    flex: 1;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--mdc-background);
    border-bottom: 2px solid var(--border-color);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--mdc-on-surface);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--mdc-on-surface);
    font-size: 14px;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: var(--mdc-background);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.text-center {
    text-align: center;
    color: var(--mdc-on-surface-light);
    padding: 32px !important;
    font-size: 14px;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
    padding: 20px 0;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--mdc-surface);
    color: var(--mdc-on-surface-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    border: 2px solid var(--border-color);
}

.step.active .step-number {
    background: var(--mdc-primary);
    color: white;
    border-color: var(--mdc-primary);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.step.completed .step-number {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.step-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--mdc-on-surface-light);
    text-align: center;
}

.step.active .step-label {
    color: var(--mdc-primary);
    font-weight: 600;
}

.step.completed .step-label {
    color: #4caf50;
}

/* Form Steps */
.form-step {
    background: var(--mdc-surface);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 0;
}


.step-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 28px;
    color: var(--mdc-on-surface);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* Outsourcing Section */
.outsourcing-section {
    padding: 24px;
    background: var(--mdc-background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.outsourcing-section .form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.outsourcing-section input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
    animation: slideIn 0.3s ease;
}

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

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid var(--mdc-error);
}

/* Select2 Material Style - Simple and working */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 44px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    background: var(--mdc-surface) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 44px !important;
    padding-left: 14px !important;
    color: var(--mdc-on-surface) !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px !important;
    right: 12px !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 44px !important;
    padding-left: 14px !important;
    padding-right: 30px !important;
    color: var(--mdc-on-surface) !important;
    font-size: 15px !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--mdc-on-surface-light) !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--mdc-primary) !important;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1) !important;
}

.select2-container--default .select2-selection--single:hover {
    border-color: var(--border-hover) !important;
}

/* Select2 Dropdown */
.select2-container--default .select2-dropdown {
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    box-shadow: var(--shadow-md) !important;
    margin-top: 4px !important;
    background: var(--mdc-surface) !important;
    z-index: 9999 !important;
}

.select2-dropdown {
    z-index: 9999 !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 15px;
    outline: none;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--mdc-primary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.select2-container--default .select2-results__option {
    padding: 10px 14px;
    font-size: 15px;
    color: var(--mdc-on-surface);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: rgba(25, 118, 210, 0.1);
    color: var(--mdc-primary);
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background: var(--mdc-primary);
    color: white;
}

.select2-container--default .select2-results__option[aria-selected=true]:hover {
    background: var(--mdc-primary-dark);
}

/* File Upload */
.file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--mdc-background);
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    color: var(--mdc-on-surface);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
}

.file-upload-label:hover {
    background: var(--mdc-surface);
    border-color: var(--mdc-primary);
    color: var(--mdc-primary);
}

input[type="file"] {
    display: none;
}

/* Document Items */
.document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--mdc-background);
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}

.document-item a {
    color: var(--mdc-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.document-item a:hover {
    text-decoration: underline;
}

/* Dashboard Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 32px 32px 32px 32px;
}

.stat-card {
    background: var(--mdc-surface);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: var(--mdc-primary);
}

.stat-icon.green {
    background: #4caf50;
}

.stat-icon.orange {
    background: #ff9800;
}

.stat-icon.purple {
    background: #9c27b0;
}

.stat-icon.red {
    background: var(--mdc-error);
}

.stat-icon.teal {
    background: var(--mdc-secondary);
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 2px;
    color: var(--mdc-on-surface);
    line-height: 1.2;
}

.stat-info p {
    font-size: 12px;
    color: var(--mdc-on-surface-light);
    font-weight: 500;
    margin: 0;
}

/* Passport Tracking */
.passport-tracking-section {
    padding: 24px;
    background: var(--mdc-background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.passport-section {
    margin-bottom: 24px;
}

.passport-section:last-child {
    margin-bottom: 0;
}

.passport-history {
    margin-top: 16px;
}

.passport-history-item {
    padding: 12px;
    background: var(--mdc-surface);
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    font-size: 13px;
}

.passport-history-item .history-date {
    font-weight: 600;
    color: var(--mdc-on-surface);
    margin-bottom: 4px;
}

.passport-history-item .history-remark {
    color: var(--mdc-on-surface-light);
    margin-top: 4px;
}

.passport-history-item .history-user {
    margin-top: 6px;
    font-size: 12px;
    color: var(--mdc-on-surface-light);
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        margin: 28px 24px 24px 24px;
    }
    
    .content-section {
        padding: 20px 24px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-menu-overlay.active {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .header {
        padding: 16px 20px;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        margin: 24px 16px 24px 16px;
        gap: 16px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
    }
    
    .history-item {
        flex-direction: column;
        gap: 12px;
    }
    
    .document-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .stat-info h3 {
        font-size: 24px;
    }
    
    .content-section {
        padding: 16px;
    }
    
    .content-section h2 {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-step {
        padding: 20px;
    }
    
    .step-indicator {
        flex-direction: column;
        gap: 16px;
        padding: 16px 0;
    }
    
    .step-indicator::before {
        display: none;
    }
    
    .step {
        flex-direction: row;
        width: 100%;
        justify-content: flex-start;
        gap: 12px;
    }
    
    .step-number {
        width: 36px;
        height: 36px;
        font-size: 14px;
        margin-bottom: 0;
    }
    
    .step-label {
        text-align: left;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
        max-width: none;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px 16px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .stats-grid {
        margin: 12px 12px 20px 12px;
        gap: 12px;
    }
    
    .stat-card {
        padding: 14px;
        gap: 12px;
    }
    
    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .stat-info h3 {
        font-size: 22px;
    }
    
    .stat-info p {
        font-size: 11px;
    }
    
    .content-section {
        padding: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .filter-section {
        padding: 16px;
    }
    
    .table-filters {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .table-results {
        padding: 10px 16px;
    }
}

/* Modal Styles */
.modal,
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    padding: 20px;
    align-items: flex-start;
    justify-content: center;
}

.modal-overlay {
    display: flex;
}

.modal-content {
    background-color: var(--mdc-surface);
    margin: 50px auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content.large {
    max-width: 900px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--mdc-on-surface);
}

.close,
.modal-close {
    color: var(--mdc-on-surface-light);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover,
.modal-close:hover {
    color: var(--mdc-on-surface);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--mdc-on-surface);
    margin: 0;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Table Filters - Integrated with Table */
.table-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px 20px;
    background: var(--mdc-background);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.table-filters .btn {
    padding: 10px 16px;
    font-size: 14px;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    border: 1px solid var(--border-color);
    background: var(--mdc-surface);
    color: var(--mdc-on-surface);
    font-weight: 500;
}

.table-filters .btn:hover {
    transform: none;
    box-shadow: none;
    background: var(--mdc-background);
    border-color: var(--border-hover);
}

.table-filters .btn i {
    margin-right: 6px;
}

.table-filters .btn {
    margin-left: auto;
    padding: 10px 16px;
    font-size: 14px;
    box-shadow: none;
    border: 1px solid var(--border-color);
}

.table-filters .btn:hover {
    transform: none;
    background: var(--mdc-background);
    border-color: var(--border-hover);
}

.table-results {
    padding: 12px 20px;
    background: var(--mdc-background);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--mdc-on-surface-light);
    font-weight: 500;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 14px;
    color: var(--mdc-on-surface-light);
    font-size: 16px;
}

.search-box input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    background: var(--mdc-surface);
    transition: all 0.2s ease;
    outline: none;
    color: var(--mdc-on-surface);
}

.search-box input:focus {
    border-color: var(--mdc-primary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.search-box input:hover {
    border-color: var(--border-hover);
}

.filter-group {
    min-width: 160px;
}

.filter-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: var(--mdc-surface);
    transition: all 0.2s ease;
    outline: none;
    color: var(--mdc-on-surface);
    cursor: pointer;
}

.filter-group select:focus {
    border-color: var(--mdc-primary);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.filter-group select:hover {
    border-color: var(--border-hover);
}


/* Customer View Page Styles */
.customer-view-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--mdc-on-surface);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--mdc-primary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item.full-width {
    grid-column: 1 / -1;
}

.info-item label {
    font-size: 12px;
    font-weight: 600;
    color: var(--mdc-on-surface-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.info-value {
    font-size: 15px;
    color: var(--mdc-on-surface);
    font-weight: 500;
}

.info-value.price-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--mdc-primary);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.status-warning {
    background: #fff3e0;
    color: #f57c00;
}

.status-badge.status-pending {
    background: #f5f5f5;
    color: #757575;
}

.status-badge.status-info {
    background: #e3f2fd;
    color: #1976d2;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--mdc-background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.history-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    color: white;
}

.history-icon.taken {
    background: #ff9800;
}

.history-icon.given {
    background: #4caf50;
}

.history-content {
    flex: 1;
}

.history-action {
    font-weight: 600;
    color: var(--mdc-on-surface);
    margin-bottom: 4px;
}

.history-date {
    font-size: 13px;
    color: var(--mdc-on-surface-light);
    margin-bottom: 4px;
}

.history-remark {
    font-size: 13px;
    color: var(--mdc-on-surface);
    margin-top: 6px;
    font-style: italic;
}

.history-user {
    font-size: 12px;
    color: var(--mdc-on-surface-light);
    margin-top: 6px;
}

/* Enhanced Document Management */
.document-upload-section {
    background: var(--mdc-surface);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.document-upload-section.drag-over {
    border-color: var(--mdc-primary);
    background: rgba(25, 118, 210, 0.05);
}

.document-filter-section {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 20px;
    background: var(--mdc-background);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.file-upload-label:hover,
.file-upload-label.drag-over {
    background: rgba(25, 118, 210, 0.05);
    border-color: var(--mdc-primary);
    color: var(--mdc-primary);
}

.file-upload-label i {
    font-size: 32px;
    color: var(--mdc-primary);
}

.file-upload-label span {
    font-weight: 500;
    color: var(--mdc-on-surface);
}

.file-upload-label small {
    font-size: 12px;
    color: var(--mdc-on-surface-light);
}

#upload-progress {
    margin-top: 12px;
    padding: 12px;
    background: var(--mdc-background);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.upload-status {
    color: var(--mdc-on-surface);
    font-size: 14px;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.document-card {
    background: var(--mdc-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.document-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: var(--mdc-primary);
}

.document-preview {
    position: relative;
    width: 100%;
    height: 180px;
    background: var(--mdc-background);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

.document-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.document-icon-large {
    font-size: 48px;
    color: var(--mdc-primary);
}

.document-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.document-preview:hover .document-overlay {
    opacity: 1;
}

.document-overlay i {
    color: white;
    font-size: 24px;
}

.document-info {
    padding: 16px;
    flex: 1;
}

.document-name {
    font-weight: 500;
    color: var(--mdc-on-surface);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.document-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.document-category-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

.category-general { background: #e3f2fd; color: #1976d2; }
.category-passport { background: #fff3e0; color: #f57c00; }
.category-visa { background: #e8f5e9; color: #388e3c; }
.category-contract { background: #f3e5f5; color: #7b1fa2; }
.category-identity { background: #fce4ec; color: #c2185b; }
.category-financial { background: #e0f2f1; color: #00796b; }
.category-medical { background: #ffebee; color: #d32f2f; }
.category-other { background: #f5f5f5; color: #616161; }

.document-size {
    font-size: 11px;
    color: var(--mdc-on-surface-light);
}

.document-description {
    font-size: 12px;
    color: var(--mdc-on-surface-light);
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.document-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--mdc-on-surface-light);
}

.document-actions {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--mdc-background);
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--mdc-on-surface-light);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--mdc-background);
    color: var(--mdc-primary);
}

.btn-icon.btn-danger:hover {
    background: #ffebee;
    color: var(--mdc-error);
}

.no-documents {
    text-align: center;
    padding: 60px 20px;
    color: var(--mdc-on-surface-light);
}

.no-documents i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-documents p {
    font-size: 14px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    max-width: 500px;
    background: var(--mdc-surface);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    border-left: 4px solid;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toast i {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    font-size: 14px;
    line-height: 1.5;
    color: var(--mdc-on-surface);
}

.toast-close {
    background: none;
    border: none;
    color: var(--mdc-on-surface-light);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--mdc-on-surface);
}

.toast-close i {
    font-size: 14px;
}

/* Toast Types */
.toast-success {
    border-left-color: #4caf50;
    background: #ffffff;
}

.toast-success i {
    color: #4caf50;
}

.toast-error {
    border-left-color: #f44336;
    background: #ffffff;
}

.toast-error i {
    color: #f44336;
}

.toast-warning {
    border-left-color: #ff9800;
    background: #ffffff;
}

.toast-warning i {
    color: #ff9800;
}

.toast-info {
    border-left-color: #2196f3;
    background: #ffffff;
}

.toast-info i {
    color: #2196f3;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

.document-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--mdc-error);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Profit Margin Calculator */
.profit-calculator-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--shadow-sm);
}

.profit-calculator-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--mdc-on-surface);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.profit-calculator-title i {
    color: var(--mdc-primary);
}

.profit-calculator-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.profit-label {
    font-size: 14px;
    color: var(--mdc-on-surface-light);
    font-weight: 500;
}

.profit-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--mdc-on-surface);
}

.profit-highlight {
    background: rgba(25, 118, 210, 0.05);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 4px 0;
}

.profit-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.profit-amount.profit-positive,
.profit-percentage.profit-positive {
    color: #4caf50;
}

.profit-amount.profit-negative,
.profit-percentage.profit-negative {
    color: #f44336;
}

.profit-amount.profit-neutral,
.profit-percentage.profit-neutral {
    color: var(--mdc-on-surface-light);
}

.profit-percentage.profit-excellent {
    color: #4caf50;
    font-size: 18px;
}

.profit-percentage.profit-good {
    color: #8bc34a;
    font-size: 17px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .profit-calculator-card {
        padding: 16px;
    }
    
    .profit-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .profit-value {
        font-size: 14px;
    }
}
