/* ============================================================
   CALMTOOTH APPOINTMENT MANAGER v4.0
   ============================================================ */

:root {
    --ct-primary: #088C93;
    --ct-dark:    #00505D;
    --ct-light:   #f0fdfc;
    --ct-border:  #e4f0f1;
    --ct-text:    #334;
    --ct-muted:   #778;
    --ct-radius:  12px;
    --ct-font:    'Segoe UI Variable','Segoe UI',system-ui,sans-serif;
}

.ct-form-wrap,
.ct-booking-wrap {
    font-family: var(--ct-font);
    max-width: 700px;
    margin: 0 auto;
    color: var(--ct-text);
}

/* ---- Fields ---- */
.ct-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.ct-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}
.ct-field-group label { font-size: 13px; font-weight: 600; color: var(--ct-dark); }
.ct-field-group input,
.ct-field-group textarea,
.ct-field-group select {
    border: 1.5px solid var(--ct-border);
    border-radius: var(--ct-radius);
    padding: 12px 16px;
    font-size: 15px;
    font-family: var(--ct-font);
    color: var(--ct-text);
    background: #fff;
    transition: border-color 0.2s;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}
.ct-field-group input:focus,
.ct-field-group textarea:focus { border-color: var(--ct-primary); }
.ct-req     { color: var(--ct-primary); }
.ct-optional { color: var(--ct-muted); font-weight: 400; font-size: 11px; }

/* ---- Buttons ---- */
.ct-submit-btn {
    background: var(--ct-primary);
    color: #fff;
    border: none;
    border-radius: 100px;
    padding: 14px 36px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--ct-font);
    cursor: pointer;
    transition: background 0.2s;
}
.ct-submit-btn:hover { background: var(--ct-dark); }
.ct-submit-btn:disabled { background: #ccc; cursor: not-allowed; }

.ct-next-btn {
    background: var(--ct-primary);
    color: #fff;
    border: none;
    border-radius: 100px;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--ct-font);
    cursor: pointer;
    transition: background 0.2s;
}
.ct-next-btn:disabled { background: #ccc; cursor: not-allowed; }
.ct-next-btn:not(:disabled):hover { background: var(--ct-dark); }

.ct-back-btn {
    background: transparent;
    color: var(--ct-muted);
    border: 1.5px solid var(--ct-border);
    border-radius: 100px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--ct-font);
    cursor: pointer;
    transition: all 0.2s;
}
.ct-back-btn:hover { border-color: var(--ct-dark); color: var(--ct-dark); }

.ct-step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--ct-border);
}

