/* 
 * Sistema de Tickets: Premium UI
 * Modern, clean, and dynamic design
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --std-bg: #f8fafc;
    --std-surface: #ffffff;
    --std-primary: #3b82f6;
    --std-primary-hover: #2563eb;
    --std-text-main: #0f172a;
    --std-text-muted: #64748b;
    --std-border: #e2e8f0;
    --std-radius-sm: 6px;
    --std-radius: 12px;
    --std-radius-lg: 16px;
    --std-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --std-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --std-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --std-transition: all 0.2s ease-in-out;
}

body.std-has-plugin-shortcode {
    background-color: var(--std-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--std-text-main);
    line-height: 1.6;
}

/* Remove default titles */
.std-has-plugin-shortcode .entry-title,
.std-has-plugin-shortcode .post-title,
.std-has-plugin-shortcode .page-title {
    display: none !important;
}

/* Template Wrappers */
.std-template {
    padding: 40px 0;
    font-family: 'Inter', sans-serif;
}

.std-template .wrap {
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

.std-template-shell {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
}

/* Sidebar */
.std-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--std-surface);
    border: 1px solid var(--std-border);
    border-radius: var(--std-radius);
    padding: 24px;
    box-sizing: border-box;
    box-shadow: var(--std-shadow-sm);
    position: sticky;
    top: 40px;
}

.std-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--std-border);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.std-sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--std-primary), #60a5fa);
    color: #fff;
    border-radius: var(--std-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.std-sidebar-brand-icon svg {
    width: 20px;
    height: 20px;
}

.std-sidebar-brand-text {
    line-height: 1.2;
}

.std-sidebar-brand-text strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--std-text-main);
}

.std-sidebar-brand-text span {
    font-size: 13px;
    color: var(--std-text-muted);
}

.std-sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.std-sidebar-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    text-decoration: none;
    color: var(--std-text-muted);
    border-radius: var(--std-radius-sm);
    transition: var(--std-transition);
}

.std-sidebar-link:hover, .std-sidebar-link.is-active {
    background: #eff6ff;
    color: var(--std-primary);
}

.std-sidebar-link.is-active {
    font-weight: 500;
}

.std-sidebar-icon {
    display: flex;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.std-sidebar-link:hover .std-sidebar-icon,
.std-sidebar-link.is-active .std-sidebar-icon {
    color: var(--std-primary);
}

.std-sidebar-desc {
    display: block;
    font-size: 12px;
    color: var(--std-text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

/* Main Area */
.std-main {
    flex: 1 1 0%;
    min-width: 0;
}

.std-main header {
    margin-bottom: 32px;
}

.std-main header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--std-text-main);
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.std-main header p.description {
    font-size: 16px;
    color: var(--std-text-muted);
    margin: 0;
    max-width: 600px;
}

/* Tables */
.std-table-wrapper {
    background: var(--std-surface);
    border: 1px solid var(--std-border);
    border-radius: var(--std-radius);
    box-shadow: var(--std-shadow-sm);
    overflow: hidden;
    margin-bottom: 24px;
}

.std-ticket-table, .std-panel-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.std-ticket-table th, .std-panel-table th {
    background: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--std-text-muted);
    padding: 16px;
    border-bottom: 1px solid var(--std-border);
    text-align: left;
}

.std-ticket-table td, .std-panel-table td {
    padding: 16px;
    border-bottom: 1px solid var(--std-border);
    vertical-align: middle;
    font-size: 14px;
}

.std-ticket-table tbody tr:last-child td,
.std-panel-table tbody tr:last-child td {
    border-bottom: none;
}

.std-ticket-table tbody tr, .std-panel-table tbody tr {
    transition: var(--std-transition);
}

.std-ticket-table tbody tr:hover, .std-panel-table tbody tr:hover {
    background: #f1f5f9;
}

/* Status Badges */
.std-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9999px;
    white-space: nowrap;
}

.std-badge--pendiente { background: #fef3c7; color: #d97706; }
.std-badge--en-proceso, .std-badge--en-desarrollo { background: #dbeafe; color: #2563eb; }
.std-badge--finalizado { background: #dcfce3; color: #16a34a; }
.std-badge--cerrado { background: #fee2e2; color: #dc2626; }
.std-badge--default { background: #f1f5f9; color: #64748b; }

/* Buttons */
.std-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--std-radius-sm);
    transition: var(--std-transition);
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
}

.std-btn-primary {
    background: var(--std-primary);
    color: #fff;
    box-shadow: var(--std-shadow-sm);
}

.std-btn-primary:hover {
    background: var(--std-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--std-shadow);
    color: #fff;
}

.std-btn-secondary {
    background: #fff;
    color: var(--std-text-main);
    border-color: var(--std-border);
    box-shadow: var(--std-shadow-sm);
}

.std-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--std-text-main);
}

/* Forms & Inputs */
.std-form-card {
    background: var(--std-surface);
    border: 1px solid var(--std-border);
    border-radius: var(--std-radius);
    padding: 32px;
    box-shadow: var(--std-shadow-sm);
    margin-bottom: 24px;
}

.std-form-group {
    margin-bottom: 24px;
}

.std-form-row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.std-form-row > div {
    flex: 1;
}

.std-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--std-text-main);
    margin-bottom: 8px;
}

.std-form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--std-text-main);
    background-color: #fff;
    border: 1px solid var(--std-border);
    border-radius: var(--std-radius-sm);
    transition: var(--std-transition);
    box-sizing: border-box;
    font-family: inherit;
}

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

.std-form-hint {
    font-size: 12px;
    color: var(--std-text-muted);
    margin-top: 6px;
    margin-bottom: 0;
}

