:root {
    --bg: #f4f1ed;
    --panel: #ffffff;
    --ink: #2f2f2f;
    --muted: #756f69;
    --line: #e2d8cf;

    /* Paleta Caunter & Grant: pared / arena / marrón suave */
    --primary: #a8876d;
    --primary-dark: #8b6e59;
    --accent: #b28d70;
    --accent-soft: #f7efe8;

    --danger: #b42318;
    --success: #0f766e;
    --warning: #a16207;
    --shadow: 0 18px 40px rgba(97, 76, 60, .10);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--ink);
}
a { color: inherit; }

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background:
        radial-gradient(circle at top left, rgba(185,149,75,.22), transparent 32%),
        linear-gradient(135deg, #f7f5f1 0%, #ffffff 48%, #eef2f5 100%);
}

.login-hero {
    color: var(--ink);
    padding: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 42px;
}

.login-logo-panel {
    width: 100%;
    max-width: 520px;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(185,149,75,.28);
    border-radius: 28px;
    padding: 34px;
    box-shadow: 0 22px 60px rgba(16, 24, 40, .08);
}

.login-logo-panel img {
    width: 100%;
    display: block;
}

.login-hero-text {
    max-width: 680px;
}

.login-kicker {
    display: inline-flex;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .22em;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 14px;
}

.login-hero h1 {
    font-size: 44px;
    margin: 0 0 18px;
    letter-spacing: -.8px;
    color: var(--primary-dark);
}

.login-hero p {
    font-size: 18px;
    line-height: 1.6;
    color: var(--muted);
    max-width: 680px;
}

.login-card-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border: 1px solid rgba(185,149,75,.24);
    border-radius: 24px;
    padding: 34px;
    box-shadow: 0 22px 60px rgba(16, 24, 40, .10);
}