/* ---- Errors / success ---- */
.ct-form-error {
    background: #fff0f0;
    border: 1px solid #ffcccc;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: #c00;
    margin-bottom: 16px;
}
.ct-form-success,
.ct-booking-success {
    text-align: center;
    padding: 60px 40px;
}
.ct-success-icon {
    width: 64px;
    height: 64px;
    background: var(--ct-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.ct-booking-success h3 { font-size: 24px; color: var(--ct-dark); margin: 0 0 12px; }
.ct-booking-success p  { font-size: 15px; color: var(--ct-muted); line-height: 1.7; }
.ct-success-sub        { font-size: 13px !important; margin-bottom: 24px; }

/* ---- Steps ---- */
.ct-steps { display: flex; align-items: center; margin-bottom: 36px; }
.ct-step  { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.ct-step-num {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--ct-border); color: var(--ct-muted);
    font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
}
.ct-step.active .ct-step-num,
.ct-step.done   .ct-step-num { background: var(--ct-primary); color: #fff; }
.ct-step-label  { font-size: 11px; color: var(--ct-muted); font-weight: 500; white-space: nowrap; }
.ct-step.active .ct-step-label { color: var(--ct-dark); font-weight: 600; }
.ct-step-line   { flex: 1; height: 2px; background: var(--ct-border); margin: 0 4px 18px; }
.ct-step-title  { font-size: 20px; font-weight: 700; color: var(--ct-dark); margin: 0 0 6px; }
.ct-step-hint   { font-size: 13px; color: var(--ct-muted); margin: 0 0 20px; }

/* ---- Service list ---- */
.ct-svc-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.ct-svc-row {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 18px;
    border: 1.5px solid var(--ct-border); border-radius: 10px;
    cursor: pointer; background: #fff;
    transition: border-color 0.2s, background 0.2s;
    user-select: none;
}
.ct-svc-row:hover   { border-color: var(--ct-primary); background: var(--ct-light); }
.ct-svc-row.selected { border-color: var(--ct-primary); background: var(--ct-light); }
.ct-svc-row-check {
    width: 24px; height: 24px; border-radius: 50%;
    border: 1.5px solid #ccc; background: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all 0.2s;
}
.ct-svc-row-check svg { width: 12px; height: 12px; fill: transparent; transition: fill 0.2s; }
.ct-svc-row.selected .ct-svc-row-check { background: var(--ct-primary); border-color: var(--ct-primary); }
.ct-svc-row.selected .ct-svc-row-check svg { fill: #fff; }
.ct-svc-row-info { display: flex; align-items: center; justify-content: space-between; flex: 1; }
.ct-svc-row-name { font-size: 14px; font-weight: 600; color: var(--ct-dark); transition: color 0.2s; }
.ct-svc-row.selected .ct-svc-row-name { color: var(--ct-primary); }
.ct-svc-row-dur { font-size: 12px; color: var(--ct-muted); background: var(--ct-border); padding: 2px 10px; border-radius: 100px; }

/* Selected tags */
.ct-selected-tags { display: flex; flex-wrap: wrap; gap: 8px; min-height: 16px; margin-bottom: 4px; }
.ct-selected-tag {
    background: var(--ct-primary); color: #fff;
    font-size: 12px; font-weight: 600;
    padding: 5px 12px; border-radius: 100px;
    display: flex; align-items: center; gap: 6px;
}
.ct-tag-remove { cursor: pointer; opacity: 0.7; font-size: 15px; line-height: 1; border: none; background: none; color: #fff; padding: 0; }
.ct-tag-remove:hover { opacity: 1; }

/* ---- Calendar ---- */
.ct-calendar-wrap { background: #fff; border: 1.5px solid var(--ct-border); border-radius: var(--ct-radius); overflow: hidden; max-width: 420px; }
.ct-cal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--ct-dark); color: #fff; }
.ct-cal-title  { font-size: 15px; font-weight: 600; }
.ct-cal-nav { background: rgba(255,255,255,0.15); border: none; color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.ct-cal-nav:hover { background: rgba(255,255,255,0.25); }
.ct-cal-weekdays { display: grid; grid-template-columns: repeat(7,1fr); background: var(--ct-light); }
.ct-cal-weekdays > div { text-align: center; padding: 10px 0; font-size: 12px; font-weight: 600; color: var(--ct-muted); }
.ct-cal-days { display: grid; grid-template-columns: repeat(7,1fr); padding: 8px; gap: 4px; }
.ct-cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 14px; cursor: pointer; border: 1.5px solid transparent; transition: all 0.15s; }
.ct-cal-day:hover:not(.disabled):not(.empty) { background: var(--ct-light); border-color: var(--ct-primary); }
.ct-cal-day.selected { background: var(--ct-primary); color: #fff; }
.ct-cal-day.today    { font-weight: 700; color: var(--ct-primary); }
.ct-cal-day.disabled { color: #ddd; cursor: not-allowed; }
.ct-cal-day.empty    { cursor: default; }

/* ---- Time slots ---- */
.ct-time-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.ct-time-slot { padding: 14px; border: 1.5px solid var(--ct-border); border-radius: 10px; text-align: center; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; background: #fff; color: var(--ct-dark); }
.ct-time-slot:hover    { border-color: var(--ct-primary); background: var(--ct-light); }
.ct-time-slot.selected { background: var(--ct-primary); color: #fff; border-color: var(--ct-primary); }

/* ---- Confirm card ---- */
.ct-confirm-card { background: var(--ct-light); border-radius: var(--ct-radius); border: 1px solid var(--ct-border); overflow: hidden; margin-bottom: 20px; }
.ct-confirm-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 13px 22px; border-bottom: 1px solid var(--ct-border); gap: 16px; }
.ct-confirm-row:last-child { border-bottom: none; }
.ct-confirm-row span   { font-size: 13px; color: var(--ct-muted); white-space: nowrap; }
.ct-confirm-row strong { font-size: 14px; color: var(--ct-dark); text-align: right; }

/* ---- Payment box ---- */
.ct-payment-box {
    background: #fff;
    border: 2px solid var(--ct-primary);
    border-radius: 14px;
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 20px;
}
.ct-payment-box-left { display: flex; flex-direction: column; gap: 6px; }
.ct-payment-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ct-primary);
}
.ct-payment-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--ct-dark);
    line-height: 1;
}
.ct-payment-note {
    font-size: 12px;
    color: var(--ct-muted);
    line-height: 1.5;
    max-width: 340px;
}
.ct-payment-box-right { flex-shrink: 0; }
.ct-payment-box-right img { display: block; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .ct-form-row    { grid-template-columns: 1fr; }
    .ct-time-grid   { grid-template-columns: repeat(2,1fr); }
    .ct-step-label  { display: none; }
    .ct-svc-row-dur { display: none; }
    .ct-payment-box { flex-direction: column; align-items: flex-start; }
    .ct-payment-amount { font-size: 28px; }
}

/* ============================================================
   ADMIN
   ============================================================ */
.ct-admin-wrap { max-width: 1200px; font-family: var(--ct-font); }
.ct-admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; padding-bottom: 16px; border-bottom: 1px solid #e0eaeb; }
.ct-admin-header h1 { font-size: 22px; font-weight: 700; color: #00505D; margin: 0; }
.ct-filter-bar  { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.ct-filter-btn  { padding: 6px 16px; border-radius: 100px; font-size: 13px; font-weight: 500; text-decoration: none; background: #f0f5f5; color: #667; transition: all 0.2s; }
.ct-filter-btn.active,.ct-filter-btn:hover { background: #088C93; color: #fff; }
.ct-admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.ct-admin-table th { background: #00505D; color: #fff; padding: 14px 16px; font-size: 12px; font-weight: 600; text-align: left; letter-spacing: 0.04em; text-transform: uppercase; }
.ct-admin-table td { padding: 14px 16px; border-bottom: 1px solid #f0f5f5; font-size: 14px; vertical-align: middle; }
.ct-admin-table tr:last-child td { border-bottom: none; }
.ct-admin-table tr:hover td { background: #f8fffe; }
.ct-muted { color: #999; font-size: 12px; }
.ct-status { display: inline-block; padding: 4px 12px; border-radius: 100px; font-size: 12px; font-weight: 600; }
.ct-status-pending   { background: #fff8e1; color: #b8860b; }
.ct-status-confirmed { background: #e1f5ee; color: #0a6e3f; }
.ct-status-completed { background: #e8f4fd; color: #0a4a8a; }
.ct-status-cancelled { background: #fdecea; color: #c62828; }
.ct-btn { padding: 9px 20px; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 6px; }
.ct-btn-primary { background: #088C93; color: #fff; }
.ct-btn-primary:hover { background: #00505D; color: #fff; }
.ct-btn-outline { border: 1.5px solid #088C93; color: #088C93; background: transparent; }
.ct-btn-outline:hover { background: #088C93; color: #fff; }
.ct-btn-delete { background: #fdecea; color: #c62828; border: none; padding: 6px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; font-weight: 600; }
.ct-btn-delete:hover { background: #c62828; color: #fff; }
.ct-select-sm { padding: 5px 8px; border-radius: 6px; border: 1px solid #e0eaeb; font-size: 13px; margin-right: 8px; }
.ct-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.ct-settings-card { background: #fff; border: 1px solid #e0eaeb; border-radius: 12px; padding: 24px; }
.ct-settings-card-full { grid-column: 1 / -1; }
.ct-settings-card h3 { font-size: 15px; font-weight: 700; color: #00505D; margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1px solid #f0f5f5; }
.ct-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.ct-field label { font-size: 13px; font-weight: 600; color: #445; }
.ct-field input,.ct-field textarea,.ct-field select { border: 1.5px solid #e0eaeb; border-radius: 8px; padding: 10px 14px; font-size: 14px; font-family: var(--ct-font); width: 100%; box-sizing: border-box; outline: none; transition: border-color 0.2s; }
.ct-field input:focus,.ct-field textarea:focus { border-color: #088C93; }
.ct-field input[type="color"] { padding: 4px; height: 44px; cursor: pointer; }
.ct-settings-footer { padding-top: 20px; border-top: 1px solid #e0eaeb; }
.ct-empty-state { text-align: center; padding: 60px; background: #fff; border-radius: 12px; border: 1px solid #e0eaeb; color: #999; }
