* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Container */
.container {
    background: white;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    position: relative;
}

.container-wide { max-width: 100%; }
.container-narrow { max-width: 800px; }

/* Special container for index.php which needs flex */
.container.flex-container {
    display: flex;
    overflow: hidden;
    padding: 0;
}

/* Navigation */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.logo { font-size: 20px; font-weight: bold; color: #667eea; }

.nav-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.btn-secondary { background: #6c757d; color: white; }
.btn-danger { background: #dc3545; color: white; }
.btn-warning { background: #ffc107; color: #333; }
.btn-small { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }

/* Forms */
.form-group { margin-bottom: 12px; }
label { display: block; margin-bottom: 3px; color: #555; font-weight: 500; font-size: 14px; }
input, select, textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #667eea; }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}
.data-table th, .data-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}
.data-table th { background: #667eea; color: white; }
.data-table tr:hover { background: #f8f9fa; }

/* Status Badges */
.status-badge { padding: 5px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.status-pending { background: #fff3cd; color: #856404; }
.status-assigned { background: #cce5ff; color: #004085; }
.status-completed { background: #d4edda; color: #155724; }
.status-reassign { background: #fff3cd; color: #856404; }

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: white;
    border-radius: 15px;
    padding: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 15px; border-bottom: 2px solid #eee; padding-bottom: 10px;
}
.close-modal { background: none; border: none; font-size: 28px; cursor: pointer; color: #666; }

/* Loader */
.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px; height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Index/Auth Specifics */
.auth-section { padding: 25px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.content-section { padding: 20px; flex: 2; background: #f8f9fa; display: none; flex-direction: column; }
.content-section.active { display: flex; }
.welcome-screen { text-align: center; padding: 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.switch-form { text-align: center; margin-top: 15px; color: #666; font-size: 13px; }
.switch-form a { color: #667eea; text-decoration: none; font-weight: 500; cursor: pointer; }
.error-message { background: #fee; color: #d33; padding: 8px; border-radius: 5px; margin-bottom: 15px; display: none; font-size: 13px; }
.success-message { background: #e8f7ee; color: #28a745; padding: 8px; border-radius: 5px; margin-bottom: 15px; display: none; font-size: 13px; }
.message { padding: 15px; border-radius: 8px; margin-bottom: 20px; display: none; }
.error { background: #fee; color: #d33; border: 1px solid #fcc; }
.success { background: #e8f7ee; color: #28a745; border: 1px solid #c3e6cb; }

/* Dashboard */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; margin-top: 15px; }
.dashboard-card { background: white; padding: 15px; border-radius: 10px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); text-align: center; }
.dashboard-card .count { font-size: 28px; font-weight: bold; color: #333; margin: 5px 0; }
.dashboard-card .description { color: #666; font-size: 12px; }

/* Tabs */
.tabs, .content-tabs { display: flex; gap: 10px; margin-bottom: 15px; border-bottom: 1px solid #ddd; padding-bottom: 10px; }
.tab { padding: 8px 15px; cursor: pointer; border-radius: 5px; font-weight: 500; color: #666; font-size: 14px; transition: all 0.3s; }
.tab:hover { background: #f0f0f0; }
.tab.active { background: #667eea; color: white; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Filters */
.filters { display: flex; gap: 15px; margin-bottom: 15px; background: #f8f9fa; padding: 10px; border-radius: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 5px; }
/* Override global width: 100% for filter inputs to allow them to sit on one line */
.filters select, .filters input, .action-buttons select, .action-buttons input {
    width: auto;
    min-width: 150px;
}

/* History */
.history-item { background: #f8f9fa; border-radius: 10px; padding: 10px; margin-bottom: 10px; border-left: 4px solid #667eea; }
.history-item.completed { border-left-color: #28a745; }
.history-item.reassigned { border-left-color: #ffc107; }
.history-item.pending { border-left-color: #dc3545; }
.history-item.stolen { border-left-color: #dc3545; }
.history-notes { margin-top: 8px; font-style: italic; color: #555; }
.history-date { font-size: 12px; color: #888; margin-top: 5px; }

/* Stats */
.stat-number { font-weight: bold; font-size: 16px; }
.stat-total { color: #667eea; }
.stat-active { color: #e67e22; }
.stat-closed { color: #27ae60; }

/* Screenshots */
.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}
.screenshot-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}
.screenshot-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.screenshot-img {
    width: 100%; height: 140px; object-fit: cover; cursor: pointer; border-bottom: 1px solid #eee; background: #f8f9fa;
}
.screenshot-info { padding: 10px; font-size: 12px; color: #555; }

/* Utilities */
.action-buttons { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }
.action-buttons-small { display: flex; gap: 5px; margin-top: 5px; }
.user-info { background: white; padding: 15px; border-radius: 10px; margin-bottom: 20px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); }

@media (max-width: 768px) {
    .container.flex-container { flex-direction: column; max-width: 500px; }
    .content-section { min-height: 400px; }
    .nav-bar { flex-direction: column; gap: 15px; }
    .content-tabs { overflow-x: auto; flex-wrap: nowrap; }
}