/* Asana Marketing Aesthetic - Core Stylesheet */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: rgba(79, 70, 229, 0.08);
    --secondary: #1e1f21;
    --background: #ffffff;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #edeceb; /* Asana border light gray */
    --success: #0f865f; /* Asana green */
    --warning: #e28400; /* Asana orange */
    --danger: #ca3d3d; /* Asana red */
    --info: #0284c7;

    /* Priority Badge Colors (Pastel) */
    --badge-high-bg: #ffebeb;
    --badge-high-text: #ca3d3d;
    --badge-medium-bg: #fff6e0;
    --badge-medium-text: #b45309;
    --badge-low-bg: #edf5ff;
    --badge-low-text: #1d4ed8;

    /* Status Colors */
    --status-rev-bg: #f5f4f3;
    --status-rev-text: #57585a;
    --status-aprob-bg: #e6f6f0;
    --status-aprob-text: #0f865f;
    --status-prod-bg: #f6f0ff;
    --status-prod-text: #6b21a8;
    --status-paus-bg: #fff0e6;
    --status-paus-text: #c2410c;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--background);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Sidebar Custom Scroll */
aside::-webkit-scrollbar {
    width: 6px;
}
aside::-webkit-scrollbar-track {
    background: transparent;
}
aside::-webkit-scrollbar-thumb {
    background: #3d3e40;
    border-radius: 3px;
}

/* Scrollbar global */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #fcfbfb;
}
::-webkit-scrollbar-thumb {
    background: #d5d4d3;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a8a7a6;
}

/* Sidebar Custom Links */
.sidebar a {
    color: #a2a0a2;
    transition: all 0.15s ease-in-out;
}

.sidebar a:hover {
    color: #ffffff;
    background-color: #2d2e30;
}

.sidebar a.active {
    color: #ffffff;
    background-color: #3d3e40;
}

/* Asana Project Tabs Navigation */
.asana-tabs-container {
    border-bottom: 1px solid var(--border);
    background-color: #ffffff;
    padding-left: 24px;
    display: flex;
    align-items: flex-end;
    height: 38px;
}

.asana-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    margin-bottom: -1px;
}

.asana-tab:hover {
    color: #1e1f21;
}

.asana-tab.active {
    color: #1e1f21;
    border-bottom-color: #1e1f21;
    font-weight: 600;
}

/* Asana List View Table Grid */
.asana-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.asana-list-thead th {
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 400;
    font-size: 11px;
    text-transform: capitalize;
    padding: 6px 12px;
    background-color: #ffffff;
    user-select: none;
}

.asana-list-thead th:last-child {
    border-right: none;
}

/* Collapsible Row Header */
.asana-list-group-header {
    background-color: #fcfbfb;
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
    font-weight: 600;
    color: #1e1f21;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.asana-list-group-header:hover {
    background-color: #f5f4f3;
}

.asana-list-group-header .caret-icon {
    transition: transform 0.2s ease;
    margin-right: 8px;
    color: var(--text-muted);
}

.asana-list-group-header.collapsed .caret-icon {
    transform: rotate(-90deg);
}

/* Grid Row Cell */
.asana-list-row {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.15s;
    background-color: #ffffff;
}

.asana-list-row:hover {
    background-color: #fcfbfb;
}

.asana-list-cell {
    border-right: 1px solid var(--border);
    padding: 8px 12px;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asana-list-cell:last-child {
    border-right: none;
}

/* Circle checkbox icon */
.circle-checkbox {
    width: 14px;
    height: 14px;
    border: 1.5px solid var(--text-muted);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 8px;
}

.circle-checkbox:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.circle-checkbox i {
    font-size: 8px;
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}

.circle-checkbox:hover i {
    opacity: 0.5;
}

/* Badges */
.badge-priority-alta {
    background-color: var(--badge-high-bg);
    color: var(--badge-high-text);
}
.badge-priority-media {
    background-color: var(--badge-medium-bg);
    color: var(--badge-medium-text);
}
.badge-priority-baja {
    background-color: var(--badge-low-bg);
    color: var(--badge-low-text);
}

.badge-status-revision {
    background-color: var(--status-rev-bg);
    color: var(--status-rev-text);
}
.badge-status-aprobado {
    background-color: var(--status-aprob-bg);
    color: var(--status-aprob-text);
}
.badge-status-produccion {
    background-color: var(--status-prod-bg);
    color: var(--status-prod-text);
}
.badge-status-pausado {
    background-color: var(--status-paus-bg);
    color: var(--status-paus-text);
}
.badge-status-finalizado {
    background-color: #e2e8f0;
    color: #475569;
}

/* Card Asana Design */
.asana-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Form Styles */
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease-in-out;
    background-color: #fcfbfb;
    font-size: 13px;
}

