/* ── Albera Clientes – Public Styles ─────────────────────────────────────── */
:root {
    --ac-black:  #1a1a1a;
    --ac-white:  #ffffff;
    --ac-g50:    #f8f7f4;
    --ac-g100:   #f3f4f6;
    --ac-g200:   #e5e3de;
    --ac-g400:   #9ca3af;
    --ac-g600:   #6b7280;
    --ac-g800:   #374151;
    --ac-blue:   #1d4ed8;
    --ac-green:  #15803d;
    --ac-amber:  #d97706;
    --ac-red:    #dc2626;
    --ac-pm-bg:  #eff6ff;
    --ac-pm-border: #bfdbfe;
    --ac-font:   'Georgia', serif;
}

*, *::before, *::after { box-sizing: border-box; }

.ac-wrap { max-width: 980px; margin: 0 auto; padding: 1.5rem 1rem; font-family: var(--ac-font); position: relative; }

/* ── Header área ── */
.ac-area-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.ac-area-title  { margin: 0; font-size: 1.6rem; font-weight: 700; }
.ac-area-sub    { margin: .2rem 0 0; font-size: .85rem; color: var(--ac-g400); }
.ac-header-actions { display: flex; align-items: center; gap: .75rem; }

/* ── Notificaciones bell ── */
.ac-notif-bell { position: relative; cursor: pointer; font-size: 1.1rem; padding: .4rem .7rem; border: 1px solid var(--ac-g200); border-radius: 2px; user-select: none; }
.ac-bell-badge { position: absolute; top: -6px; right: -6px; background: var(--ac-red); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: .65rem; display: flex; align-items: center; justify-content: center; font-family: sans-serif; font-weight: 700; }
.ac-notif-panel { position: absolute; top: 3.5rem; right: 1rem; width: 340px; background: var(--ac-white); border: 1px solid var(--ac-g200); z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.ac-notif-head  { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--ac-g200); background: var(--ac-g50); }
.ac-notif-head strong { font-size: .88rem; }
.ac-notif-list  { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.ac-notif-item  { display: flex; align-items: flex-start; gap: .6rem; padding: .75rem 1rem; border-bottom: 1px solid var(--ac-g100); }
.ac-notif-item--unread { background: #f0f7ff; }
.ac-notif-icon  { font-size: 1.1rem; flex-shrink: 0; margin-top: .1rem; }
.ac-notif-body  { flex: 1; min-width: 0; }
.ac-notif-title { display: block; font-size: .85rem; font-weight: 600; line-height: 1.3; }
.ac-notif-sub   { display: block; font-size: .78rem; color: var(--ac-g600); margin-top: .15rem; }
.ac-notif-date  { display: block; font-size: .72rem; color: var(--ac-g400); margin-top: .2rem; }
.ac-notif-link  { font-size: .78rem; color: var(--ac-blue); white-space: nowrap; text-decoration: none; }
.ac-notif-link:hover { text-decoration: underline; }
.ac-notif-empty { padding: 1.5rem; text-align: center; font-size: .85rem; color: var(--ac-g400); }

/* ── Tabs ── */
.ac-tabs { display: flex; gap: .25rem; margin-bottom: 1.5rem; border-bottom: 2px solid var(--ac-g200); flex-wrap: wrap; }
.ac-tab  { padding: .65rem 1.25rem; text-decoration: none; font-family: var(--ac-font); font-size: .9rem; color: var(--ac-g600); border-bottom: 3px solid transparent; margin-bottom: -2px; transition: .15s; position: relative; }
.ac-tab:hover { color: var(--ac-black); }
.ac-tab.active { color: var(--ac-black); border-bottom-color: var(--ac-black); font-weight: 700; }
.ac-tab-badge { display: inline-flex; align-items: center; justify-content: center; background: var(--ac-red); color: #fff; border-radius: 50%; width: 16px; height: 16px; font-size: .65rem; margin-left: .3rem; font-family: sans-serif; font-weight: 700; }

/* ── Mini stats ── */
.ac-mini-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-bottom: 1.25rem; }
.ac-mini-stat  { background: var(--ac-white); border: 1px solid var(--ac-g200); padding: 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.ac-mini-stat-num { font-size: 2rem; font-weight: 700; line-height: 1; }
.ac-mini-stat span:last-child { font-size: .8rem; color: var(--ac-g600); text-transform: uppercase; letter-spacing: .06em; }
.ac-num--red { color: var(--ac-red); }

/* ── Cards ── */
.ac-card { background: var(--ac-white); border: 1px solid var(--ac-g200); padding: 1.5rem; margin-bottom: 1rem; border-radius: 2px; }
.ac-card--highlight { border-left: 3px solid var(--ac-amber); }
.ac-card--pres { padding: 1.2rem; }
.ac-card--feedback { padding: 1.2rem; }
.ac-card-title  { margin: 0 0 .4rem; font-size: 1.3rem; font-weight: 700; }
.ac-card-title-sm { margin: 0 0 .75rem; font-size: 1rem; font-weight: 700; }
.ac-card-sub    { margin: 0 0 1.25rem; font-size: .88rem; color: var(--ac-g600); font-style: italic; }
.ac-card-pres-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; flex-wrap: wrap; gap: .3rem; }
.ac-pres-desc   { font-size: .88rem; color: var(--ac-g600); margin: .4rem 0; line-height: 1.5; }
.ac-pres-importe { font-size: 1.8rem; font-weight: 700; display: block; margin: .3rem 0; }
.ac-pres-notas  { font-size: .82rem; color: var(--ac-g600); margin: .3rem 0; font-style: italic; }
.ac-pres-oferta-row { display: flex; justify-content: space-between; align-items: center; background: #f0fdf4; border: 1px solid #bbf7d0; padding: 1rem; margin: .75rem 0; flex-wrap: wrap; gap: .75rem; }
.ac-pres-fecha  { font-size: .75rem; color: var(--ac-g400); display: block; margin-top: .6rem; }
.ac-pres-actions { display: flex; gap: .5rem; }
.ac-feedback-resp { background: var(--ac-g50); border-left: 3px solid var(--ac-g200); padding: .75rem 1rem; margin-top: .75rem; font-size: .88rem; }

/* ── Home grid ── */
.ac-home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.ac-conv-asunto  { font-size: 1rem; font-weight: 600; margin: 0 0 .4rem; }
.ac-conv-preview { font-size: .85rem; color: var(--ac-g600); margin: 0; }

/* ── Chat layout ── */
.ac-chat-layout { display: grid; grid-template-columns: 280px 1fr; gap: 0; border: 1px solid var(--ac-g200); min-height: 520px; background: var(--ac-white); }
.ac-conv-list   { border-right: 1px solid var(--ac-g200); overflow-y: auto; max-height: 600px; }
.ac-conv-list-head { padding: .75rem 1rem; border-bottom: 1px solid var(--ac-g200); background: var(--ac-g50); }
.ac-conv-list-head h3 { margin: 0; font-size: .88rem; }
.ac-conv-item   { display: block; text-decoration: none; padding: .75rem 1rem; border-bottom: 1px solid var(--ac-g100); color: var(--ac-black); transition: .1s; }
.ac-conv-item:hover { background: var(--ac-g50); }
.ac-conv-item.active { background: #eff6ff; border-left: 3px solid var(--ac-blue); }
.ac-conv-item.unread { font-weight: 700; }
.ac-conv-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .4rem; }
.ac-conv-item-asunto { font-size: .88rem; flex: 1; line-height: 1.3; }
.ac-conv-item-preview { display: block; font-size: .78rem; color: var(--ac-g600); margin-top: .2rem; }
.ac-conv-item-date { display: block; font-size: .7rem; color: var(--ac-g400); margin-top: .2rem; }
.ac-empty-conv  { padding: 2rem 1rem; text-align: center; font-size: .85rem; color: var(--ac-g400); }
.ac-chat-empty  { display: flex; align-items: center; justify-content: center; font-size: .9rem; color: var(--ac-g400); flex: 1; }
.ac-chat-area   { display: flex; flex-direction: column; }

/* ── Mensajes ── */
.ac-chat-header { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1.25rem; border-bottom: 1px solid var(--ac-g200); background: var(--ac-g50); flex-wrap: wrap; gap: .4rem; }
.ac-chat-header h3 { margin: 0; font-size: .95rem; }
.ac-messages { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .75rem; max-height: 400px; }
.ac-msg { display: flex; gap: .6rem; align-items: flex-start; }
.ac-msg--pm { flex-direction: row; }
.ac-msg--client { flex-direction: row-reverse; }
.ac-msg-avatar img { border-radius: 50%; }
.ac-msg-body { max-width: 72%; }
.ac-msg--pm .ac-msg-body { background: var(--ac-pm-bg); border: 1px solid var(--ac-pm-border); padding: .6rem .85rem; border-radius: 0 6px 6px 6px; }
.ac-msg--client .ac-msg-body { background: var(--ac-black); color: var(--ac-white); padding: .6rem .85rem; border-radius: 6px 0 6px 6px; }
.ac-msg--client .ac-msg-body .ac-msg-meta { color: rgba(255,255,255,.6); }
.ac-msg--client .ac-msg-body .ac-msg-meta strong { color: rgba(255,255,255,.9); }
.ac-msg-meta { display: flex; gap: .5rem; align-items: baseline; margin-bottom: .3rem; flex-wrap: wrap; }
.ac-msg-meta strong { font-size: .78rem; }
.ac-msg-meta span  { font-size: .72rem; }
.ac-msg-pm-tag { background: var(--ac-blue); color: #fff; font-size: .65rem; padding: .1rem .35rem; border-radius: 2px; font-weight: 700; letter-spacing: .05em; }
.ac-msg-text { font-size: .88rem; line-height: 1.55; }
.ac-msg-text p { margin: .3rem 0; }
.ac-msg-adjuntos { margin-top: .4rem; display: flex; flex-direction: column; gap: .2rem; }
.ac-adj-link { font-size: .78rem; color: var(--ac-blue); text-decoration: none; }
.ac-adj-link:hover { text-decoration: underline; }
.ac-no-msgs { text-align: center; padding: 2rem; font-size: .85rem; color: var(--ac-g400); }

/* ── Reply box ── */
.ac-reply-box { border-top: 1px solid var(--ac-g200); padding: .75rem 1rem; }
.ac-reply-row  { display: flex; gap: .5rem; align-items: flex-end; }
.ac-reply-row textarea { flex: 1; border: 1px solid var(--ac-g200); padding: .5rem .75rem; font-family: var(--ac-font); font-size: .88rem; resize: none; border-radius: 2px; outline: none; }
.ac-reply-row textarea:focus { border-color: var(--ac-blue); }
.ac-reply-actions { display: flex; flex-direction: column; gap: .35rem; }
.ac-upload-label { cursor: pointer; font-size: 1.1rem; padding: .35rem; border: 1px solid var(--ac-g200); text-align: center; border-radius: 2px; }
.ac-upload-preview { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--ac-g600); margin-top: .4rem; }
.ac-upload-preview button { border: none; background: none; cursor: pointer; color: var(--ac-red); font-size: .9rem; }
.ac-conv-closed { text-align: center; padding: 1rem; font-size: .88rem; color: var(--ac-g400); font-style: italic; border-top: 1px solid var(--ac-g200); }

/* ── Formularios ── */
.ac-form-row { margin-bottom: .9rem; }
.ac-form-row label { display: block; font-size: .82rem; font-weight: 700; color: var(--ac-g800); margin-bottom: .3rem; }
.ac-form-row input,
.ac-form-row select,
.ac-form-row textarea { width: 100%; border: 1px solid #d1d5db; padding: .48rem .7rem; font-family: var(--ac-font); font-size: .9rem; border-radius: 2px; outline: none; }
.ac-form-row input:focus,
.ac-form-row select:focus,
.ac-form-row textarea:focus { border-color: var(--ac-blue); }
.ac-form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ac-form-actions { display: flex; align-items: center; gap: 1rem; margin-top: 1rem; }
.ac-form-msg { font-size: .85rem; }
.ac-form-msg--success { color: var(--ac-green); }
.ac-form-msg--error   { color: var(--ac-red); }
.ac-input-euro { display: flex; border: 1px solid #d1d5db; border-radius: 2px; overflow: hidden; }
.ac-input-euro span { padding: .48rem .6rem; background: var(--ac-g50); color: var(--ac-g600); font-size: .85rem; border-right: 1px solid #d1d5db; }
.ac-input-euro input { border: none; flex: 1; outline: none; padding: .48rem .6rem; font-family: var(--ac-font); }

/* ── Star rating ── */
.ac-star-rating { display: flex; gap: .2rem; cursor: pointer; }
.ac-star { font-size: 1.5rem; color: var(--ac-g200); transition: color .1s; }
.ac-star.active, .ac-star.hover { color: #f59e0b; }

/* ── Badges ── */
.ac-badge { display: inline-block; padding: .18rem .5rem; border-radius: 2px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.ac-badge--abierta   { background: #dbeafe; color: #1e40af; }
.ac-badge--en_espera { background: #fef3c7; color: #92400e; }
.ac-badge--resuelta  { background: #d1fae5; color: #065f46; }
.ac-badge--cerrada   { background: #f1f5f9; color: #475569; }
.ac-badge--pendiente { background: #fef3c7; color: #92400e; }
.ac-badge--revisando { background: #dbeafe; color: #1e40af; }
.ac-badge--ofertado  { background: #ede9fe; color: #5b21b6; }
.ac-badge--aceptado  { background: #d1fae5; color: #065f46; }
.ac-badge--rechazado { background: #fee2e2; color: #991b1b; }
.ac-badge--caducado  { background: #f1f5f9; color: #475569; }
.ac-badge--resuelto  { background: #d1fae5; color: #065f46; }
.ac-badge--cerrado   { background: #f1f5f9; color: #475569; }
.ac-badge--tipo      { background: var(--ac-g100); color: var(--ac-g800); }

/* ── Buttons ── */
.ac-btn { display: inline-block; padding: .6rem 1.3rem; background: var(--ac-black); color: #fff !important; border: 2px solid var(--ac-black); font-family: var(--ac-font); font-size: .9rem; cursor: pointer; text-decoration: none; letter-spacing: .03em; transition: .15s; border-radius: 0; }
.ac-btn:hover { background: #333; }
.ac-btn--sm { padding: .35rem .8rem; font-size: .82rem; }
.ac-btn--secondary { background: transparent; color: var(--ac-black) !important; }
.ac-btn--secondary:hover { background: var(--ac-g50); }
.ac-btn--success { background: var(--ac-green); border-color: var(--ac-green); }
.ac-btn--danger  { background: transparent; color: var(--ac-red) !important; border-color: var(--ac-red); }
.ac-btn--danger:hover { background: var(--ac-red); color: #fff !important; }
.ac-link-btn { background: none; border: none; color: var(--ac-blue); cursor: pointer; font-size: .82rem; text-decoration: none; font-family: var(--ac-font); }
.ac-link-btn:hover { text-decoration: underline; }

/* ── Misc ── */
.ac-notice { padding: .7rem 1rem; border-radius: 2px; font-size: .88rem; margin-bottom: 1rem; }
.ac-notice--info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.ac-notice a { color: #1e40af; }
.ac-empty { text-align: center; padding: 3rem 1rem; color: var(--ac-g600); background: var(--ac-g50); border: 1px dashed var(--ac-g200); border-radius: 2px; }
.ac-login-wall { text-align: center; padding: 2.5rem; background: var(--ac-g50); border: 1px solid var(--ac-g200); }
.ac-meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; background: var(--ac-g50); padding: .85rem; border-radius: 2px; margin-bottom: .75rem; }
.ac-meta-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ac-g400); margin-bottom: .15rem; font-weight: 700; }

@media (max-width: 700px) {
    .ac-chat-layout { grid-template-columns: 1fr; }
    .ac-conv-list { border-right: none; border-bottom: 1px solid var(--ac-g200); max-height: 200px; }
    .ac-form-cols { grid-template-columns: 1fr; }
    .ac-home-grid { grid-template-columns: 1fr; }
    .ac-mini-stats { grid-template-columns: 1fr; }
    .ac-meta-grid  { grid-template-columns: 1fr 1fr; }
    .ac-notif-panel { width: calc(100vw - 2rem); right: 0; }
}
