:root {
    /* Paleta CMYK premium */
    --c-cyan: #13b6ec;
    --c-magenta: #e9257e;
    --c-yellow: #fced22;
    --c-black: #111111;

    /* Grises "Things 3" */
    --bg-main: #f8f9fa;
    --bg-sidebar: #f0f2f5;
    --bg-card: #ffffff;
    --text-primary: #1c1c1e;
    --text-secondary: #8e8e93;
    --border-color: #e5e5ea;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Estilo Mac/Things */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    z-index: 1002;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
}


.sidebar-header {
    margin-bottom: 32px;
    padding-left: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: conic-gradient(from 90deg, var(--c-cyan), var(--c-magenta), var(--c-yellow), var(--c-cyan));
    border-radius: 6px;
}

.logo h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.nav-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.nav-item.active {
    background-color: var(--c-cyan);
    color: white;
}

/* Contenido Principal */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 40px 60px;
    overflow-y: auto;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

#page-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.header-actions {
    display: flex;
    gap: 16px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    width: 250px;
    transition: all 0.2s;
}

.search-box input:focus {
    border-color: var(--c-cyan);
    box-shadow: 0 0 0 3px rgba(19, 182, 236, 0.15);
}

.search-icon {
    position: absolute;
    left: 14px;
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Botones */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--c-cyan);
    color: white;
    box-shadow: 0 2px 8px rgba(19, 182, 236, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(19, 182, 236, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-sidebar);
}

/* Tablas Premium */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.data-table th {
    text-align: left;
    padding: 16px 24px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    background-color: #fafafa;
}

.data-table td {
    padding: 18px 24px;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--bg-sidebar);
    color: var(--text-primary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr {
    transition: background 0.2s;
}

.data-table tr:hover {
    background-color: rgba(19, 182, 236, 0.02);
}

/* Acciones en tabla */
.action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    margin-right: 8px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.action-btn:hover {
    color: var(--text-primary);
}

.action-btn.del:hover {
    color: var(--c-magenta);
}

/* Tags de estado */
.tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.tag.premium {
    background-color: rgba(19, 182, 236, 0.1);
    color: var(--c-cyan);
}

.tag.basic {
    background-color: var(--bg-sidebar);
    color: var(--text-secondary);
}

/* Modal Overlay estilo Apple */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-card);
    width: 480px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Form inputs */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: #fafafa;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--c-cyan);
    box-shadow: 0 0 0 3px rgba(19, 182, 236, 0.15);
    outline: none;
    background: white;
}

.modal-footer {
    padding: 24px;
    background: #fafafa;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}