@import url("./application.css");
@import url("./components/sidebar.css");
@import url("./components/offcanvas.css");
@import url("./components/appointment-offcanvas.css");


/* ==========================================================================
   OMYRA — APPLICATION COMPONENTS
   Layouts y componentes funcionales. La identidad visual vive en application.css.
   ========================================================================== */

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    margin: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-family-brand);
}

body.app-shell {
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px clamp(20px, 5vw, 64px);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
}

h2 {
    font-size: 22px;
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--color-primary-hover);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.api-link,
button {
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: var(--color-on-primary);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
}

.api-link {
    padding: 10px 14px;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-form {
    margin: 0;
}

.secondary-button {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    padding: 10px 14px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 24px;
    padding: 28px clamp(20px, 5vw, 64px);
}

.panel {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}

.form-panel {
    padding: 22px;
}

form {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    padding: 11px 12px;
}

textarea {
    resize: vertical;
}

button {
    margin-top: 6px;
    padding: 12px 16px;
}

button:hover,
.api-link:hover {
    background: var(--color-primary-hover);
}

.secondary-button:hover {
    background: var(--color-surface-hover);
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 300px;
}

.search-wrapper input {
    padding-left: 36px;
    height: 40px;
}

.search-wrapper::before {
    content: "🔍";
    position: absolute;
    left: 12px;
    font-size: 14px;
    pointer-events: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card {
    padding: 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition:
        transform .16s ease,
        border-color .16s ease,
        background-color .16s ease,
        box-shadow .16s ease;
}

.stat-card.customer-filter-card {
    cursor: pointer;
}

.stat-card.customer-filter-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary-border);
    box-shadow: var(--shadow-hover);
}

.stat-card.customer-filter-card.is-active {
    background: var(--color-primary-soft);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-inset-primary);
}

.stat-card.service-filter-card {
    cursor: pointer;
}

.stat-card.service-filter-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary-border);
    box-shadow: var(--shadow-hover);
}

.stat-card.service-filter-card.is-active {
    background: var(--color-primary-soft);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-inset-primary);
}

.stat-card h3 {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.stat-number {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    font-weight: 800;
    color: var(--color-text);
}

.actions-cell {
    text-align: right;
}

.view-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.view-link:hover {
    text-decoration: underline;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.agenda-panel {
    min-width: 0;
    overflow: hidden;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px;
    border-bottom: 1px solid var(--color-border);
}

.counter {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    border-radius: var(--radius-pill);
    background: var(--color-primary-soft);
    color: var(--color-primary-hover);
    font-weight: 800;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

th,
td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--color-text-muted);
    font-size: 12px;
    text-transform: uppercase;
}

td small {
    display: block;
    margin-top: 4px;
    color: var(--color-text-muted);
}

.status{
    min-width:110px;
    justify-content:center;
}

.empty {
    padding: 34px 22px;
    color: var(--color-text-muted);
}

.error {
    color: var(--color-danger);
    font-size: 13px;
}

.success {
    margin-top: 14px;
    color: var(--color-success);
    font-weight: 700;
}

/* Dashboard Styles */
.app {
    display: flex;
    height: 100vh;
}

.main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.page-content {
    flex: 1;
    overflow-y: auto;
}

.app-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);

    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.app-main {
    display: flex;
    flex-direction: column;
    gap: 32px;

    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 0;
    flex: 1;

    padding:
        64px
        clamp(20px, 5vw, 64px)
        40px;

    overflow-x: hidden;
    overflow-y: auto;
}

.welcome h2 {
    font-size: 32px;
    margin-bottom: 8px;
}

.welcome p {
    color: var(--color-text-muted);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.kpi-grid .card {
    padding: 14px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.kpi-grid .card h3 {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.kpi-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-text);
}

.dashboard-top-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: start;
    margin-top: 18px;
}

.dashboard-agenda-row {
    margin-top: 18px;
}

.attention-panel,
.calendar-panel {
    min-width: 0;
}

.panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    min-width: 0;
}

.panel h2 {
    padding: 16px 18px;
    font-size: 16px;
    border-bottom: 1px solid var(--color-border);
}

