/* Admin Dashboard Styles */

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --sidebar-width: 220px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--gray-800);
    color: white;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--gray-700);
    margin-bottom: 20px;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.nav-menu {
    list-style: none;
}

.nav-menu li a {
    display: block;
    padding: 12px 20px;
    color: var(--gray-300);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-menu li a:hover {
    background: var(--gray-700);
    color: white;
}

.nav-menu li.active a {
    background: var(--primary);
    color: white;
}

.nav-divider {
    border-top: 1px solid var(--gray-700);
    margin: 20px 0;
}

/* Main Content */
.content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.page-header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid var(--gray-200);
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.page-content {
    padding: 30px;
}

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

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    color: var(--gray-500);
    font-size: 14px;
    margin-top: 4px;
}

/* Panels */
.panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.panel-section {
    padding: 20px;
    border-top: 1px solid var(--gray-200);
}

.panel-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--gray-600);
}

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

.data-table th,
.data-table td {
    padding: 12px 20px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--gray-500);
    background: var(--gray-50);
}

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

.info-table {
    width: 100%;
}

.info-table th,
.info-table td {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

.info-table th {
    font-weight: 500;
    color: var(--gray-500);
    width: 120px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn:hover {
    background: var(--gray-300);
}

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

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

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

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.badge-muted {
    background: var(--gray-200);
    color: var(--gray-500);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input:disabled {
    background: var(--gray-100);
    color: var(--gray-500);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input {
    width: auto;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

/* Grid layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 1024px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Scripts page */
.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    padding: 20px;
}

.script-card {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 20px;
}

.script-card h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.script-file {
    font-family: monospace;
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.script-form .form-group {
    margin-bottom: 12px;
}

.script-output {
    margin-top: 16px;
    background: var(--gray-800);
    border-radius: 6px;
    overflow: hidden;
}

.output-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--gray-700);
    color: white;
    font-size: 13px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-400);
}

.status-indicator.running {
    background: var(--warning);
    animation: pulse 1s infinite;
}

.status-indicator.success {
    background: var(--success);
}

.status-indicator.error {
    background: var(--error);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.output-log {
    padding: 12px;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
    color: #a5f3b4;
    background: var(--gray-800);
    white-space: pre-wrap;
}

/* Logs */
.log-list {
    list-style: none;
    padding: 20px;
}

.log-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

.log-list li:last-child {
    border-bottom: none;
}

.log-content {
    max-height: 600px;
    overflow-y: auto;
    padding: 16px;
    margin: 0;
    background: var(--gray-800);
    color: #a5f3b4;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
    border-radius: 0 0 8px 8px;
}

.code-block {
    background: var(--gray-50);
    padding: 16px;
    margin: 0;
    font-family: monospace;
    font-size: 12px;
    overflow-x: auto;
}

/* Action buttons */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px;
}

/* Utilities */
.text-muted {
    color: var(--gray-500);
}

.text-error {
    color: var(--error);
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--gray-800);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
}

.login-box .btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
}

/* Preview images */
.preview-img {
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 4px;
    background: white;
}
