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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000;
    position: absolute;
    right: 20px;
    top: 20px;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

header {
    background-color: #2c3e50;
    color: #fff;
    padding: 1rem 0;
    margin-bottom: 2rem;
    position: relative;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    position: relative;
}

.header-branding {
    flex: 1;
}

.user-info {
    font-size: 0.9rem;
    color: #ecf0f1;
    margin: 0;
    font-weight: 300;
}

.user-role {
    color: #3498db;
    font-weight: 500;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.header-actions .btn {
    position: relative;
    white-space: nowrap;
}

nav {
    margin-top: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin-right: 0;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 0.95rem;
    border-bottom: 3px solid transparent;
}

nav a:hover {
    background-color: #34495e;
}

nav a.active {
    background-color: #34495e;
    border-bottom-color: #3498db;
    font-weight: 600;
}

.content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

/* Breadcrumbs */
.breadcrumb {
    background-color: #ecf0f1;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #7f8c8d;
    margin: 0 0.5rem;
}

.breadcrumb .current {
    color: #2c3e50;
    font-weight: 600;
}

h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
}

h3 {
    color: #34495e;
    margin: 1.5rem 0 0.5rem 0;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.notification-badge {
    background-color: #e74c3c;
    color: #fff;
    border-radius: 10px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 0.3rem;
    display: inline-block;
    min-width: 20px;
    text-align: center;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

/* Auto-wrap tables on mobile */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
}

table th,
table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #34495e;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

table tr:hover {
    background-color: #f8f9fa;
}

/* Mobile-friendly table on small screens */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    table thead {
        display: table-header-group;
    }
    
    table tbody {
        display: table-row-group;
    }
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 4px;
    color: #fff;
}

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

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

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-info {
    background-color: #17a2b8;
}

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

.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

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

.stats-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.stats-box h3 {
    color: #fff;
    font-size: 2.5rem;
    margin: 0.5rem 0;
}

.stats-box p {
    font-size: 1rem;
    opacity: 0.9;
}

.login-container {
    max-width: 400px;
    margin: 5rem auto;
}

.img-thumbnail {
    max-width: 200px;
    max-height: 200px;
    border-radius: 4px;
    margin: 0.5rem;
}

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

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer {
    text-align: center;
    padding: 1rem;
    color: #777;
    margin-top: 2rem;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* Prevent zoom on input focus */
    }
    
    .container {
        padding: 0 15px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    header {
        padding-bottom: 0;
    }
    
    header h1 {
        font-size: 1.5rem;
        padding-right: 50px; /* Space for hamburger */
    }
    
    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 0;
    }
    
    .header-branding {
        width: 100%;
    }
    
    .user-info {
        font-size: 0.85rem;
    }
    
    .header-actions {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 280px;
        max-width: 85%;
        background-color: #34495e;
        flex-direction: column;
        padding: 1rem;
        box-shadow: -2px 0 10px rgba(0,0,0,0.3);
        transition: right 0.3s ease;
        z-index: 999;
        height: calc(100vh - 70px);
        overflow-y: auto;
        align-items: stretch;
    }
    
    .header-actions.mobile-open {
        right: 0;
    }
    
    .header-actions .btn {
        width: 100%;
        text-align: left;
        justify-content: flex-start;
        margin: 0;
    }
    
    .header-actions .btn-text {
        display: inline;
    }
    
    nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 280px;
        max-width: 85%;
        background-color: #2c3e50;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 1rem;
        border-top: none;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
        transition: left 0.3s ease;
        z-index: 999;
        height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    nav.mobile-open {
        left: 0;
    }
    
    nav a {
        text-align: left;
        padding: 0.75rem 1rem;
        margin: 0;
        border-radius: 4px;
        border-bottom: none;
        border-left: 3px solid transparent;
        width: 100%;
    }
    
    nav a.active {
        border-bottom: none;
        border-left-color: #3498db;
    }
    
    /* Content adjustments */
    .content {
        padding: 1.25rem;
    }
    
    /* Tables - horizontal scroll */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 0.9rem;
        min-width: 600px; /* Force horizontal scroll for wide tables */
    }
    
    table th,
    table td {
        padding: 0.6rem 0.4rem;
        white-space: nowrap;
    }
    
    /* Grids - stack on mobile */
    .grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Buttons - touch friendly */
    .btn {
        padding: 0.65rem 1.1rem;
        font-size: 1rem;
        min-height: 44px; /* Apple touch target recommendation */
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .btn-sm {
        padding: 0.5rem 0.9rem;
        min-height: 40px;
    }
    
    /* Stats boxes */
    .stats-box h3 {
        font-size: 2.2rem;
    }
    
    .stats-box p {
        font-size: 0.95rem;
    }
    
    /* Forms - better mobile */
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 0.75rem;
        min-height: 44px;
    }
    
    select.form-control {
        min-height: 44px;
    }
    
    /* Flex utilities */
    .flex,
    .flex-between {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    /* Tab navigation */
    .tab-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }
    
    .tab-nav a {
        flex-shrink: 0;
        padding: 0.65rem 1rem;
    }
    
    /* Cards */
    .card {
        padding: 1.25rem;
    }
    
    /* Alerts */
    .alert {
        padding: 0.9rem;
        font-size: 0.95rem;
    }
    
    /* Badges */
    .notification-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.45rem;
    }
    
    /* Breadcrumbs */
    .breadcrumb {
        font-size: 0.85rem;
        padding: 0.6rem 0.85rem;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Center text on mobile */
    .mobile-center {
        text-align: center;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.3rem;
    }
    
    .user-info {
        font-size: 0.8rem;
    }
    
    nav {
        width: 90%;
    }
    
    .header-actions {
        width: 90%;
    }
    
    .content {
        padding: 1rem;
        border-radius: 4px;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
    }
    
    .btn-sm {
        padding: 0.45rem 0.8rem;
        font-size: 0.85rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    .stats-box h3 {
        font-size: 1.8rem;
    }
    
    .card {
        padding: 1rem;
    }
}

/* Landscape mobile fixes */
@media (max-width: 768px) and (orientation: landscape) {
    nav,
    .header-actions {
        height: 100vh;
        top: 0;
        padding-top: 80px;
    }
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #ecf0f1;
    flex-wrap: wrap;
}

.tab-nav a {
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: #7f8c8d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-weight: 500;
}

.tab-nav a:hover {
    color: #2c3e50;
    background-color: #ecf0f1;
}

.tab-nav a.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Status Badges Enhanced */
.status-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

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

.status-badge.status-action-needed {
    background-color: #f8d7da;
    color: #721c24;
}

.status-badge.status-in-progress {
    background-color: #d1ecf1;
    color: #0c5460;
}

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

/* Help Text */
.help-text {
    background-color: #e8f4f8;
    border-left: 4px solid #3498db;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.help-text h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.help-text p {
    margin: 0;
    color: #555;
    font-size: 0.95rem;
}

