:root { 
    --bg: #1a2438; 
    --card: #243147; 
    --acc: #6a9eff; 
    --ok: #4cd97b; 
    --err: #ff7b7b; 
    --muted: #94a3b8;
    --primary: #6a9eff;
    --primary-light: rgba(106, 158, 255, 0.15);
    --primary-dark: #5a8eff;
    --secondary: #ffb74d;
    --text: #e2e8f0;
    --light: #2d3748;
    --danger: #ff7b7b;
    --success: #4cd97b;
    --warning: #ffd166;
    --info: #6bcff7;
    --background: #1e293b;
    --border: #374151;
    --shadow: rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(135deg, #1e293b 0%, #1a2438 50%, #1f2d4a 100%);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #243147, #2d3b54);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 8px 32px var(--shadow);
    padding: 25px 0;
    text-align: center;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

h1 {
    font-size: 28px;
    margin: 0 0 8px;
    color: var(--text);
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
    color: var(--muted);
    margin: 0 0 20px;
}

.app-container {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-top: 30px;
}

.form-section, .appointments-section, .clients-section {
    flex: 1;
    min-width: 300px;  
    background: linear-gradient(135deg, #243147, #2a3850);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 8px 32px var(--shadow);
    padding: 25px;
    backdrop-filter: blur(10px);
}

.section-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--text);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 12px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 14px;
    margin: 12px 0 8px;
    color: #cbd5e0;
    font-weight: 600;
}

input, select, textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--light);
    color: var(--text);
    outline: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: #374151;
}

input::placeholder {
    color: #6b7280;
}

/* Stiluri pentru selectorul de oră compact */
#appointmentTime {
    height: 48px;
    padding: 12px 16px;
    font-size: 1rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
    padding-right: 40px;
    cursor: pointer;
}

#appointmentTime option {
    padding: 8px 12px;
    font-size: 0.9rem;
    background: #2d3748;
    color: var(--text);
}

.time-input-wrapper {
    position: relative;
}

.time-input-wrapper::after {
    content: "🕒";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--muted);
    font-size: 1.1rem;
}

.time-format-hint {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 6px;
    font-style: italic;
}

.btn {
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--light);
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #ff6b6b);
    border-color: var(--danger);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #ffb347);
    border-color: var(--warning);
    color: #1a202c;
}

.btn-info {
    background: linear-gradient(135deg, var(--info), #4fc3f7);
    border-color: var(--info);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #3ac769);
    border-color: var(--success);
    color: white;
}

.btn:hover {
    opacity: 0.95;
}

.btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.search-container {
    margin-bottom: 20px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 45px 14px 16px;
    border-radius: 12px;
}

.clear-search {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 18px;
    display: none;
    transition: color 0.3s ease;
}

.clear-search:hover {
    color: var(--danger);
}

.status-filter {
    margin-bottom: 15px;
}

.status-filter select {
    width: auto;
    min-width: 160px;
}

.appointment-list {
    max-height: 500px;
    overflow-y: auto;
}

.appointment-item {
    background: linear-gradient(135deg, #243147, #2a3850);
    border-left: 4px solid var(--primary);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.appointment-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    border-left-color: var(--primary-dark);
}

.appointment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.appointment-time {
    font-weight: bold;
    color: var(--text);
    font-size: 1.1rem;
}

.appointment-client {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.appointment-phone {
    color: var(--muted);
    margin-bottom: 6px;
}

.appointment-service {
    color: var(--secondary);
    font-weight: 500;
}

.appointment-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.alert {
    display: none;
    padding: 16px 20px;
    border-radius: 12px;
    margin-top: 16px;
    font-size: 14px;
    text-align: center;
    border: 1px solid transparent;
}

.alert.error {
    background: rgba(255, 123, 123, 0.1);
    color: var(--danger);
    border-color: rgba(255, 123, 123, 0.3);
}

.alert.success {
    background: rgba(76, 217, 123, 0.1);
    color: var(--success);
    border-color: rgba(76, 217, 123, 0.3);
}

.alert.info {
    background: rgba(106, 158, 255, 0.1);
    color: var(--primary);
    border-color: rgba(106, 158, 255, 0.3);
}

.alert-warning {
    background: rgba(255, 209, 102, 0.1);
    color: var(--warning);
    border-color: rgba(255, 209, 102, 0.3);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--muted);
    opacity: 0.7;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-active {
    background-color: var(--success);
}

.status-cancelled {
    background-color: var(--danger);
}

.status-completed {
    background-color: var(--info);
}

.loading {
    text-align: center;
    padding: 30px;
    color: var(--muted);
}

.search-info {
    margin-bottom: 15px;
    color: var(--muted);
    font-size: 0.9rem;
}

.sep {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
    margin: 20px 0;
}

.hint {
    font-size: 13px;
    color: var(--muted);
    margin-top: 8px;
    line-height: 1.4;
}

.row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.code-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.status {
    margin-top: 16px;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--light);
}

.status.ok {
    color: var(--success);
    background: rgba(76, 217, 123, 0.1);
}

.status.err {
    color: var(--danger);
    background: rgba(255, 123, 123, 0.1);
}

.status.info {
    color: var(--muted);
    background: rgba(148, 163, 184, 0.1);
}

/* Media queries */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .appointment-actions {
        flex-direction: column;
    }
    
    .appointment-actions .btn {
        width: 100%;
    }
    
    #appointmentTime {
        height: 48px;
        font-size: 1rem;
    }
    
    .form-section, .appointments-section, .clients-section {
        padding: 20px;
    }
}