.form-input:focus {
    border-color: #1e1f21;
    background-color: #ffffff;
    box-shadow: 0 0 0 2px rgba(30, 31, 33, 0.1);
}

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

/* Drag and Drop Container */
.dropzone {
    border: 2px dashed rgba(79, 70, 229, 0.3);
    background-color: rgba(79, 70, 229, 0.02);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background-color: rgba(79, 70, 229, 0.05);
}

/* Custom Checkbox/Radio styling */
.custom-checkbox-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    background-color: var(--card-bg);
}

.custom-checkbox-btn:hover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

input[type="checkbox"]:checked + .custom-checkbox-btn,
input[type="radio"]:checked + .custom-checkbox-btn {
    border-color: var(--primary);
    background-color: var(--primary);
    color: white;
}

input[type="checkbox"]:checked + .custom-checkbox-btn .checked-hidden,
input[type="radio"]:checked + .custom-checkbox-btn .checked-hidden {
    display: none !important;
}

input[type="checkbox"]:checked + .custom-checkbox-btn .checked-visible,
input[type="radio"]:checked + .custom-checkbox-btn .checked-visible {
    display: inline-block !important;
}

/* Kanban Columns */
.kanban-column {
    background-color: #f5f4f3;
    border-radius: 12px;
    padding: 12px;
    min-height: 500px;
}

/* Chat/Comment box styling */
.chat-bubble {
    border-radius: 12px;
    max-width: 85%;
}

.chat-bubble-client {
    background-color: var(--primary-light);
    border-bottom-left-radius: 4px;
}

.chat-bubble-internal {
    background-color: #f5f4f3;
    border-bottom-right-radius: 4px;
}

/* System Log Comments */
.chat-bubble-system {
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    font-size: 0.9rem;
    color: #92400e;
}

/* Stepper Wizard Styles */
.stepper-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    position: relative;
}

.stepper-header::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--border);
    z-index: 1;
    transform: translateY(-50%);
}

.stepper-step {
    position: relative;
    z-index: 2;
    background-color: #ffffff;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f5f4f3;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    font-size: 12px;
}

.stepper-step.active .step-circle {
    background-color: #1e1f21;
    color: white;
    border-color: #1e1f21;
    box-shadow: 0 0 0 3px rgba(30, 31, 33, 0.1);
}

.stepper-step.completed .step-circle {
    background-color: var(--success);
    color: white;
    border-color: var(--success);
}

.step-title {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.stepper-step.active .step-title {
    color: #1e1f21;
}

.stepper-step.completed .step-title {
    color: var(--success);
}

/* Dynamic content panels transitions */
.wizard-panel {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.wizard-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE / MOBILE-FIRST STYLES
   App nativa feel para móviles y tablets
═══════════════════════════════════════════════════ */

@media (min-width: 1025px) {
    .desktop-hidden { display: none !important; }
}

/* ── Bottom Navigation Bar (mobile) ─────────────── */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--sidebar-color, #2D2E30);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-bottom-nav nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 58px;
}

.mobile-bottom-nav a,
.mobile-bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #8C8B8D;
    font-size: 10px;
    font-weight: 500;
    min-width: 52px;
    height: 58px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 8px;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}

.mobile-bottom-nav a.active,
.mobile-bottom-nav a:active {
    color: #fff;
}

.mobile-bottom-nav a i,
.mobile-bottom-nav button i {
    font-size: 20px;
}

.mobile-bottom-nav .fab-center {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.35);
    margin-bottom: 4px;
    flex-direction: row;
    gap: 0;
    min-width: auto;
    height: auto;
    padding: 0;
}

.mobile-bottom-nav .fab-center i { font-size: 20px; }

