/* ================================================
   Arqfree - Premium Smart Dashboard UI
   ================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-main: #060606;
    --bg-sidebar: #090909;
    --bg-card: #101010;
    --bg-input: #141414;
    --border-soft: #202020;
    --border-input: #2a2a2a;
    --text-main: #ffffff;
    --text-muted: #9a9a9a;
    --accent: #95c11f;
    --accent-hover: #a6d626;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
    --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(circle at 92% -10%, rgba(149, 193, 31, 0.14), transparent 34%),
        radial-gradient(circle at -10% 110%, rgba(149, 193, 31, 0.08), transparent 34%),
        var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
}

@keyframes fadeRise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-soft);
    padding: 26px 18px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Satoshi', sans-serif;
    font-weight: 700;
    background: rgba(149, 193, 31, 0.15);
    color: var(--accent);
    border: 1px solid rgba(149, 193, 31, 0.4);
}

.brand h1 {
    font-family: 'Satoshi', sans-serif;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.brand p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}

.sidebar-greeting {
    color: #d9ee9c;
    font-size: 0.78rem;
    line-height: 1.4;
    background: rgba(149, 193, 31, 0.1);
    border: 1px solid rgba(149, 193, 31, 0.28);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 10px;
}

.sidebar-gemini {
    width: 100%;
    max-width: 190px;
    display: block;
    margin: 0 auto;
    opacity: 0.9;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.45));
}

.nav-item {
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: 0.2s ease;
    font-size: 0.95rem;
}

.nav-item svg {
    width: 17px;
    height: 17px;
    stroke: #ffffff;
}

.nav-item:hover,
.nav-item.active {
    background: #111111;
    border-color: var(--border-soft);
    transform: translateY(-2px);
}

.workspace {
    padding: 28px;
}

.dashboard-hero {
    position: relative;
    margin: -28px -28px 20px -28px;
    min-height: 210px;
    border-radius: 0;
    overflow: hidden;
    border-bottom: 1px solid var(--border-soft);
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.45) 45%, rgba(0, 0, 0, 0.2) 100%);
    pointer-events: none;
}

.dashboard-hero-img {
    width: 100%;
    height: 100%;
    min-height: 210px;
    display: block;
    object-fit: cover;
}

.dashboard-hero-content {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 34px 28px;
    max-width: 760px;
}

.workspace-header {
    margin-bottom: 22px;
    animation: fadeRise 0.45s ease both;
}

.greeting-banner {
    display: inline-flex;
    align-items: center;
    background: rgba(149, 193, 31, 0.12);
    border: 1px solid rgba(149, 193, 31, 0.35);
    color: #d9ee9c;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.82rem;
    margin-bottom: 10px;
}

.eyebrow {
    color: var(--accent);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.workspace-header h2 {
    font-family: 'Satoshi', sans-serif;
    font-size: clamp(1.6rem, 2.7vw, 2.2rem);
    font-weight: 600;
    margin-bottom: 6px;
}

.subtitle {
    color: var(--text-muted);
    max-width: 680px;
}

.quote-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.premium-card {
    background: linear-gradient(180deg, rgba(17, 17, 17, 0.97) 0%, rgba(11, 11, 11, 0.97) 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    padding: 20px;
    transition: 0.2s ease;
    animation: fadeRise 0.45s ease both;
}

.premium-card:nth-of-type(1) {
    animation-delay: 0.06s;
}

.premium-card:nth-of-type(2) {
    animation-delay: 0.12s;
}

.premium-card:nth-of-type(3) {
    animation-delay: 0.18s;
}

.premium-card:nth-of-type(4) {
    animation-delay: 0.24s;
}

.premium-card:hover {
    transform: translateY(-2px);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-head h3 {
    font-family: 'Satoshi', sans-serif;
    font-size: 1.12rem;
    font-weight: 600;
}

.tag {
    font-size: 0.72rem;
    color: var(--text-muted);
    border: 1px solid var(--border-soft);
    padding: 4px 8px;
    border-radius: 999px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.split-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

input {
    width: 100%;
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 12px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: 0.2s ease;
}

select {
    width: 100%;
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 12px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: 0.2s ease;
}

input::placeholder {
    color: #6f6f6f;
}

input:focus {
    outline: none;
    border: 1px solid var(--accent);
    box-shadow: 0 0 0 2px rgba(149, 193, 31, 0.16);
}

select:focus {
    outline: none;
    border: 1px solid var(--accent);
    box-shadow: 0 0 0 2px rgba(149, 193, 31, 0.16);
}

.option-grid,
.chip-grid {
    display: grid;
    gap: 10px;
}

.option-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chip-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option-card,
.chip-card {
    border: 1px solid var(--border-input);
    background: #1a1a1a;
    color: var(--text-main);
    border-radius: var(--radius-md);
    padding: 12px 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s ease;
}

.option-card:hover,
.chip-card:hover {
    border-color: #3a3a3a;
    transform: translateY(-2px);
}

.option-card.active,
.chip-card.active {
    background: var(--accent);
    color: #000000;
    border-color: var(--accent);
    font-weight: 600;
}

.compact-space {
    margin-bottom: 12px;
}

.result-card {
    display: flex;
    flex-direction: column;
    min-height: 330px;
}

.result-label {
    color: var(--text-muted);
    margin-bottom: 8px;
}

.result-price {
    font-family: 'Satoshi', sans-serif;
    font-size: clamp(2.05rem, 4vw, 2.85rem);
    color: var(--accent);
    line-height: 1;
    margin-bottom: 14px;
}

.result-meta {
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: #0d0d0d;
    padding: 12px;
    margin-bottom: 16px;
}

.result-meta p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.result-meta p:last-child {
    margin-bottom: 0;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
}

.btn {
    border: none;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 12px 14px;
    transition: 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: #191919;
    color: #e8e8e8;
    border: 1px solid #2d2d2d;
}

.btn-generate {
    background: var(--accent);
    color: #000000;
    min-width: 180px;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    padding: 13px 18px;
}

.btn-generate:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    color: #c5c5c5;
    border: 1px solid #2d2d2d;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.preview-card {
    min-height: 330px;
}

.analytics-card {
    grid-column: 1 / -1;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.chart-block {
    background: #0d0d0d;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 12px;
    min-height: 260px;
}

.chart-title {
    color: var(--text-muted);
    font-size: 0.84rem;
    margin-bottom: 10px;
}

.chart-block canvas {
    width: 100% !important;
    height: 210px !important;
}

.pdf-mockup {
    background: linear-gradient(160deg, #f6f6f6 0%, #dedede 100%);
    border-radius: 14px;
    color: #111111;
    padding: 16px;
    min-height: 240px;
    border: 1px solid #d3d3d3;
}

.pdf-brand {
    font-family: 'Satoshi', sans-serif;
    color: #6f8f16;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.pdf-mockup h4 {
    font-family: 'Satoshi', sans-serif;
    margin-bottom: 14px;
}

.pdf-mockup ul {
    list-style: none;
}

.pdf-mockup li {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    padding: 7px 0;
    gap: 12px;
}

.pdf-mockup span {
    color: #444444;
    font-size: 0.85rem;
}

.pdf-mockup strong {
    font-size: 0.86rem;
    text-align: right;
}

@media (max-width: 1080px) {
    .dashboard-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--border-soft);
        padding: 16px;
        gap: 16px;
        position: static;
        height: auto;
        overflow: visible;
    }

    .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .workspace {
        padding: 18px;
    }

    .dashboard-hero {
        margin: -18px -18px 16px -18px;
        min-height: 180px;
    }

    .dashboard-hero-img {
        min-height: 180px;
    }

    .dashboard-hero-content {
        padding: 20px 18px;
    }
}

@media (max-width: 840px) {
    .quote-grid {
        grid-template-columns: 1fr;
    }

    .split-fields,
    .option-grid.two,
    .chip-grid {
        grid-template-columns: 1fr;
    }

    .actions-row .btn {
        width: 100%;
    }

    .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-hero {
        min-height: 150px;
    }

    .dashboard-hero-img {
        min-height: 150px;
    }
}

/* ================================================
   Secondary Pages (Clientes, Proyectos, PDFs)
   ================================================ */

