/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* CSS Variables for Consistent Theming */
:root {
    /* Primary Colors */
    --primary-color: #2c3e50;
    --primary-light: #34495e;
    --primary-dark: #1a252f;
    
    /* Secondary Colors */
    --secondary-color: #3498db;
    --secondary-light: #5dade2;
    --secondary-dark: #2980b9;
    
    /* Accent Colors */
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    
    /* Neutral Colors */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --gray: #6c757d;
    --dark-gray: #495057;
    --black: #212529;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;
    
    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Mobile Navigation */
.mobile-nav-toggle {
    display: none !important;
    background: var(--primary-color);
    border: 1px solid var(--primary-light);
    border-radius: var(--border-radius-sm);
    font-size: 1.2rem;
    color: var(--white);
    cursor: pointer;
    padding: var(--spacing-sm) var(--spacing-md);
    transition: all var(--transition-fast);
}

.mobile-nav-toggle:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

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

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--primary-color);
    z-index: 999;
    transition: left var(--transition-normal);
    overflow-y: auto;
}

.mobile-nav.open {
    left: 0;
}

.mobile-nav-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--primary-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--white);
}

.mobile-nav-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav-menu {
    list-style: none;
    padding: var(--spacing-md);
}

.mobile-nav-menu li {
    margin-bottom: var(--spacing-sm);
}

.mobile-nav-menu a {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    transition: background-color var(--transition-fast);
}

.mobile-nav-menu a:hover,
.mobile-nav-menu a.active {
    background: var(--primary-light);
}

.mobile-nav-menu .icon {
    margin-right: var(--spacing-md);
    width: 20px;
    text-align: center;
}

/* Original Layout Structure */
.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--primary-color);
    color: var(--white);
    transition: transform var(--transition-normal);
    z-index: 100;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-area {
    flex: 1;
    padding: var(--spacing-xl);
    background: var(--light-gray);
}

/* Responsive Tables */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    background: var(--white);
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.table th,
.table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.table th {
    background: var(--light-gray);
    font-weight: 600;
    color: var(--dark-gray);
    position: sticky;
    top: 0;
    z-index: 10;
}

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

/* COMPLETE BUTTON SYSTEM OVERHAUL */
.btn {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    box-sizing: border-box;
}

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

/* UNIFIED BUTTON SIZES */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 30px;
}

.btn {
    padding: 10px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 12px 20px;
    font-size: 16px;
    min-height: 42px;
}

/* FORCE CONSISTENT BUTTON STYLING */
a.btn, button.btn, input.btn, .btn {
    display: inline-block !important;
    text-align: center !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
}

/* Remove any conflicting styles */
button, input[type="button"], input[type="submit"] {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* FORM BUTTON LAYOUT - CONSISTENT SPACING */
.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.form-actions .btn {
    margin: 0;
}

/* CARD FOOTER BUTTONS */
.card-footer .btn {
    margin-right: 8px;
}

.card-footer .btn:last-child {
    margin-right: 0;
}

/* Button Colors */
.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

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

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

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

.btn-secondary {
    background: var(--gray);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--dark-gray);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-success:hover {
    background: #229954;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

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

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

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

.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
}

/* Form Elements */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--dark-gray);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid #ced4da;
    border-radius: var(--border-radius-md);
    font-size: 0.875rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: var(--spacing-lg);
    background: var(--light-gray);
    border-bottom: 1px solid #e9ecef;
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-lg);
    background: var(--light-gray);
    border-top: 1px solid #e9ecef;
}

/* Responsive Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -var(--spacing-md);
}

.col {
    flex: 1;
    padding: 0 var(--spacing-md);
}

.col-1 { flex: 0 0 8.333333%; }
.col-2 { flex: 0 0 16.666667%; }
.col-3 { flex: 0 0 25%; }
.col-4 { flex: 0 0 33.333333%; }
.col-6 { flex: 0 0 50%; }
.col-8 { flex: 0 0 66.666667%; }
.col-9 { flex: 0 0 75%; }
.col-12 { flex: 0 0 100%; }

/* Header Layout */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: var(--white);
    border-bottom: 1px solid #e9ecef;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-gray);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 500;
    color: var(--dark-gray);
    font-size: 0.875rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray);
}

.logout-btn {
    color: var(--gray);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.logout-btn:hover {
    color: var(--danger-color);
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    flex-wrap: wrap;
}

/* CLEAN TABLE HEADER LAYOUT */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--white);
    border-bottom: 1px solid #e9ecef;
    border-radius: 8px 8px 0 0;
}

.table-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-gray);
}

/* IMPROVED SEARCH BAR LAYOUT */
.search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.search-bar .search-input,
.search-bar select {
    min-width: 200px;
}

/* CLEAN CARD LAYOUT */
.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 20px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

/* Search Input */
.search-input {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid #ced4da;
    border-radius: var(--border-radius-md);
    font-size: 0.875rem;
    transition: border-color var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Table Actions - FIXED LAYOUT */
.table-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.table-actions .btn {
    margin: 0;
    flex-shrink: 0;
}

/* Ensure table action buttons are consistent */
.table-actions .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
    min-height: 26px;
    border-radius: 3px;
}