/* Ticket detail Views */
.std-ticket-meta {
    background: var(--std-surface);
    border: 1px solid var(--std-border);
    border-left: 4px solid var(--std-primary);
    border-radius: var(--std-radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--std-shadow-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
}

.std-ticket-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.std-ticket-meta-label {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--std-text-muted);
    letter-spacing: 0.05em;
}

.std-ticket-meta-val {
    font-size: 15px;
    color: var(--std-text-main);
    font-weight: 500;
}

.std-content-box {
    background: var(--std-surface);
    border: 1px solid var(--std-border);
    border-radius: var(--std-radius);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--std-shadow-sm);
}

.std-content-box h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
}

/* Comments */
.std-comments-area {
    margin-top: 40px;
}

.std-comment {
    background: var(--std-surface);
    border: 1px solid var(--std-border);
    border-radius: var(--std-radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--std-shadow-sm);
}

.std-comment--private {
    background: #fffbeb;
    border-color: #fde68a;
}

.std-comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--std-border);
}

.std-comment--private .std-comment-header {
    border-color: #fde68a;
}

.std-comment-author {
    font-weight: 600;
    color: var(--std-text-main);
    font-size: 15px;
}

.std-comment-date {
    font-size: 13px;
    color: var(--std-text-muted);
}

.std-comment-badge-private {
    background: #f59e0b;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 12px;
}

.std-comment-body {
    font-size: 15px;
    line-height: 1.6;
    color: var(--std-text-main);
}

.std-comment-body p:last-child {
    margin-bottom: 0;
}

/* Panels/Grids */
.std-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.std-stat-card {
    background: var(--std-surface);
    border: 1px solid var(--std-border);
    border-radius: var(--std-radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--std-shadow-sm);
    transition: var(--std-transition);
}

.std-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--std-shadow);
}

.std-stat-val {
    font-size: 36px;
    font-weight: 700;
    color: var(--std-text-main);
    margin-top: 16px;
    line-height: 1;
}

.std-stat-label {
    font-size: 14px;
    color: var(--std-text-muted);
    font-weight: 500;
    margin-top: 8px;
}

/* Filters */
.std-filters-bar {
    background: var(--std-surface);
    border: 1px solid var(--std-border);
    border-radius: var(--std-radius);
    padding: 16px 24px;
    margin-bottom: 24px;
    box-shadow: var(--std-shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
}

.std-filters-bar form {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
}

/* Ticket Cards (Grid View) */
.std-ticket-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.std-ticket-card {
    background: var(--std-surface);
    border: 1px solid var(--std-border);
    border-radius: var(--std-radius);
    padding: 24px;
    box-shadow: var(--std-shadow-sm);
    transition: var(--std-transition);
    display: flex;
    flex-direction: column;
}

.std-ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--std-shadow);
}

.std-ticket-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.std-ticket-card__header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.std-ticket-card p {
    font-size: 14px;
    color: var(--std-text-muted);
    margin: 0 0 20px;
    line-height: 1.5;
    flex-grow: 1;
}

.std-ticket-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--std-border);
    padding-top: 16px;
}

.std-ticket-card__meta span {
    font-size: 13px;
    color: var(--std-text-muted);
    font-weight: 500;
}

/* Alerts */
.std-alert {
    padding: 16px 20px;
    border-radius: var(--std-radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
}

.std-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.std-alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.std-alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Checkbox container */
.std-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--std-text-main);
    cursor: pointer;
}

.std-checkbox-label.warning {
    background: #fffbeb;
    color: #92400e;
    padding: 8px 12px;
    border-radius: var(--std-radius-sm);
    border: 1px solid #fde68a;
}

/* Kanban Board */
.std-kanban-board {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 24px;
    margin-bottom: 32px;
}

.std-kanban-column {
    flex: 0 0 320px;
    background: #f1f5f9;
    border-radius: var(--std-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.std-kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.std-kanban-column-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.std-kanban-count {
    background: #e2e8f0;
    color: var(--std-text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
}

.std-kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.std-kanban-card {
    background: var(--std-surface);
    border: 1px solid var(--std-border);
    border-radius: var(--std-radius-sm);
    padding: 16px;
    box-shadow: var(--std-shadow-sm);
    transition: var(--std-transition);
}

.std-kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--std-shadow);
}

.std-kanban-card h4 {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.4;
}

.std-kanban-card h4 a {
    color: var(--std-text-main);
    text-decoration: none;
}

.std-kanban-card h4 a:hover {
    color: var(--std-primary);
}

.std-kanban-card--condensed {
    padding: 12px;
}

.std-kanban-card--condensed h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

.std-ticket-card__meta-condensed {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    border-top: 1px dashed var(--std-border);
    padding-top: 8px;
}

.std-btn-archivar {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid var(--std-border);
    border-radius: var(--std-radius-sm);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    transition: var(--std-transition);
}

.std-btn-archivar:hover {
    background: #e2e8f0;
    color: var(--std-text-main);
    border-color: #cbd5e1;
}

.std-kanban-empty {
    text-align: center;
    padding: 24px 0;
    color: var(--std-text-muted);
    font-size: 14px;
    background: rgba(255,255,255,0.5);
    border: 1px dashed var(--std-border);
    border-radius: var(--std-radius-sm);
}

@media (max-width: 768px) {
    .std-template-shell {
        flex-direction: column;
    }
    .std-sidebar {
        width: 100%;
        position: static;
    }
    .std-form-row {
        flex-direction: column;
        gap: 16px;
    }
    .std-ticket-meta {
        flex-direction: column;
        gap: 16px;
    }
}
