@charset "UTF-8";

:root {
    --rot: #E43A3A;
    --rot-light: #f3bdbd;
    --rot-mid: #e56060;

    --orange:      #e87722;
    --orange-light:#fef3ea;
    --orange-mid:  #f5a96a;
    --dill-green:  #51a438;
    --bg:          #f0f1f2;
    --white:       #ffffff;
    --border:      #d8dadc;
    --border-mid:  #c4c7ca;
    --text:        #2c2f33;
    --muted:       #575e62;
    --muted-light: #b0b6bd;
    --sidebar-bg:  #e8eaec;
    --header-bg:   #ffffff;
    --row-hover:   #fafbfb;
    --radius-sm:   6px;
    --radius:      4px;
    --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
    --shadow:      0 2px 8px rgba(0,0,0,.10);
    --shadow-lg:   0 4px 20px rgba(0,0,0,.12);
    --transition:  150ms ease;
}

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

/* ─── Login Page ─── */

body.login { display: flex; align-items: center; justify-content: center; height: 100vh; background: #f0f2f5; margin: 0; font-family: 'Inter', sans-serif; }
.login-card { 
    background: white; 
    padding: 40px; 
    border-radius: 12px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
    width: 100%; 
    max-width: 360px; 
}
.login-card input {
    min-height: 40px;
    width: 100%;
    padding: 8px;
    font-weight: 500;
}
.login-card label {
    color: var(--muted);
}
.login-card img { 
    display: block; 
    margin: 0 auto;
}
.login-card h1 {
    margin-bottom: 24px;
    font-size: 24px;
    display: block;
    text-align: center;
}
.login-card h2 { 
    text-align: center; 
    margin-bottom: 18px; 
    font-weight: 600; 
}
.error { 
    color: #e05555; 
    background: #fee; 
    padding: 10px; 
    border-radius: 6px; 
    margin-bottom: 16px; 
    font-size: 13px; 
    text-align: center; 
    display: none; 
}
.notice {
    color: #3d7b45;
    background: #eef8f0;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    text-align: center;
    display: none;
}
.btn-login { 
    width: 100%; 
    background: var(--rot); 
    color: white; 
    border: none; 
    padding: 12px; 
    border-radius: 6px; 
    font-weight: 600; 
    cursor: pointer; 
}


#logout-box {
    margin-bottom: 1rem;
    font-style: italic;
    text-align: center;
}

/* ─────────────── */

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 13.5px;
    min-height: 100vh;
    line-height: 1.5;
}

/* ─── Header ─── */
header {
    background: var(--header-bg);
    border-bottom: 2px solid var(--rot);
    display: flex;
    align-items: center;
    gap: 0;
    height: 72px;
    padding: 0 28px 0 13px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 28px;
    border-right: 1px solid var(--border);
    margin-right: 24px;
    margin-left: 8px;
}


.header-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--muted);
}

.user-avatar {
    width: 30px;
    height: 30px;
    background: var(--orange-light);
    border: 1.5px solid var(--rot-mid);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--rot);
}

.date-chip {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
}

/* ─── Layout ─── */
.shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 64px);
    align-items: start;
}

/* ─── Sidebar ─── */
aside {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    min-height: calc(100vh - 64px);
    padding: 24px 0;
}

.sidebar-section {
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.section-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--rot);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--rot);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ─── Form fields ─── */
.field {
    margin-bottom: 12px;
}

label {
    display: block;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 5px;
    letter-spacing: .02em;
}

input[data-type="date"],
input[data-type="time"],
select {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    padding: 8px 11px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

input[data-type="date"]:hover,
input[data-type="time"]:hover,
select:hover {
    border-color: var(--rot-mid);
}

input[data-type="date"]:focus,
input[data-type="time"]:focus,
select:focus {
    border-color: var(--rot);
    box-shadow: 0 0 0 3px rgba(232,119,34,.15);
}

.select-wrap {
    position: relative;
}
.select-wrap::after {
    content: '';
    pointer-events: none;
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--muted-light);
}

/* Custom Multi-Select Dropdown Styling */
.dropdown-multiselect {
    position: relative;
    width: 100%;
}

.multiselect-trigger {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    padding: 8px 11px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
    user-select: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    max-width: 680px;
}

.multiselect-trigger:hover {
    border-color: var(--rot-mid);
}

.dropdown-multiselect.open .multiselect-trigger {
    border-color: var(--rot);
    box-shadow: 0 0 0 3px rgba(232,119,34,.15);
}

.multiselect-trigger .selected-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 10px;
    color: var(--text);
}

.multiselect-trigger .placeholder {
    color: var(--muted-light);
}

.multiselect-trigger .arrow {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--muted-light);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.dropdown-multiselect.open .multiselect-trigger .arrow {
    transform: rotate(180deg);
}