.login-card-logo {
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.login-card-logo img {
    width: 100%;
    max-width: 300px;
    display: block;
}

.login-card h2 {
    margin: 0 0 8px;
    color: var(--primary-dark);
}

.login-card p {
    margin: 0 0 26px;
    color: var(--muted);
}

.app-shell {
    display: block;
    min-height: 100vh;
}

.sidebar {
    background: #263342;
    color: #ffffff;
    padding: 24px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(185, 149, 75, .24);
}

.brand {
    display: block;
    margin-bottom: 32px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.brand-text {
    min-width: 0;
}

.brand strong {
    display: block;
    color: #ffffff;
    font-size: 21px;
    line-height: 1.15;
    letter-spacing: .01em;
}

.brand span {
    display: block;
    color: rgba(255,255,255,.64);
    font-size: 11px;
    margin-top: 7px;
    text-transform: uppercase;
    letter-spacing: .14em;
    line-height: 1.35;
}

.sidebar-role {
    display: inline-flex;
    margin-top: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(185,149,75,.14);
    color: #d7b98a;
    font-size: 12px;
    font-weight: 800;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.nav a {
    text-decoration: none;
    padding: 12px 13px;
    border-radius: 13px;
    color: rgba(255,255,255,.82);
    border: 1px solid transparent;
}

.nav a:hover {
    background: rgba(255,255,255,.08);
    color: #ffffff;
    border-color: rgba(255,255,255,.08);
}

.nav-section {
    margin: 22px 0 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: rgba(255,255,255,.44);
}

.sidebar-footer {
    margin-top: auto;
}

.user-card {
    border-top: 1px solid rgba(255,255,255,.12);
    padding-top: 18px;
    margin-top: 24px;
}

.user-card strong {
    color: #ffffff;
}

.user-card span {
    display: block;
    color: rgba(255,255,255,.54);
    font-size: 12px;
    margin-top: 4px;
}

.logout {
    display: inline-block;
    margin-top: 14px;
    color: #ffffff;
    opacity: .78;
    text-decoration: none;
}

.logout:hover {
    opacity: 1;
}

.main {
    min-width: 0;
    background:
        radial-gradient(circle at top right, rgba(185,149,75,.10), transparent 28%),
        #f4f6f8;
}

.topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    padding: 18px 34px;
    position: relative;
}

.topbar-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.cg-app-clock {
    position: absolute;
    right: 34px;
    top: 50%;
    transform: translateY(-50%);
    width: 150px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    z-index: 5;
    pointer-events: none;
}

.cg-app-clock strong,
.cg-app-clock small {
    display: block;
    color: #0f3d5e;
    font-size: 14px;
    line-height: 1.1;
    letter-spacing: .02em;
    white-space: nowrap;
    font-weight: 800;
    margin: 0;
}

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

.topbar-logo {
    width: 260px;
    height: 92px;
    min-width: 260px;
    background: #ffffff;
    border: 1px solid rgba(185,149,75,.24);
    border-radius: 16px;
    padding: 10px 14px;
    box-shadow: 0 10px 24px rgba(16, 24, 40, .04);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.topbar-logo img {
    max-width: 230px;
    max-height: 68px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.topbar-logo-dashboard {
    position: absolute;
    left: 34px;
    top: 50%;
    width: 310px;
    height: auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    transform: translateY(-50%);
    overflow: visible;
}

.topbar-logo-dashboard img {
    width: 310px;
    max-width: none;
    max-height: none;
    height: auto;
}

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

.topbar-title-dashboard {
    text-align: center;
}

.topbar-spacer {
    width: 190px;
    min-width: 190px;
    height: 1px;
}

.topbar h1 {
    margin: 0;
    font-size: 28px;
    color: #17202a;
    letter-spacing: -.03em;
}



.topbar-dashboard .topbar-inner {
    display: grid;
    grid-template-columns: 360px 1fr 360px;
    align-items: center;
    position: relative;
}

.content {
    padding: 32px 34px 42px;
}

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
    background: var(--panel);
    border: 1px solid #dbe2ea;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .04);
}

.card h3 {
    margin: 0 0 14px;
    color: var(--primary);
    letter-spacing: -.02em;
}

.metric {
    border-color: #dbe2ea;
}

.metric .number {
    font-size: 34px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 8px;
}

.metric span {
    color: var(--muted);
    font-size: 13px;
}

.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 700; margin-bottom: 7px; font-size: 14px; }
input, select, textarea {
    width: 100%;
    border: 1px solid #cfd8e3;
    border-radius: 12px;
    padding: 12px 13px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}
textarea { min-height: 125px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(15, 61, 94, .16);
    border-color: var(--primary);
}
.readonly-box {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 13px;
    background: #f8fafc;
    color: var(--muted);
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
}
.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #eef3f7;
    color: #152536;
}

.btn-secondary:hover {
    background: #e3ebf2;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-outline {
    border: 1px solid #dbe2ea;
    background: #ffffff;
    color: var(--ink);
}

.btn-outline:hover {
    border-color: rgba(185,149,75,.42);
    background: #fbf8f3;
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.table-wrap { overflow: auto; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { text-align: left; padding: 13px 15px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e8eef5; color: #26374a; }
.badge-success { background: #ccfbf1; color: #115e59; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.alert { padding: 14px 16px; border-radius: 14px; margin-bottom: 18px; border: 1px solid transparent; }
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.email-preview {
    white-space: pre-wrap;
    background: #fbfcfe;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    line-height: 1.6;
}
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.photo-grid img { width: 100%; height: 110px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }

.topbar-dashboard {
    position: relative;
    overflow: hidden;
}

.topbar-dashboard .topbar-inner {
    width: 100%;
    display: grid;
    grid-template-columns: 360px 1fr 360px;
    align-items: center;
    position: relative;
}

.topbar-logo-parts {
    width: 340px;
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: visible;
}

.cg-logo-building {
    width: 86px;
    height: auto;
    display: block;
    flex: 0 0 auto;
}

.cg-logo-texts {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.cg-logo-name {
    width: 218px;
    height: auto;
    display: block;
}

.cg-logo-subtitle {
    width: 232px;
    height: auto;
    display: block;
}

.topbar-title-dashboard {
    text-align: center;
}

.topbar-title-dashboard h1 {
    margin: 0;
    text-align: center;
}

.cg-rosa-widget {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9999;
}

.cg-rosa-widget-bubble {
    width: 66px;
    height: 66px;
    border-radius: 999px;
    border: 3px solid rgba(185, 149, 75, .35);
    background: #fff;
    padding: 3px;
    cursor: pointer;
    box-shadow: 0 14px 35px rgba(15, 61, 94, .18);
}

.cg-rosa-widget-bubble img {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}

.cg-rosa-widget-panel {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: 380px;
    max-width: calc(100vw - 28px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 22px 55px rgba(15, 61, 94, .22);
}

.cg-rosa-widget-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
}

.cg-rosa-widget-head img {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    object-fit: cover;
}

.cg-rosa-widget-head strong {
    display: block;
    color: #0f3d5e;
    font-size: 16px;
}

.cg-rosa-widget-head span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.cg-rosa-widget-close {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    font-weight: 900;
}

.cg-rosa-widget-quick {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px;
    border-bottom: 1px solid var(--line);
}

.cg-rosa-widget-quick button {
    border: 1px solid #d5e0ea;
    background: #fff;
    border-radius: 999px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    color: #0f3d5e;
}

.cg-rosa-widget-body {
    padding: 12px;
    max-height: 360px;
    overflow-y: auto;
    display: grid;
    gap: 10px;
}

.cg-rosa-widget-empty {
    border: 1px dashed var(--line);
    border-radius: 14px;
    padding: 14px;
    color: var(--muted);
    font-size: 13px;
    background: #fbfcfe;
}

.cg-rosa-widget-section-title {
    color: #0f3d5e;
    font-size: 14px;
    font-weight: 900;
    margin-top: 2px;
}

.cg-rosa-widget-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    background: #fbfcfe;
}

.cg-rosa-widget-card.danger {
    border-color: #fecaca;
    background: #fff7f7;
}

.cg-rosa-widget-card.warning {
    border-color: #fde68a;
    background: #fffdf3;
}

.cg-rosa-widget-card.ok {
    border-color: #bbf7d0;
    background: #f7fff9;
}

.cg-rosa-widget-card strong {
    display: block;
    color: #0f3d5e;
    margin-bottom: 5px;
}

.cg-rosa-widget-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.cg-rosa-widget-card a {
    display: inline-flex;
    margin-top: 10px;
    text-decoration: none;
    border: 1px solid #d5e0ea;
    border-radius: 999px;
    padding: 7px 10px;
    color: #0f3d5e;
    font-size: 12px;
    font-weight: 900;
    background: #fff;
}

.cg-rosa-widget-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.cg-rosa-widget-form input {
    min-height: 42px;
}

.cg-rosa-widget-form button {
    border: 0;
    border-radius: 12px;
    padding: 0 14px;
    background: #b28a6d;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.cg-rosa-widget {
    position: fixed !important;
    right: 18px !important;
    bottom: 18px !important;
    z-index: 99999 !important;
    width: auto !important;
    height: auto !important;
}

.cg-rosa-widget-bubble {
    width: 66px !important;
    height: 66px !important;
    min-width: 66px !important;
    min-height: 66px !important;
    max-width: 66px !important;
    max-height: 66px !important;
    border-radius: 999px !important;
    border: 3px solid rgba(185, 149, 75, .35) !important;
    background: #fff !important;
    padding: 3px !important;
    cursor: pointer !important;
    overflow: hidden !important;
    box-shadow: 0 14px 35px rgba(15, 61, 94, .18) !important;
}

.cg-rosa-widget-bubble img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 999px !important;
    object-fit: cover !important;
    display: block !important;
}

.cg-rosa-widget-panel {
    position: absolute !important;
    right: 0 !important;
    bottom: 78px !important;
    width: 380px !important;
    max-width: calc(100vw - 28px) !important;
    background: #fff !important;
    border: 1px solid var(--line) !important;
    border-radius: 22px !important;
    overflow: hidden !important;
    box-shadow: 0 22px 55px rgba(15, 61, 94, .22) !important;
}

.cg-rosa-widget-panel[hidden] {
    display: none !important;
}

.cg-rosa-chat-line {
    display: flex;
    width: 100%;
}

.cg-rosa-chat-line.user {
    justify-content: flex-end;
}

.cg-rosa-chat-line.rosa {
    justify-content: flex-start;
}

.cg-rosa-chat-bubble {
    max-width: 92%;
    border-radius: 18px;
    padding: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.cg-rosa-chat-line.user .cg-rosa-chat-bubble {
    background: #eef4ff;
    border: 1px solid #cfe0f5;
    color: #0f3d5e;
    font-weight: 800;
}

.cg-rosa-chat-line.rosa .cg-rosa-chat-bubble {
    background: #ffffff;
    border: 1px solid var(--line);
    color: var(--ink);
}

.cg-rosa-chat-line.rosa .cg-rosa-widget-card {
    margin-top: 8px;
}

.cg-disabled-action {
    opacity: .45 !important;
    filter: grayscale(1) !important;
    cursor: not-allowed !important;
    user-select: none !important;
}

.cg-guard-disabled-box {
    opacity: .72;
    filter: grayscale(.35);
}
