/* Perfect Smile - gateway programari.
   Paleta monocroma negru/alb/gri, accent rosu pe un singur cuvant. */

:root {
    --ink:    #111111;
    --ink-2:  #4a4a4a;
    --ink-3:  #8a8a8a;
    --line:   #e4e4e4;
    --paper:  #ffffff;
    --wash:   #f6f6f6;
    --accent: #c8102e;
    --ok:     #1f7a44;
    --bad:    #b3261e;
    --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--wash);
    color: var(--ink);
    font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 560px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

/* ---------------------------------------------------------------- antet */

.brand { text-align: center; margin-bottom: 28px; color: var(--ink); }

.brand-name {
    display: block;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.brand .accent { color: var(--accent); }

.waves {
    display: block;
    width: 110px;
    height: 10px;
    margin: 8px auto 0;
    color: var(--ink-3);
    opacity: 0.55;
}

/* ----------------------------------------------------------------- card */

.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px 26px;
    text-align: center;
}

.kicker {
    margin: 0 0 18px;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.when { margin: 0 0 26px; }

.when .day {
    display: block;
    font-size: 19px;
    font-weight: 500;
    color: var(--ink-2);
}

.when .hour {
    display: block;
    font-size: 56px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-top: 4px;
}

.details {
    margin: 0 0 28px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.details > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 5px 0;
}

.details dt { color: var(--ink-3); font-size: 14px; }
.details dd { margin: 0; font-weight: 500; text-align: right; }

.btn {
    display: block;
    width: 100%;
    padding: 17px 20px;
    border: 0;
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}

.btn:hover  { background: #000; }
.btn:active { transform: translateY(1px); }

.note {
    margin: 20px 0 0;
    font-size: 14px;
    color: var(--ink-2);
}

.note a, .foot a { color: var(--ink); }

/* ------------------------------------------------------------ confirmare */

.mark {
    width: 62px; height: 62px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--wash);
    color: var(--ok);
    display: grid;
    place-items: center;
}

.mark svg { width: 40px; height: 40px; }

.title { margin: 0 0 10px; font-size: 26px; font-weight: 600; }
.lead  { margin: 0; color: var(--ink-2); }

.recap {
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 15px;
    color: var(--ink-2);
}

.foot {
    margin-top: 26px;
    text-align: center;
    font-size: 13px;
    color: var(--ink-3);
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* ---------------------------------------------------------------- admin */

body:has(.admin) .wrap { max-width: 1180px; }

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.tabs a {
    padding: 10px 16px;
    text-decoration: none;
    color: var(--ink-3);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }

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

.stat {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 12px;
    text-align: center;
}

.stat.bad { border-color: #f0c8c5; }
.stat .n  { display: block; font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat.bad .n { color: var(--bad); }
.stat .l  { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-top: 3px; }

.meta { font-size: 13px; color: var(--ink-2); margin: 0 0 22px; }
.meta code { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 12px; }

.badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
}

.alert {
    background: #fff6f5;
    border: 1px solid #f0c8c5;
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    margin: 0 0 18px;
}

.admin h2 { font-size: 15px; font-weight: 600; margin: 28px 0 10px; letter-spacing: .01em; }

.tablewrap {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-3);
    font-weight: 600;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

td { padding: 10px 12px; border-bottom: 1px solid #f2f2f2; vertical-align: top; }
tr:last-child td { border-bottom: 0; }

.nowrap { white-space: nowrap; }
.empty  { text-align: center; color: var(--ink-3); padding: 26px 12px; }
.body   { min-width: 300px; }

.seg { display: block; font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.why { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

.st {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.st-ok   { background: #e8f4ed; color: var(--ok); }
.st-sent { background: #eaeef5; color: #2c4a7c; }
.st-wait { background: var(--wash); color: var(--ink-3); }
.st-bad  { background: #fdeceb; color: var(--bad); }
.st-skip { background: var(--wash); color: var(--ink-3); }

.inline { display: inline; }

.mini {
    border: 1px solid var(--line);
    background: var(--paper);
    border-radius: 6px;
    padding: 4px 9px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}

.mini:hover { border-color: var(--ink-3); }

.logs .lvl-error td { background: #fffafa; }
.logs .lvl-warn  td { background: #fffdf5; }

.tplform {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 22px;
}

.tplform label { display: block; margin-bottom: 22px; }
.tplform .lbl  { display: block; font-weight: 600; font-size: 14px; text-transform: capitalize; }
.tplform .hint { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 7px; }

.tplform textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: 13.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    resize: vertical;
}

.tplform textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
.tplform .btn { width: auto; padding: 12px 26px; font-size: 15px; }

@media (max-width: 640px) {
    .wrap { padding: 24px 14px 36px; }
    .card { padding: 26px 18px; }
    .when .hour { font-size: 46px; }
}

/* ------------------------------------------------- consola receptiei */

body:has(.receptie) .wrap { max-width: 780px; }

.progressbar {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 14px;
}

.pbtext  { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.pbtext strong { font-size: 20px; color: var(--ink); }

.pbtrack {
    flex: 1;
    height: 7px;
    border-radius: 4px;
    background: var(--wash);
    overflow: hidden;
}

.pbfill {
    height: 100%;
    width: 0;
    background: #25d366;
    transition: width .25s ease;
}

.tip {
    font-size: 13px;
    color: var(--ink-2);
    margin: 0 0 18px;
    line-height: 1.6;
}

kbd {
    background: var(--paper);
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: 1px 6px;
    font: 600 11.5px ui-monospace, Menlo, Consolas, monospace;
}

.queue { list-style: none; margin: 0; padding: 0; }

.qcard {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 10px;
    transition: opacity .2s ease, border-color .2s ease;
}

.qcard.active {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, .07);
}

.qcard.gata { opacity: .42; }
.qcard.gata .qactions { display: none; }
.qcard.gata.ok    { border-left: 3px solid #25d366; }
.qcard.gata.sarit { border-left: 3px solid var(--ink-3); }

.qhead { margin-bottom: 10px; }

.qname { font-size: 17px; font-weight: 600; margin-right: 8px; }

.qkind {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: var(--wash);
    color: var(--ink-2);
    vertical-align: 2px;
}

.k-confirm    { background: #eaeef5; color: #2c4a7c; }
.k-reminder   { background: #fdf3e6; color: #8a5a12; }
.k-reschedule { background: #fdeceb; color: var(--bad); }

.qmeta { font-size: 13px; color: var(--ink-3); margin-top: 4px; }

.qbody { margin-bottom: 12px; }

.qbody summary {
    cursor: pointer;
    font-size: 12.5px;
    color: var(--ink-3);
    user-select: none;
}

.qbody pre {
    margin: 9px 0 0;
    padding: 12px 14px;
    background: var(--wash);
    border-radius: 8px;
    font: 13px/1.55 -apple-system, "Segoe UI", Roboto, sans-serif;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--ink-2);
}

.qactions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.wa-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 20px;
    border: 0;
    border-radius: 9px;
    background: #25d366;
    color: #06301a;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease;
}

.wa-btn:hover  { background: #1eb95a; }
.wa-btn:active { transform: translateY(1px); }

.done-all {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 44px 26px;
    text-align: center;
}

.chan {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: none;
    vertical-align: 1px;
}

.c-wa  { background: #e6f9ee; color: #127a3f; }
.c-sms { background: var(--wash); color: var(--ink-3); }

@media (max-width: 640px) {
    .progressbar { flex-wrap: wrap; }
    .pbtrack { order: 3; flex-basis: 100%; }
    .wa-btn { width: 100%; justify-content: center; }
}

/* comutator aplicatie / web, retinut per calculator */

.tiprow {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.tiprow .tip { margin: 0; flex: 1; }

.targetpick {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 5px;
}

.tplabel {
    font-size: 12px;
    color: var(--ink-3);
    padding: 0 6px 0 4px;
    white-space: nowrap;
}

.targetpick button {
    border: 0;
    background: transparent;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-3);
    cursor: pointer;
    white-space: nowrap;
}

.targetpick button:hover { color: var(--ink); }
.targetpick button.on    { background: var(--ink); color: #fff; }

@media (max-width: 760px) {
    .tiprow { flex-direction: column; gap: 12px; }
    .targetpick { align-self: stretch; justify-content: center; }
}

/* butoane mari pentru pacienti in varsta */

.doit {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 600;
    color: var(--ink-2);
}

.btn-xl {
    padding: 26px 20px;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: .02em;
    border-radius: 12px;
}

.qconfirm { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }

.mini.conf {
    font-size: 12.5px;
    padding: 7px 12px;
    color: var(--ink-2);
}

.mini.conf:hover   { border-color: var(--ok); color: var(--ok); }
.mini.conf.done    { background: #e8f4ed; border-color: #bfe0cd; color: var(--ok); font-weight: 600; }
.mini.conf:disabled { cursor: default; }

.qcard.gata .qconfirm { display: block; }

/* autoconfirmare: starea de asteptare si cea de reusita */

.autobox {
    padding: 10px 0 4px;
    min-height: 132px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.autotext {
    margin: 14px 0 0;
    font-size: 16px;
    color: var(--ink-2);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--line);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.autobox .mark { margin-bottom: 6px; }

.bigok {
    margin: 4px 0 0;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: .06em;
    color: var(--ok);
}

@media (prefers-reduced-motion: reduce) {
    .spinner { animation-duration: 2.4s; }
}

/* banner pentru programari aparute cat timp fereastra era deschisa */

.newbanner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #f0fbf4;
    border: 1px solid #bfe0cd;
    border-left: 3px solid #25d366;
    border-radius: 9px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #106b38;
}

.newbanner button {
    border: 0;
    background: #25d366;
    color: #06301a;
    border-radius: 7px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

/* formularul de intrare */

.loginform { text-align: left; }

.loginform label { display: block; margin-bottom: 16px; }

.loginform label span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 6px;
}

.loginform input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 16px;
}

.loginform input:focus {
    outline: 2px solid var(--ink);
    outline-offset: -1px;
    border-color: var(--ink);
}

.loginform .note { text-align: center; }