.page-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.page-main {
    padding: 28px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: #0d0d0d;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px;
}

.stat-card p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.stat-card h4 {
    font-family: 'Satoshi', sans-serif;
    font-size: 1.4rem;
    color: var(--text-main);
}

.table-card {
    background: linear-gradient(180deg, rgba(17, 17, 17, 0.97) 0%, rgba(11, 11, 11, 0.97) 100%);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    padding: 16px;
    overflow-x: auto;
}

.table-card table {
    width: 100%;
    border-collapse: collapse;
}

.table-card th,
.table-card td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #232323;
    white-space: nowrap;
}

.table-card th {
    color: #d8d8d8;
    font-size: 0.83rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-card td {
    color: #bdbdbd;
    font-size: 0.92rem;
}

.table-card tbody tr:hover {
    background: #0f0f0f;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-form {
    margin: 0;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #2c2c2c;
    background: #151515;
    color: #e7e7e7;
    font-size: 0.78rem;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s ease;
}

.action-btn:hover {
    transform: translateY(-1px);
}

.action-edit:hover {
    border-color: #95c11f;
    color: #d9ee9c;
}

.action-delete:hover {
    border-color: #ea5454;
    color: #ffc2c2;
}

.edit-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.edit-form-grid .full {
    grid-column: 1 / -1;
}

.feedback-box {
    border: 1px solid #2e2e2e;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 0.88rem;
}

.feedback-box.ok {
    border-color: #95c11f;
    color: #d7ec9d;
    background: rgba(149, 193, 31, 0.09);
}

.feedback-box.error {
    border-color: #ea5454;
    color: #ffc0c0;
    background: rgba(234, 84, 84, 0.09);
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid #2f2f2f;
    font-size: 0.78rem;
}

.badge-pill.nacional {
    background: rgba(149, 193, 31, 0.15);
    color: #b9de53;
}

.badge-pill.internacional {
    background: rgba(80, 160, 255, 0.15);
    color: #89bcff;
}

.empty-state {
    text-align: center;
    color: #9c9c9c;
    padding: 30px;
}

@media (max-width: 1080px) {
    .page-shell {
        grid-template-columns: 1fr;
    }

    .page-main {
        padding: 18px;
    }
}

@media (max-width: 840px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .edit-form-grid {
        grid-template-columns: 1fr;
    }
}