.section-heading h2 {
    padding: 0;
    border-bottom: 0;
}

.section-heading a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.assistant-box {
    padding: 14px 18px;
    background: var(--color-surface-subtle);
}

.assistant-box p {
    margin-bottom: 12px;
    line-height: 1.5;
}

.assistant-box strong {
    color: var(--color-primary-hover);
}

.business-name {
    font-weight: 700;
    color: var(--color-text-muted);
    margin-right: 12px;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.topbar-title {
    min-width: 0;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-deep-navy), var(--color-primary));
    color: var(--color-on-primary);
    box-shadow: var(--shadow-brand);
    flex: 0 0 auto;
}

@media (max-width: 1100px) {
    .dashboard-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
    
}

/* Utils */
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.text-muted { color: var(--color-text-muted); }
.fw-bold { font-weight: 700; }

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    overflow: hidden;
}

.login-brand-shell {
    position: fixed;
    inset: 0 auto auto 0;
    left: 50%;
    top: 115px;
    transform: translate(-50%, -50%) scale(1.6);
    z-index: 2;
    pointer-events: none;
}

.login-brand-logo {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    width: 280px;
    max-width: 80vw;
    height: auto;
}

.login-shell {
    width: min(100%, 420px);
}

.login-panel {
    padding: 28px;
}

.login-panel h1 {
    font-size: 30px;
}

.login-message {
    margin-top: 16px;
}

@keyframes login-brand-move {
    0% {
        left: 50%;
        top: 84px;
        transform: translate(-50%, -50%) scale(1.6);
        opacity: 1;
    }
    100% {
        left: clamp(20px, 5vw, 64px);
        top: 28px;
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
}

.login-submitting .login-brand-shell {
    animation: login-brand-move 1.8s ease-out forwards;
}

.login-submitting .login-shell {
    opacity: 0.35;
    transition: opacity 500ms ease;
}

@media (max-width: 900px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-actions {
        align-items: stretch;
        width: 100%;
    }

    .topbar-actions > * {
        flex: 1;
    }

    .api-link,
    .secondary-button {
        display: block;
        width: 100%;
        text-align: center;
    }

    .layout {
        grid-template-columns: 1fr;
    }
}

.editable-field {

    cursor: pointer;

    display: inline-block;

    padding: 6px 8px;

    border-radius: var(--radius-sm);

    transition: var(--transition-base);

}

.editable-field:hover {

    background: var(--color-surface-subtle);

}

.inline-editor {

    border: 2px solid var(--color-primary);

    border-radius: var(--radius-sm);

    padding: 6px 8px;

    font: inherit;

    width: 250px;

}

.editable-field::after {

    content: "✏️";

    opacity: 0;

    margin-left: 8px;

    transition: var(--transition-base);

}

.editable-field:hover::after {

    opacity: 1;

}

.appointments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.appointment-card {
    display: grid;
    grid-template-columns: 180px auto 180px;
    align-items: center;
    gap: 2rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.appointment-info .label {
    font-size: .8rem;
    color: var(--color-text-muted);
    margin-bottom: .25rem;
}

.appointment-info .value {
    font-weight: 600;
}

.appointment-time {
    width: auto;
}

.appointment-details {
    min-width: 0;
}

.appointment-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
}

.appointments-list{
    display:flex;
    flex-direction:column;
}

.appointment-card{

    display:flex;

    align-items:center;

    gap:2rem;

    padding:1.25rem 1.5rem;

    border-bottom:1px solid var(--color-border);

}

.appointment-time{

    width:180px;

    flex-shrink:0;

}

.appointment-time .day{

    font-size:.9rem;

    color:var(--color-text-muted);

}

.appointment-time .hour{

    margin-top:.25rem;

    font-size:1.15rem;

    font-weight:700;

}

.appointment-actions{

    display:flex;

    gap:.5rem;

}

.appointment-actions .secondary-button {

    width: 34px;
    height: 34px;

    padding: 0;

    display: grid;
    place-items: center;

}

.appointment-details .customer{

    font-size:1rem;

    font-weight:700;

    margin-bottom:.3rem;

}

.appointment-details .service{

    color:var(--color-text-muted);

}

.availability-results{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
    gap:1rem;
}

.availability-results{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
    gap:1rem;
}

.availability-card{

    border:1px solid var(--color-border);
    border-radius: var(--radius-sm);

    padding:1rem;

    cursor:pointer;

    transition: var(--transition-base);
}

.availability-card:hover{

    transform:translateY(-2px);

    border-color:var(--color-primary);

    box-shadow: var(--shadow-md);
}

.availability-card.selected{

    background:var(--color-primary);
    color: var(--color-on-primary);
}

.availability-time{

    font-size:1.2rem;
    font-weight:700;
}

.availability-employee{

    margin-top:.5rem;

    opacity:.75;
}

.customer-suggestion{

    padding:12px;

    border:1px solid var(--color-border);

    border-radius: var(--radius-md);

    margin-top:8px;

    cursor:pointer;

    transition: var(--transition-base);
}

.customer-suggestion:hover{

    background:var(--color-surface-subtle);

    border-color:var(--color-primary);
}

.customer-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 20px;
    margin-top: 8px;
}

