* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #2c3e50;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-nav {
    padding: 10px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: #3498db;
    color: white;
}

.nav-icon {
    margin-right: 10px;
    font-size: 18px;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 0;
}

.content-header {
    background: white;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.content-header h1 {
    font-size: 24px;
    font-weight: 600;
    text-transform: capitalize;
}

.content-body {
    padding: 30px;
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 36px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
}

.stat-main {
    color: #2c3e50;
}

.stat-sub {
    font-size: 14px;
    color: #999;
    font-weight: normal;
}

.cron-status-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.cron-status-card h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.cron-info {
    display: grid;
    gap: 15px;
}

.cron-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cron-item:last-child {
    border-bottom: none;
}

.cron-label {
    font-weight: 600;
    width: 180px;
    color: #666;
}

.cron-value {
    flex: 1;
}

.cron-value.enabled {
    color: #27ae60;
}

.cron-value.disabled {
    color: #e74c3c;
}

.cron-result.success {
    color: #27ae60;
}

.cron-result.error {
    color: #e74c3c;
}

.quick-actions {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.quick-actions h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 18px;
}

/* Settings */
.settings-page {
    max-width: 800px;
}

.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.settings-form {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    margin-bottom: 20px;
    font-size: 18px;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Logs */
.logs-page {
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.logs-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: #f8f9fa;
}

.tab {
    padding: 15px 25px;
    text-decoration: none;
    color: #666;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab:hover {
    color: #3498db;
    background: #f0f0f0;
}

.tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background: white;
}

.logs-filters {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.filter-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

.filter-group input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.logs-table-container {
    overflow-x: auto;
}

.logs-table {
    width: 100%;
    border-collapse: collapse;
}

.logs-table thead {
    background: #f8f9fa;
}

.logs-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.logs-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.logs-table tbody tr:hover {
    background: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.status-spared {
    background: #d1ecf1;
    color: #0c5460;
}

.status-published {
    background: #d4edda;
    color: #155724;
}

.status-queue {
    background: #fff3cd;
    color: #856404;
}

.error-message {
    color: #e74c3c;
    font-weight: 600;
}

.text-center {
    text-align: center;
}

.logs-table pre {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    max-width: 400px;
    overflow-x: auto;
    margin: 0;
}

/* Materials */
.materials-page {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.materials-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.materials-header h2 {
    font-size: 20px;
}

.materials-info {
    color: #666;
    font-size: 14px;
}

.materials-filters {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.filter-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.materials-table-container {
    overflow-x: auto;
}

.materials-table {
    width: 100%;
    border-collapse: collapse;
}

.materials-table thead {
    background: #f8f9fa;
}

.materials-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    font-size: 13px;
}

.materials-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.materials-table tbody tr:hover {
    background: #f8f9fa;
}

.url-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.url-cell a {
    color: #3498db;
    text-decoration: none;
}

.url-cell a:hover {
    text-decoration: underline;
}

.btn-link {
    color: #3498db;
    text-decoration: none;
    margin-right: 10px;
    font-size: 13px;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-link.btn-danger {
    color: #e74c3c;
}

/* Source */
.source-page {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.source-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.source-header h2 {
    font-size: 20px;
}

.source-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.source-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 13px;
    color: #666;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.source-table {
    width: 100%;
    border-collapse: collapse;
}

.source-table thead {
    background: #f8f9fa;
}

.source-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

.source-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.source-table tbody tr:hover {
    background: #f8f9fa;
}

.source-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-publish {
    color: #27ae60;
}

.btn-publish:hover {
    color: #229954;
    text-decoration: underline;
}

.text-muted {
    color: #999;
    font-size: 13px;
}

/* Published Page */
.published-page {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.published-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.published-header h2 {
    font-size: 20px;
}

.published-info {
    color: #666;
    font-size: 14px;
}

.published-filters {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.published-table-container {
    overflow-x: auto;
}

.published-table {
    width: 100%;
    border-collapse: collapse;
}

.published-table thead {
    background: #f8f9fa;
}

.published-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    font-size: 13px;
}

.published-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.published-table tbody tr:hover {
    background: #f8f9fa;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
}