/* ── Drawer overlay ──────────────────────────────── */
#mobile-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 200;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.25s ease;
}
#mobile-drawer-overlay.open { opacity: 1; }

/* ── Drawer sidebar (mobile) ─────────────────────── */
#mobile-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    z-index: 201;
    background: var(--sidebar-color, #2D2E30);
    display: flex;
    flex-direction: column;
    transition: left 0.28s cubic-bezier(0.4,0,0.2,1);
    padding-top: env(safe-area-inset-top);
}
#mobile-drawer.open { left: 0; }

#mobile-drawer-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

#mobile-drawer nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #A2A0A2;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
#mobile-drawer nav a:active,
#mobile-drawer nav a.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
#mobile-drawer nav a i { width: 20px; text-align: center; font-size: 15px; }

/* ── Mobile topbar ───────────────────────────────── */
.mobile-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 50;
    height: 54px;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: var(--sidebar-color, #2D2E30);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-top: env(safe-area-inset-top);
}

.mobile-topbar-search {
    display: none;
    padding: 8px 14px 10px;
    background: var(--sidebar-color, #2D2E30);
}

.mobile-topbar-search input {
    width: 100%;
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 10px;
    padding: 8px 12px 8px 36px;
    color: #fff;
    font-size: 14px;
    outline: none;
}
.mobile-topbar-search input::placeholder { color: rgba(255,255,255,0.5); }
.mobile-topbar-search .search-icon {
    position: absolute;
    left: 26px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.5);
    font-size: 14px;
}

/* ── Mobile card list view ───────────────────────── */
.mobile-card-list { display: none; }

/* ── Tablet: adjust sidebar ──────────────────────── */
@media (max-width: 1024px) {
    body > aside { display: none !important; }
    .desktop-topbar { display: none !important; }
    .mobile-topbar { display: flex !important; }
    .mobile-topbar-search { display: block !important; }
    .mobile-bottom-nav { display: block !important; }

    /* Compensate bottom nav */
    main { padding-bottom: 70px !important; }
    .flex-grow.flex.flex-col.overflow-hidden { overflow-y: auto !important; }
}

@media (max-width: 768px) {
    /* Dashboard adjustments */
    .dashboard-header { padding: 12px 14px 6px !important; }
    .dashboard-tabs { padding: 0 14px !important; overflow-x: auto; white-space: nowrap; }
    .dashboard-tabs::-webkit-scrollbar { display: none; }
    .dashboard-toolbar { padding: 8px 14px !important; }

    /* Hide table, show cards */
    .desktop-table { display: none !important; }
    .mobile-card-list { display: block !important; }

    /* Card styles */
    .m-card {
        background: #fff;
        border-bottom: 1px solid #edeceb;
        padding: 12px 14px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.15s;
        text-decoration: none;
        color: inherit;
    }
    .m-card:active { background: #f9f8f8; }
    .m-card-title {
        font-size: 13px;
        font-weight: 500;
        color: #1e1f21;
        line-height: 1.3;
    }
    .m-card-meta {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    .m-card-date { font-size: 12px; color: #187A53; }
    .m-card-area {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        background: #F2F1F1;
        border-radius: 4px;
        padding: 2px 7px;
        font-size: 11px;
        color: #1e1f21;
    }
    .m-card-area-dot { width: 10px; height: 10px; border-radius: 3px; background: #7A9FE9; flex-shrink: 0; }
    .m-card-unit { font-size: 11px; color: #6D6E6F; display: flex; align-items: center; gap: 4px; }
    .m-group-header {
        background: #f9f8f8;
        padding: 8px 14px;
        font-size: 12px;
        font-weight: 700;
        color: #1e1f21;
        border-bottom: 1px solid #edeceb;
        display: flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    /* Toolbar mobile */
    .add-btn-text { display: none; }
    .add-btn-icon-only {
        width: 34px; height: 34px;
        border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
    }

    /* Wizard / forms */
    .stepper-header { gap: 4px; }
    .stepper-step { padding: 0 4px; }
    .step-title { font-size: 9px; }
    .step-circle { width: 26px; height: 26px; font-size: 11px; }

    /* Detail page */
    .detail-sidebar { display: none; }
}

/* ── iPhone safe-area support ────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ── Prevent body scroll when drawer open ────────── */
body.drawer-open { overflow: hidden; }