.customer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: .95rem;
}

.material-symbols-outlined {
    font-size: 18px;
    vertical-align: middle;
    margin-right: 6px;
}

.create-customer {
    border: 1px dashed var(--color-border-strong);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    transition:
        background-color var(--transition-base),
        border-color var(--transition-base),
        box-shadow var(--transition-base);
}

.create-customer strong {
    color: var(--color-text);
}

.create-customer .material-symbols-outlined,
.create-customer small {
    color: var(--color-text-muted);
}

.create-customer:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    box-shadow: var(--shadow-sm);
}

.create-customer:hover strong,
.create-customer:hover .material-symbols-outlined {
    color: var(--color-primary);
}

.conversation-card{

    padding:12px 0;

}

.conversation-card:last-child{

    padding-bottom:0;

}

.conversation-header{

    font-size:16px;
    margin-bottom:6px;

}

.conversation-phone{

    color:var(--color-text-muted);
    margin-bottom:4px;
    font-size:13px;

}

.conversation-time{

    color:var(--color-text-subtle);
    font-size:13px;
    margin-bottom:12px;

}

.conversation-actions{

    display:flex;
    gap:8px;

}

.conversation-actions .secondary-button,
.conversation-actions .primary-button {
    padding: 8px 12px;
    font-size: 13px;
}

.calendar-panel #dashboardCalendar {
    min-height: 460px;
}

th:last-child,
td:last-child {
    width: 90px;
    text-align: center;
}

.working-period-chip {
    border-radius: var(--radius-pill);
    min-width: 120px;
    font-weight: 500;
    transition: all .2s;
}

.working-period-chip:hover {
    transform: translateY(-1px);
}

.employee-offcanvas {
    --bs-offcanvas-width: 900px;
}

.working-period-delete {

    cursor: pointer;
    color: var(--bs-danger);
    font-size: 1rem;
    transition: var(--transition-fast);

}

.working-period-delete:hover {

    transform: scale(1.15);
    opacity: .8;

}

.service-images-grid {

    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(150px,1fr));

    gap: 1rem;

}

.service-image-card {

    position: relative;

    aspect-ratio: 1;

    overflow: hidden;

    border-radius: var(--radius-sm);

    border: 1px solid var(--color-border);

}

.service-image-card img {

    width: 100%;

    height: 100%;

    object-fit: cover;

}

.service-image-add-card {

    aspect-ratio: 1;

    border: 2px dashed var(--color-border-strong);

    border-radius: var(--radius-sm);

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    cursor: pointer;

    transition: var(--transition-base);

}

.service-image-add-card:hover {

    background: var(--color-surface-subtle);

    border-color: var(--bs-primary);

}

.delete-image-button {

    position: absolute;

    top: .5rem;

    right: .5rem;

    opacity: 0;

    transition: var(--transition-base);

}

.service-image-card:hover .delete-image-button {

    opacity: 1;

}

.service-image img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.dashboard-page,
.appointments-page,
.customers-page,
.employees-page,
.services-page,
.settings-page {
    min-width: 0;
    margin: 0;
    padding: 0;
}!important
