/* ==========================================
   RYUZENK MITIGATION - DASHBOARD STYLES
   ========================================== */

/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* VARIABLES CSS */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

/* BODY */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
}

/* ==========================================
   LAYOUT
   ========================================== */

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 30px;
    padding: 10px;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.nav-link:hover {
    background: var(--gray-100);
}

.nav-link.active {
    background: var(--primary);
    color: white;
}

.nav-link-icon {
    margin-right: 12px;
    font-size: 20px;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ==========================================
   HEADER
   ========================================== */

.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    font-size: 24px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

#connection-status {
    margin-right: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--success);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

/* ==========================================
   VIEW CONTROLS
   ========================================== */

.view-controls {
    padding: 20px 24px;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-tabs {
    display: flex;
    gap: 8px;
}

.view-tab {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.view-tab.active {
    background: var(--gray-900);
    color: white;
    border-color: var(--gray-900);
}

.search-input {
    padding: 8px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    width: 300px;
}

/* ==========================================
   CONTENT AREA
   ========================================== */

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ==========================================
   CARDS
   ========================================== */

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ==========================================
   TABLES
   ========================================== */

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--gray-50);
}

th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 16px;
    border-top: 1px solid var(--gray-200);
    font-size: 14px;
}

tbody tr {
    transition: background 0.2s;
}

tbody tr:hover {
    background: var(--gray-50);
}

/* ==========================================
   BADGES
   ========================================== */

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { 
    background: #d1fae5; 
    color: #065f46; 
}

.badge-warning { 
    background: #fef3c7; 
    color: #92400e; 
}

.badge-danger { 
    background: #fee2e2; 
    color: #991b1b; 
}

.badge-info { 
    background: #dbeafe; 
    color: #1e40af; 
}

.badge-secondary { 
    background: var(--gray-200); 
    color: var(--gray-700); 
}

/* ==========================================
   PRIORITY COLORS
   ========================================== */

.priority-baja { 
    color: var(--gray-600); 
}

.priority-media { 
    color: var(--warning); 
}

.priority-alta { 
    color: var(--danger); 
}

.priority-urgente { 
    color: var(--danger); 
    font-weight: 700; 
}

/* ==========================================
   LOADING
   ========================================== */

.loading {
    text-align: center;
    padding: 60px;
    color: var(--gray-600);
}

.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   MESSAGES
   ========================================== */

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* ==========================================
   FORMS
   ========================================== */

.config-section {
    max-width: 600px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.help-text {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 6px;
}

/* ==========================================
   KANBAN BOARD
   ========================================== */

.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    height: 100%;
}

.kanban-column {
    background: var(--gray-100);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.kanban-header {
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-count {
    background: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.kanban-cards {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kanban-card {
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.kanban-card-title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.kanban-card-meta {
    font-size: 12px;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}