/* Stiluri pentru input time în browsere moderne */
input[type="time"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

input[type="time"]::-webkit-datetime-edit-ampm-field {
    display: none;
}

input[type="time"]::-moz-datetime-edit-ampm-field {
    display: none;
}

input[type="time"]::-ms-clear {
    display: none;
}

select::-ms-expand {
    display: none;
}

/* Stiluri pentru secțiunea clienți */
.client-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
    margin-bottom: 20px;
}

.client-item {
    background: linear-gradient(135deg, #243147, #2a3850);
    border-left: 4px solid var(--info);
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.client-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.client-info {
    flex: 1;
}

.client-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.client-phone {
    color: var(--muted);
    font-size: 0.9rem;
}

.client-actions {
    display: flex;
    gap: 8px;
}

.client-search-container {
    position: relative;
    margin-bottom: 15px;
}

.client-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2d3748;
    border: 1px solid var(--border);
    border-radius: 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.client-search-result {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.client-search-result:hover {
    background: var(--primary-light);
}

.client-search-result:last-child {
    border-bottom: none;
}

/* Stiluri pentru select-ul cu search */
.select-with-search {
    position: relative;
}

.select-search-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--light);
    color: var(--text);
    outline: none;
}

.select-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2d3748;
    border: 1px solid var(--border);
    border-radius: 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.select-search-result {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.select-search-result:hover {
    background: var(--primary-light);
}

.select-search-result:last-child {
    border-bottom: none;
}

/* Stiluri pentru secțiunea clienți expandabilă */
.clients-section.collapsed .client-list-container {
    max-height: 0;
    overflow: hidden;
}

.clients-section:not(.collapsed) .client-list-container {
    max-height: 400px;
    overflow-y: auto;
}

.client-list-container {
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.expand-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text);
    cursor: pointer;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 600;
}

.expand-toggle:hover {
    background: #374151;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.expand-toggle .toggle-icon {
    transition: transform 0.3s ease;
    font-size: 12px;
    color: var(--muted);
}

.clients-section.collapsed .expand-toggle .toggle-icon {
    transform: rotate(-90deg);
}

.client-count-badge {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 8px;
}

/* Scroll personalizat */
.client-list-container::-webkit-scrollbar,
.appointment-list::-webkit-scrollbar {
    width: 6px;
}

.client-list-container::-webkit-scrollbar-track,
.appointment-list::-webkit-scrollbar-track {
    background: var(--light);
    border-radius: 3px;
}

.client-list-container::-webkit-scrollbar-thumb,
.appointment-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.client-list-container::-webkit-scrollbar-thumb:hover,
.appointment-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Stiluri pentru login */
.wrap {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #1a2438 100%);
}

.card {
    width: 100%;
    max-width: 440px;
    background: linear-gradient(135deg, #243147, #2a3850);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    padding: 30px;
    backdrop-filter: blur(10px);
}

/* Stiluri pentru layout full-width */
.fullwidth-section,
.form-section,
.appointments-section,
.clients-section {
    width: 95vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 30px !important;
    box-sizing: border-box !important;
}

.container {
    max-width: 95vw !important;
    padding: 0 !important;
}

.app-container {
    flex-direction: column !important;
    gap: 0 !important;
}

.fullwidth-section,
.form-section,
.appointments-section,
.clients-section {
    min-height: 95vh !important;
    background: linear-gradient(135deg, #1a2438, #243147) !important;
}


button{padding:12px 14px;border-radius:12px;border:1px solid rgba(255,255,255,.12);background:#101a30;color:#fff;cursor:pointer;transition:transform .03s ease, opacity .2s}
button.primary{background:linear-gradient(180deg,#2f6bff,#1b4ae6);border-color:#2b59e5}
button:active{transform:translateY(1px)}
button[disabled]{opacity:.5;cursor:not-allowed}
.status{margin-top:14px;font-size:14px}
.status.ok{color:var(--ok)} .status.err{color:var(--err)} .status.info{color:var(--muted)}
.sep{height:1px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.12),transparent);margin:16px 0}
.code-row{display:grid;grid-template-columns:1fr auto;gap:10px}
.hint{font-size:12px;color:#9fb0d9;margin-top:6px}


  .alert {
    display: none;
    padding: 12px 16px;
    border-radius: 12px;
    margin-top: 14px;
    font-size: 14px;
    text-align: center;
  }
  .alert.error {
    background: rgba(255, 77, 79, .1);
    color: #ff4d4f;
    border: 1px solid rgba(255, 77, 79, .4);
  }
  .alert.success {
    background: rgba(29, 185, 84, .1);
    color: #1db954;
    border: 1px solid rgba(29, 185, 84, .4);
  }
  
/*  */

/* Cancel Box — stil personalizat */
:root{
  --cb-backdrop: rgba(10,10,12,0.45);
  --cb-bg: #ffffff;
  --cb-accent: #0ea5a4;      /* accent (teal) */
  --cb-danger: #ef4444;
  --cb-text: #0f172a;
  --cb-muted: #64748b;
  --cb-radius: 12px;
  --cb-shadow: 0 8px 30px rgba(11, 15, 30, 0.25);
  --cb-transition: 180ms cubic-bezier(.2,.9,.3,1);
  --cb-maxwidth: 520px;
}

/* backdrop (overlay) */
.cancel-backdrop {
  position: fixed;
  inset: 0;
  background: var(--cb-backdrop);
  display: none; /* toggle via .active */
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 20px;
}

/* show */
.cancel-backdrop.active { display: flex; }

/* modal card */
.cancel-modal {
  width: 100%;
  max-width: var(--cb-maxwidth);
  background: linear-gradient(180deg, var(--cb-bg), #fbfdfe);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  overflow: hidden;
  transform: translateY(12px) scale(.995);
  opacity: 0;
  transition: transform var(--cb-transition), opacity var(--cb-transition);
}

/* enter state when active */
.cancel-backdrop.active .cancel-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* header */
.cancel-modal__header{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 18px;
  border-bottom: 1px solid rgba(15,23,42,0.06);
  background: linear-gradient(90deg, rgba(14,165,164,0.05), transparent);
}
.cancel-modal__title{
  font-size: 18px;
  font-weight: 600;
  color: var(--cb-text);
  margin: 0;
}
.cancel-modal__subtitle{
  font-size: 13px;
  color: var(--cb-muted);
  margin-top: 2px;
}

/* body */
.cancel-modal__body{
  padding: 14px 18px 18px 18px;
}
.cancel-modal__label{
  font-size: 13px;
  color: var(--cb-muted);
  margin-bottom: 8px;
  display:block;
}
.cancel-modal textarea{
  width:100%;
  min-height: 100px;
  max-height: 260px;
  resize: vertical;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--cb-text);
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 10px;
  outline: none;
  transition: box-shadow var(--cb-transition), border-color var(--cb-transition);
  background: linear-gradient(180deg, #fff, #fbfdff);
}
.cancel-modal textarea::placeholder { color: #9aa6b2; }

/* focus */
.cancel-modal textarea:focus{
  box-shadow: 0 6px 20px rgba(14,165,164,0.12);
  border-color: var(--cb-accent);
}

/* small helper / error */
.cancel-help{
  margin-top:8px;
  font-size:12px;
  color:var(--cb-muted);
  display:flex;
  justify-content:space-between;
  gap:12px;
}
.cancel-error{
  color: var(--cb-danger);
  font-weight:600;
}

/* footer / actions */
.cancel-modal__actions{
  padding: 12px 16px 16px 16px;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
  border-top: 1px solid rgba(15,23,42,0.04);
  background: rgba(250,250,251,0.6);
}

/* buttons */
.btn {
  appearance: none;
  border: 0;
  padding: 10px 14px;
  font-weight:600;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms;
}
.btn:active { transform: translateY(1px) }

/* secondary (cancel) */
.btn--ghost {
  background: transparent;
  color: var(--cb-text);
  border: 1px solid rgba(15,23,42,0.06);
}

/* primary (confirm) */
.btn--primary {
  background: linear-gradient(90deg, var(--cb-accent), #06b6b4);
  color: white;
  box-shadow: 0 6px 18px rgba(6,182,180,0.18);
}

/* danger variant */
.btn--danger {
  background: linear-gradient(90deg, var(--cb-danger), #ef5d5d);
  color: white;
  box-shadow: 0 6px 18px rgba(239,68,68,0.14);
}

/* disabled */
.btn[disabled]{
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* responsive */
@media (max-width:420px){
  :root { --cb-radius: 10px; --cb-maxwidth: 420px; }
  .cancel-modal__header{ padding:12px; }
  .cancel-modal__actions{ padding: 10px; }
}