.multiselect-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-mid);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow);
    padding: 4px;
}

.dropdown-multiselect.open .multiselect-content {
    display: block;
}

.multiselect-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
}

.multiselect-item:hover {
    background: var(--orange-light);
}

.multiselect-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--orange);
}

/* ─── Buttons ─── */
.btn {
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
}

.btn-primary {
    background: var(--rot);
    color: #fff;
    width: 100%;
}
.btn-primary:hover {
    background: #d06010;
    box-shadow: 0 2px 8px rgba(232,119,34,.35);
}
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
    background: var(--white);
    color: var(--muted);
    border: 1px solid var(--border-mid);
}
.btn-secondary:hover {
    border-color: var(--rot-mid);
    color: var(--rot);
}

.btn-row {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

/* ─── Main area ─── */
main {
    padding: 28px 32px;
}

.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.count-badge {
    background: var(--orange-light);
    color: var(--rot);
    border: 1px solid var(--rot-mid);
    border-radius: 20px;
    padding: 2px 11px;
    font-size: 11.5px;
    font-weight: 500;
}

/*  */

/* Dropdown Styles */
.header-user { position: relative; cursor: pointer; }

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 8px 0;
    z-index: 100;
    min-width: 140px;
}
.header-user:hover .user-dropdown { display: block; }

.user-dropdown a {
    display: block;
    padding: 8px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
}
.user-dropdown a:hover { background: #f5f5f7; color: var(--orange); }

/* Inline Form Styles */
.main-entry-area {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.main-entry-area .field { margin-bottom: 0; flex: 1; }

.main-entry-area input,
.main-entry-area select{
    min-height:40px;
}

.main-entry-area .btn {
    max-width: 180px;
    height: 40px;
}

/* ─── Filter tags ─── */
.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    min-height: 26px;
}

.filter-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--orange-light);
    border: 1px solid var(--rot);
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 11.5px;
    color: var(--rot);
    font-weight: 500;
}

.filter-tag button {
    background: none;
    border: none;
    color: var(--rot-mid);
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
}
.filter-tag button:hover { color: var(--rot); }

.no-filter {
    font-size: 12px;
    color: var(--muted-light);
}

/* ─── Table ─── */
.table-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f7f8f9;
    border-bottom: 1px solid var(--border);
}

th {
    padding: 11px 18px;
    text-align: left;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fdf5ee; }

td {
    padding: 13px 18px;
    font-size: 13.5px;
    color: var(--text);
    vertical-align: middle;
}

.td-date { font-variant-numeric: tabular-nums; font-weight: 500; }
.td-time { color: var(--muted); font-variant-numeric: tabular-nums; }

.type-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin: 2px 4px 2px 0;
}
.type-chip::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.tc-default    { background: #f0f1f2; color: #5a6270; }

.td-actions { 
    /* text-align: right;  */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: end;
    gap: 8px;
}

.icon-btn {
    background: var(--white);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    transition: all var(--transition);
    height: 28px;
    display: flex;
    align-items: center;
    padding: 5px 16px;
}
.icon-btn:hover {
    border-color: #e05555;
    color: #e05555;
    background: #fff5f5;
}

.appointmentcontainer {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
}

.appointmentcontainer input[type="hidden"] {
    display: none;
}

.edit-btn:hover {
    border-color: var(--rot-mid);
    color: var(--rot);
    background: var(--orange-light);
}

/* ─── Empty state ─── */
.empty-state {
    padding: 52px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.empty-icon-wrap {
    width: 52px;
    height: 52px;
    background: var(--orange-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.empty-icon-wrap svg {
    width: 24px;
    height: 24px;
    color: var(--rot);
}

.empty-state p {
    font-size: 13.5px;
    color: var(--muted);
}

.empty-state small {
    font-size: 12px;
    color: var(--muted-light);
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--rot);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 500;
    box-shadow: var(--shadow-lg);
    transform: translateY(80px);
    opacity: 0;
    transition: all .3s cubic-bezier(.34,1.56,.64,1);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-icon { color: var(--rot); font-size: 16px; }

/* ─── Validation ─── */
input.invalid, select.invalid {
    border-color: #e05555 !important;
    box-shadow: 0 0 0 3px rgba(224,85,85,.12) !important;
}

.dropdown-multiselect.invalid .multiselect-trigger {
    border-color: #e05555 !important;
    box-shadow: 0 0 0 3px rgba(224,85,85,.12) !important;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 4px; }

/* ─── Footer ─── */
footer {
    grid-column: 1/-1;
    border-top: 1px solid var(--border);
    background: var(--white);
    padding: 12px 28px;
    font-size: 11px;
    color: var(--muted-light);
    display: flex;
    gap: 10px;
    align-items: center;
}
footer span { color: var(--border-mid); }