/* Alert Messages */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--spacing-lg);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block !important;
    }
    
    .sidebar {
        display: none;
    }
    
    .mobile-nav-overlay.show {
        display: block;
    }
    
    .mobile-nav.show {
        display: flex;
        flex-direction: column;
    }

    .mobile-nav .admin-tools {
        margin-top: auto;
    }
    
    .header {
        padding: 12px 16px;
    }
    
    .header-left h1 {
        font-size: 1.25rem;
    }

    .header-right {
        display: none;
    }
    
    .user-profile {
        gap: 8px;
    }
    
    .user-details {
        display: none;
    }
    
    .content-area {
        padding: 16px;
        overflow-x: hidden;
    }
    
    .table-container {
        font-size: 0.875rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .btn-lg {
        padding: 10px 16px;
        font-size: 14px;
        min-height: 38px;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .search-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .search-bar .search-input,
    .search-bar select {
        width: 100%;
        max-width: 100%;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .table-header h2 {
        margin-bottom: 0;
    }
    
    .row {
        margin: 0;
    }
    
    .col {
        flex: 0 0 100%;
        padding: 0;
        margin-bottom: 16px;
    }
    
    /* Prevent horizontal scrolling */
    body {
        overflow-x: hidden;
    }
    
    .container {
        overflow-x: hidden;
    }
    
    .main-content {
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    .content-area {
        padding: var(--spacing-sm);
    }
    
    .table-container {
        font-size: 0.75rem;
    }
    
    .btn {
        font-size: 0.75rem;
        min-width: 50px;
        padding: var(--spacing-xs);
    }
}

.portal-page {
    background: white;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.portal-container {
    width: 100%;
    max-width: 400px;
}

.portal-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xxl);
    box-shadow: var(--shadow-lg);
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #fcc;
}

.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: #333;
    color: white;
}

.btn-primary:hover {
    background: #555;
    transform: translateY(-1px);
}

.login-footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
}

.login-footer p {
    margin-bottom: 4px;
}

/* Main Application Layout */
.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    font-size: 20px;
    font-weight: bold;
    border-bottom: 1px solid #34495e;
}

.sidebar .logo-icon {
    font-size: 24px;
}

.nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #34495e;
    color: white;
}

.nav-item.active {
    background: #34495e;
    color: white;
    border-left-color: #3498db;
}

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

.user-profile {
    padding: 20px;
    border-top: 1px solid #34495e;
    font-size: 14px;
    color: #bdc3c7;
}

.user-profile a,
.user-profile span {
    text-decoration: none;
    color: #bdc3c7;
}

.user-profile a:hover,
.user-profile span:hover {
    color: #fff;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    background: white;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    background: white;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: #666;
}

.logout-btn {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #f8f9fa;
    color: #333;
}

/* Dashboard Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    padding: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-content h3 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.stat-content p {
    color: #666;
    font-size: 14px;
}

.dashboard-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 0 30px 30px;
}

.analytics-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
    gap: 20px;
    padding: 0 30px 30px;
}

.section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

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

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.item-info h4 {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.item-info p {
    font-size: 12px;
    color: #666;
}

.item-date {
    font-size: 12px;
    color: #999;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.table-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.search-bar {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 250px;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

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

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

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

.table th,
.table td {
    padding: 12px 24px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.table td {
    font-size: 14px;
    color: #666;
}

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

.table-actions {
    display: flex;
    gap: 8px;
}

/* Form Styles */
.form-container {
    background: white;
    border-radius: 8px;
    padding: 30px;
    margin: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-container h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
}

/* File Upload Styles */
.file-upload {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.file-upload:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.file-upload.dragover {
    border-color: #667eea;
    background: #f0f4ff;
}

.file-upload-icon {
    font-size: 48px;
    color: #999;
    margin-bottom: 16px;
}

.file-upload-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
}

.file-upload-subtext {
    font-size: 14px;
    color: #999;
}

.file-input {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .dashboard-sections {
        grid-template-columns: 1fr;
        padding: 0 20px 20px;
    }
    
    .table-container,
    .form-container {
        margin: 20px;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        width: 100%;
    }
}

/* Additional Component Styles */
.document-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-icon {
    font-size: 24px;
    width: 32px;
    text-align: center;
}

.file-type-badge {
    background: #e9ecef;
    color: #495057;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.view-count {
    background: #f8f9fa;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.selected-files {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.selected-files h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}

.selected-files ul {
    margin: 0;
    padding-left: 20px;
}

.selected-files li {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-top: 1px solid #eee;
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #666; }
.text-success { color: #28a745; }
.text-danger { color: #dc3545; }
.text-warning { color: #ffc107; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* Qixor Footer */
.qixor-footer {
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: #666;
}

.qixor-footer a {
    color: var(--primary-color);
}

.portal-footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    color: #666;
    font-size: 14px;
}