/* App Categorization Server v2.0 Styles */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    background-color: #f8f9fa;
}

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

.card {
    background: white;
    padding: 24px;
    margin: 16px 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header {
    text-align: center;
    color: #333;
    margin-bottom: 8px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 24px;
}
.subtle-note {
    color: #6c757d;
    font-size: 0.95em;
    margin: 0 0 12px 0;
}

/* User Bar */
.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.user-info {
    color: #555;
    font-size: 0.95em;
}
.user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logout-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}
.logout-link:hover {
    text-decoration: underline;
}
.admin-btn {
    padding: 8px 14px;
    margin: 0;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    background: #e9ecef;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #007bff;
    color: white;
}

.tab-btn:not(.active) {
    color: #6c757d;
}

.tab-btn:hover:not(.active) {
    background: #dee2e6;
}

/* Date Filter */
.date-filter {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.date-preset {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.date-preset:hover, .date-preset.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.date-input {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 12px;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 4px;
}

.stat-label {
    opacity: 0.9;
}

/* Content Areas */
.tab-content {
    display: none;
}

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

/* Pending Items */
.pending-item {
    border-left: 4px solid #007bff;
    margin: 12px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
}

.auto-approved-item {
    border-left: 4px solid #28a745;
    margin: 12px 0;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
}

/* App rows (icon + title) */
.app-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.app-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}
.app-title {
    margin: 0;
    font-size: 1.2em;
}


/* Buttons */
.btn {
    padding: 10px 20px;
    margin: 6px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

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

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

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

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

/* Form Elements */
select, input {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin: 4px;
}

/* Login */
.login-card {
    max-width: 420px;
    margin: 60px auto;
}
.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.login-form label {
    font-weight: 600;
    color: #333;
}
.login-form input {
    width: 100%;
}
.login-btn {
    margin-top: 10px;
}
.error-text {
    color: #dc3545;
    margin-bottom: 12px;
    text-align: center;
}
.success-text {
    color: #28a745;
    margin-bottom: 12px;
    text-align: center;
}

/* Category selection cards */
.category-card {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    background: #ffffff;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease-in-out;
}
.category-card:hover {
    background: #f1f3f5;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    .date-filter {
        flex-direction: column;
        align-items: stretch;
    }
    .stats {
        grid-template-columns: 1fr;
    }
}
