/* style.css - Apple HIG Styling System */

/* CSS Reset & Variables */
:root {
    --system-background: #F2F2F7;
    --secondary-background: #FFFFFF;
    --tertiary-background: #E5E5EA;

    --primary-color: #007AFF;
    --primary-hovercolor: #258DFF;
    --primary-active-color: #0056B3;
    --primary-active-hovercolor: #208BFF;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --danger-color: #FF3B30;

    --text-primary: #1C1C1E;
    --text-secondary: #8E8E93;
    --text-on-primary: #FFFFFF;

    --border-color: #C6C6C8;
    --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --modal-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);

    --sidebar-width: 260px;
    --header-height: 60px;
    --border-radius-lg: 12px;
    --border-radius-md: 8px;
    --border-radius-sm: 6px;

    --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Dark Mode Support (Automatically matched to OS Settings) */
@media (prefers-color-scheme: dark) {
    :root {
        --system-background: #000000;
        --secondary-background: #1C1C1E;
        --tertiary-background: #2C2C2E;

        --text-primary: #FFFFFF;
        --text-secondary: #AEAEB2;
        --border-color: #38383A;
        --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        --modal-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--system-background);
    color: var(--text-primary);
    line-height: 1.4;
    overflow-x: hidden;
}

/* PWA Offline Connection Status Pill */
.connection-status-pill {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    .connection-status-pill {
        background: rgba(28, 28, 30, 0.85);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
}

.connection-status-pill .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success-color);
}

.connection-status-pill.offline .status-dot {
    background-color: var(--warning-color);
    animation: status-pulse 1.5s infinite;
}

@keyframes status-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Login Page Styling */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--secondary-background);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo {
    width: auto;
    height: 48px;
    margin-bottom: 24px;
    object-fit: contain;
}

.login-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-error-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 59, 48, 0.1);
    color: var(--danger-color);
    padding: 12px;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}

.login-form .input-group {
    margin-bottom: 16px;
}

.login-form label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.login-form input {
    width: 100%;
    padding: 12px;
    background: var(--tertiary-background);
    border: 1px solid transparent;
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 16px;
    transition: all 0.2s ease;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--secondary-background);
}

.login-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: var(--text-on-primary);
    border: none;
    border-radius: var(--border-radius-md);
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 10px;
}

.login-submit-btn:active {
    background: var(--primary-active-color);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 11px;
    color: var(--text-secondary);
}

.demo-hints {
    margin-top: 16px;
    padding: 12px;
    background: rgba(0, 122, 255, 0.05);
    border-radius: var(--border-radius-md);
    text-align: left;
    font-size: 12px;
    color: var(--text-primary);
}

.demo-hints code {
    background: var(--tertiary-background);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
}

/* App Layout Grid (Sidebar + Main) */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.app-sidebar {
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 20px 0 0 0;
}

@media (prefers-color-scheme: dark) {
    .app-sidebar {
        background: rgba(28, 28, 30, 0.8);
    }
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.3px;
}

.brand-tagline {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Sidebar Header Styling */
.sidebar-header {
    padding: 10px;
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 10px;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-nav li.active a {
    background: var(--primary-color);
    color: var(--text-on-primary);
}

.sidebar-nav li.active a:hover {
    background: var(--primary-active-hovercolor);
    color: var(--text-on-primary);
}

.sidebar-nav li:not(.active) a:hover {
    background: var(--tertiary-background);
    color: var(--text-primary);
}

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    font-size: small;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    /* margin-bottom: 15px; */
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--text-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-fullname {
    /*font-size: 14px;*/
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role-badge {
    align-self: flex-start;
    /*font-size: 11px;*/
    /*font-weight: 700;*/
    padding: 4px 10px;
    border-radius: 12px;
    background: var(--tertiary-background);
    color: var(--text-secondary);
    margin-top: 2px;
    display: inline-block;
}

.user-role-badge.admin {
    background: rgba(255, 59, 48, 0.12);
    color: var(--danger-color);
}

.user-role-badge.receptionist {
    background: rgba(0, 122, 255, 0.12);
    color: var(--primary-color);
}

.user-role-badge.staff {
    background: rgba(52, 199, 89, 0.12);
    color: var(--success-color);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--danger-color);
    text-decoration: none;
    /*font-size: 15px;*/
    font-weight: 500;
    border-radius: var(--border-radius-md);
    transition: background 0.2s ease;
}

.logout-btn:hover {
    background: rgba(255, 59, 48, 0.08);
}

/* Main Viewport Styling */
.app-main-content {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* If calendar is present, prevent main content scrolling and scale calendar layout to fit exactly on desktop */
@media (min-width: 769px) {
    .app-main-content:has(.calendar-layout) {
        overflow: hidden;
    }

    .app-main-content:has(.calendar-layout) .calendar-layout {
        flex: 1 1 0%;
        min-height: 0;
        height: auto;
    }
}

/* View Header Layout */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.view-title-area h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.view-title-area p {
    /*font-size: 14px;*/
    color: var(--text-secondary);
}

.view-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Standard HIG UI Elements */
.btn-primary {
    /* display: inline-flex; */
    /* align-items: center; */
    /* gap: 8px; */
    padding: 10px 16px;
    background: var(--primary-color);
    color: var(--text-on-primary);
    border: none;
    border-radius: var(--border-radius-md);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-primary:active {
    background: var(--primary-active-color);
}

.btn-secondary {
    /*
    display: inline-flex;
    align-items: center;
    gap: 8px;
    */
    padding: 10px 16px;
    background: var(--tertiary-background);
    color: var(--text-primary);
    border: none;
    border-radius: var(--border-radius-md);
    font-family: var(--font-family);
    /*font-size: 14px;*/
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-secondary:active {
    filter: brightness(0.9);
}

/* Card layout */
.card {
    background: var(--secondary-background);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 20px;
}

/* App Modals Overlay & Animation */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    overflow-y: auto;
    padding: 24px 16px;
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: var(--secondary-background);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--modal-shadow);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 800px;
    padding: 32px;
    margin: auto;
    transform: scale(0.9);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.modal-header h3 {
    font-size: 19px;
    font-weight: 700;
}

.modal-close-btn {
    background: none;
    border: none;
    /*font-size: 22px;*/
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

/* Apple Action Sheets (Bottom modal on mobile) */
.action-sheet {
    background: var(--secondary-background);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 360px;
    padding: 16px;
    box-shadow: var(--modal-shadow);
    margin: auto;
    transform: translateY(100px);
    transition: transform 0.25s ease;
    text-align: center;
    box-sizing: border-box;
}

.modal-overlay.active .action-sheet {
    transform: translateY(0);
}

.action-sheet-header {
    padding: 8px 16px 16px 16px;
}

.action-sheet-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.action-sheet-header p {
    /*font-size: 13px;*/
    color: var(--text-secondary);
    margin-top: 4px;
}

.action-sheet-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    width: 100%;
    padding: 12px;
    border-radius: var(--border-radius-md);
    border: none;
    font-family: var(--font-family);
    /*font-size: 17px;*/
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.action-danger {
    background: var(--danger-color);
    color: var(--text-on-primary);
    font-weight: 600;
}

.action-cancel {
    background: var(--tertiary-background);
    color: var(--primary-color);
}

/* Form Styles */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 10px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    background: var(--secondary-background);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
}

/* Scheduler / Calendar Grid Design (iPadOS Style) */
.calendar-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    background: var(--secondary-background);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
}

.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-date-label {
    font-size: 18px;
    font-weight: 700;
    min-width: 180px;
    text-align: center;
}

.calendar-grid-container {
    flex-grow: 1;
    overflow: auto;
    position: relative;
    display: flex;
}

.dashboard-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.dashboard-grid-card {
    background: var(--secondary-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.dashboard-grid-card h4 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.9em;
}

.dashboard-card-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.time-axis {
    width: 60px;
    border-right: 1px solid var(--border-color);
    background: var(--system-background);
    flex-shrink: 0;
    position: sticky;
    left: 0;
    z-index: 10;
    padding-top: 45px;
    box-sizing: border-box;
}

.time-slot-label {
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px dashed var(--border-color);
}

.calendar-columns {
    display: flex;
    flex-grow: 1;
    /*min-width: 280px;*/
}

.staff-column {
    flex: 1;
    min-width: 150px;
    box-sizing: border-box;
    border-right: 1px solid var(--border-color);
    position: relative;
    background-image: linear-gradient(var(--border-color) 1px, transparent 1px);
    background-size: 100% 60px;
    /* Aligns grid lines to time slot height */
    background-position: 0 45px;
}

.staff-column-header {
    position: sticky;
    top: 0;
    background: var(--secondary-background);
    z-index: 12;
    height: 45px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    /*font-size: 14px;*/
}

/* Appointment block placement in column */
.appointment-card-block {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: var(--border-radius-sm);
    padding: 0 8px 6px 8px;
    color: #FFFFFF;
    /*font-size: 11px;*/
    line-height: 1.2;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, min-height 0.2s ease;
    z-index: 5;
    border-left: 4px solid rgba(0, 0, 0, 0.25);
    font-size: revert;
}

.appointment-card-block:hover {
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 50 !important;
    min-height: 60px;
}

.appointment-card-block .time-info {
    font-weight: 700;
    /*font-size: 9px;*/
    margin-top: 2px;
    margin-bottom: 2px;
    /*text-transform: uppercase;*/
}

.appointment-card-block .client-name {
    /*font-weight: 600;*/
    /*font-size: 12px;*/
}

.appointment-card-block .service-name {
    opacity: 0.9;
}

.appointment-card-block.dragging {
    opacity: 0.5;
    z-index: 100;
}

.staff-column.drag-over {
    background-color: rgba(0, 122, 255, 0.1) !important;
}

.drag-time-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
    z-index: 20;
    pointer-events: none;
    display: none;
}

.drag-time-indicator::after {
    content: attr(data-time);
    position: absolute;
    left: 4px;
    top: -16px;
    /*font-size: 10px;*/
    font-weight: 700;
    color: var(--primary-color);
    background: var(--secondary-background);
    padding: 2px 4px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calendar-datepicker-container {
    display:flex; 
    align-items:center; 
    gap:6px;
}

.calendar-view-toggle {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 4px;
}

#btn-view-grid {
    padding:6px 12px; 
    border:none; 
    background:var(--bg-primary); 
    border-radius:4px; 
    box-shadow:0 1px 3px 
    rgba(0,0,0,0.1); 
    font-weight:600; 
    cursor:pointer; 
    color:var(--text-primary);    
}

#btn-view-agenda {
    padding:6px 12px; 
    border:none; 
    background:transparent; 
    border-radius:4px; 
    font-weight:600; 
    cursor:pointer; 
    color:var(--text-secondary);
}

/* Custom styles for tables (Management views) */
.table-container {
    overflow-x: auto;
    margin-top: 12px;
}

.table-hig {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    text-align: left;
}

.table-hig th {
    background: var(--tertiary-background);
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.table-hig td {
    padding: 14px 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 15px;
    border-bottom: 1px solid var(--border-color);
}

.table-hig tr:last-child td {
    border-bottom: none;
}

.table-hig tbody tr {
    cursor: pointer;
}

.table-hig tr:hover {
    background: rgba(0, 122, 255, 0.05);
}

.table-hig tr.empty-placeholder-row {
    font-style: italic;
    color: var(--text-secondary);
    text-align: center;
}

.table-hig tr.empty-placeholder-row:hover {
    background: rgba(0, 122, 255, 0.08);
}

.color-dot {
    display: inline-block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

/* Mobile Components Base */
.mobile-header {
    display: none;
}

.mobile-backdrop {
    display: none;
}

/* Responsive Styles for Mobile */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        background: var(--secondary-background);
        border-bottom: 1px solid var(--border-color);
        position: sticky;
        top: 0;
        z-index: 1000;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }

    .mobile-brand-container {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .hamburger-btn {
        background: none;
        border: none;
        color: var(--text-primary);
        cursor: pointer;
        padding: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        max-width: 80%;
        background: var(--secondary-background);
        z-index: 10000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 1px solid var(--border-color);
        display: flex;
        flex-direction: column;
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .mobile-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 9999;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-backdrop.show {
        display: block;
        opacity: 1;
    }

    .sidebar-brand {
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-nav ul {
        display: flex;
        flex-direction: column;
        overflow-x: visible;
        gap: 4px;
        padding: 10px;
    }

    .sidebar-nav li {
        margin-bottom: 2px;
        flex-shrink: 0;
    }

    .sidebar-nav a {
        padding: 12px 16px;
        font-size: 16px;
    }

    .sidebar-header {
        padding: 15px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid var(--border-color);
        margin-bottom: 0;
        border-bottom: none;
    }

    .sidebar-header .user-profile {
        margin-bottom: 0 !important;
    }

    .sidebar-footer {
        display: block;
    }

    .app-main-content {
        padding: 16px;
        height: auto;
    }

    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .calendar-layout {
        height: 600px;
    }

    
    .current-date-label {
        /*display: none;*/
    }

    .view-header {
        align-items: center;
    }

    .view-actions button {
        width: 100%;
        margin: 0 !important;
        justify-content: center;
        padding: 12px;
        white-space: nowrap;
    }
}

/* Responsive Styles for Mobile Forms */
@media (max-width: 576px) {
    .modal-overlay {
        padding: 16px 12px;
    }

    .modal-container {
        padding: 16px !important;
        border-radius: var(--border-radius-md);
    }

    .form-row-2 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
        margin-top: 16px;
        padding-top: 12px;
    }

    .modal-footer button,
    .modal-footer .btn-secondary,
    .modal-footer .btn-primary {
        width: 100%;
        margin: 0 !important;
        justify-content: center;
        padding: 12px;
    }

    .calendar-datepicker-container {
        display:flex; 
        align-items:center; 
        gap:6px;
    }

    .calendar-toolbar {
        padding: 10px 10px;
    }

    .calendar-navigation {
        gap: 6px;
    }
 
    .calendar-navigation .button {

    }

    .agenda-list-item .staff-badge {
        text-transform: revert;
        white-space: nowrap;
    }

    #calendar-datepicker {
        display: none;
    }
}

/* Current Time Line Indicator */
.current-time-line {
    position: absolute;
    left: 0;
    /* Aligns with the end of time-axis */
    right: 0;
    height: 2px;
    background-color: var(--danger-color);
    z-index: 11;
    pointer-events: none;
    display: none;
}

.current-time-line::before {
    content: '';
    position: absolute;
    left: -5px;
    top: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--danger-color);
}

/* --------------------------------------------------------
   Print Media Styles (@media print)
-------------------------------------------------------- */
@media print {
    body {
        background: #FFFFFF;
        color: #000000;
        font-size: 12pt;
    }

    /* Hide non-printable app items */
    .app-sidebar,
    .connection-status-pill,
    .view-actions,
    .calendar-toolbar,
    .modal-overlay,
    #logout-modal {
        display: none !important;
    }

    .app-container {
        display: block;
    }

    .app-main-content {
        padding: 0;
        margin: 0;
        height: auto;
        overflow: visible;
    }

    .card,
    .calendar-layout {
        border: none !important;
        box-shadow: none !important;
        background: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Printable Calendar Layout */
    .calendar-grid-container {
        overflow: visible !important;
    }

    .time-axis {
        background: none !important;
    }

    .appointment-card-block {
        box-shadow: none !important;
        border: 1px solid #000000 !important;
        color: #000000 !important;
        background: #FFFFFF !important;
        page-break-inside: avoid;
    }

    /* Page settings */
    @page {
        size: A4 portrait;
        margin: 1.5cm;
    }
}
/* Calendar Resize Handle */
.calendar-resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    background-color: rgba(0, 0, 0, 0.15);
    cursor: row-resize;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    transition: background-color 0.2s;
}

/* 3 διακριτικές τελείες/γραμμές grip στο κέντρο της μπάρας */
.calendar-resize-handle::after {
    content: "···";
    color: rgba(255, 255, 255, 0.7);
    font-weight: bolder;
    font-size: 14px;
    line-height: 0;
    letter-spacing: 1px;
}

/* Μεγέθυνση της περιοχής αφής (Hit Area) χωρίς να μεγαλώνει οπτικά η μπάρα */
.calendar-resize-handle::before {
    content: "";
    position: absolute;
    top: -10px;
    bottom: -10px;
    left: 0;
    right: 0;
}

.calendar-resize-handle:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

/* Agenda View */
.agenda-list-item {
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    color: #ffffff;
}
.agenda-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    opacity: 0.95;
}
.agenda-list-item .time-row {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.agenda-list-item .staff-badge {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    background-color: rgba(255,255,255,0.25);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
}
.agenda-list-item .details-row {
    font-size: 15px;
    color: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.agenda-list-item .details-row strong {
    font-size: 16px;
    color: #ffffff;
}
.agenda-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary, #5c6b7a);
    font-size: 18px;
    font-weight: 500;
    background: var(--bg-primary, #ffffff);
    border-radius: 10px;
    border: 1px dashed var(--border-color, #cbd5e1);
}

/* Logs View */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}
.clickable-row:hover {
    background-color: var(--bg-hover) !important;
}

/* Logs View Classes */
.log-empty-row { text-align: center; color: var(--text-secondary); padding: 32px; }
.log-date-col { font-size: 12px; color: var(--text-secondary); }
.log-user-wrapper { display: flex; align-items: center; gap: 8px; }
.log-user-avatar { background-color: var(--primary-color); color: white; width: 24px; height: 24px; font-size: 10px; }
.log-user-name { font-weight: 500; font-size: 13px; }
.log-action-badge { font-weight: 600; font-size: 12px; text-transform: uppercase; }
.log-entity-col { font-size: 13px; font-weight: 500; }
.log-details-col { font-size: 11px; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; color: var(--text-secondary); }
.log-ip-col { font-size: 12px; color: var(--text-secondary); }
.log-modal-container { max-width: 750px; }
.log-modal-body { padding: 15px 0; }
.log-modal-grid { display: grid; grid-template-columns: 120px 1fr; gap: 10px; margin-bottom: 15px; font-size: 14px; }
.log-modal-label { color: var(--text-secondary); font-weight: bold; }
.log-modal-subtitle { color: var(--text-secondary); font-size: 14px; display: block; margin-bottom: 8px; font-weight: bold; }
.log-modal-json { background: var(--bg-color); padding: 12px; border-radius: 6px; border: 1px solid var(--border-color); font-size: 12px; overflow-x: auto; max-height: 300px; overflow-y: auto; color: var(--text-primary); }
.log-modal-footer { margin-top: 15px; }

/* Calendar Modals */
.calendar-modal-overlay { z-index: 10003; }
.calendar-modal-container { max-width: 500px; text-align: center; padding: 24px; }
.calendar-modal-title-danger { color: var(--danger-color, #d9534f); margin-bottom: 12px; }
.calendar-modal-title-warning { color: var(--warning-color, #f0ad4e); margin-bottom: 12px; }
.calendar-modal-msg { margin-bottom: 20px; line-height: 1.5; color: var(--text-main); }
.calendar-modal-btn-group { display: flex; flex-direction: column; gap: 10px; }
.calendar-modal-btn-full { width: 100%; }
.calendar-modal-btn-bold { width: 100%; font-weight: bold; }
.calendar-modal-btn-danger { width: 100%; font-weight: bold; background-color: var(--danger-color); border-color: var(--danger-color); }
.calendar-modal-btn-cancel { width: 100%; color: var(--text-muted); }

/* --- Standardized Application Classes (Staff/Contracts) --- */
.contract-section { background-color: var(--tertiary-background); padding: 16px; border-radius: var(--border-radius-md); margin-top: 16px; }
.contract-header { margin: 0 0 12px 0; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.contract-details { font-size: 13px; line-height: 1.6; margin-bottom: 12px; }

/* Status Badges */
.badge-status { padding: 4px 10px; border-radius: 12px; font-size: 0.85em; display: inline-flex; align-items: center; font-weight: 500; }
.badge-status.active { color: #166534; background-color: #dcfce7; }
.badge-status.inactive { color: #991b1b; background-color: #fee2e2; }
.badge-status.none { color: #374151; background-color: #f3f4f6; }

/* Status Pills (with dots) */
/*.status-pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 12px; font-size: 0.85em; min-width: 80px; }*/
.status-pill {
    align-self: flex-start;
    /*font-size: 11px;*/
    /*font-weight: 700;*/
    padding: 4px 10px;
    border-radius: 12px;
    background: var(--tertiary-background);
    color: var(--text-secondary);
    margin-top: 2px;
    display: inline-block;
}
.status-pill.active { color: #166534; background-color: #dcfce7; }
.status-pill.inactive { color: #991b1b; background-color: #fee2e2; }
/*.status-pill .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; }*/
.status-pill.active .dot { background-color: #16a34a; }
.status-pill.inactive .dot { background-color: #dc2626; }

/* Text Utilities */
.text-danger { color: var(--danger-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-center { text-align: center; }
.text-sm { font-size: 0.9em; }
.text-xs { font-size: 0.85em; }
.text-secondary { color: var(--text-secondary); }
.font-medium { font-weight: 500; }

/* Modals & Buttons Overrides */
.modal-overlay.z-high { z-index: 10000; }
.modal-container.sm { max-width: 400px; }
.modal-container.md { max-width: 750px; }
.btn-danger-bg { background-color: var(--danger-color) !important; color: white !important; border-color: var(--danger-color) !important; }
.btn-secondary.danger-text { color: var(--danger-color); }
.btn-half { width: 50%; height: 40px; }
.mr-auto { margin-right: auto !important; }

/* Table Utilities */
.table-scrollable { max-height: 350px; overflow-y: auto; border: 1px solid var(--border-color); border-radius: var(--border-radius-md); }
.table-scrollable-padded { padding: 12px; display: flex; flex-direction: column; gap: 8px; }

/* Avatars */
.avatar-wrapper { width: 28px; height: 28px; margin: 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 50%; padding: 2px; box-sizing: border-box; }
.avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.font-mono { font-family: monospace; }
.font-bold { font-weight: bold; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.badge-secondary { background: var(--tertiary-background); padding: 4px 10px; border-radius: 12px; font-size: 0.85em; display: inline-flex; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-primary-color { color: var(--primary-color) !important; }
.text-success-color { color: var(--success-color) !important; }
.text-warning-color { color: var(--warning-color) !important; }
.text-danger-color { color: var(--danger-color) !important; }
.font-semibold { font-weight: 600; }
.mb-0 { margin-bottom: 0 !important; }
.p-24 { padding: 24px !important; }
.flex-gap-8 { display: flex; align-items: center; gap: 8px; }
.flex-column-gap-20 { display: flex; flex-direction: column; gap: 20px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 20px; margin-top: 24px; }
.card-header-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.table-scroll-250 { max-height: 250px; overflow-y: auto; }

/* Responsive Display Utilities */
.hide-on-mobile {
    /* visible by default on desktop */
}
.show-on-mobile {
    display: none !important; /* hidden by default on desktop */
}

@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important; /* hides the column on mobile */
    }
    .show-on-mobile {
        display: block !important; /* shows on mobile */
    }
    /* specifically for table cells if someone tries to show a td on mobile */
    td.show-on-mobile, th.show-on-mobile {
        display: table-cell !important;
    }
}

/* Collapsible Sidebar Menus */
.sidebar-nav li.has-submenu > a {
    justify-content: space-between;
}
.submenu-toggle-icon {
    transition: transform 0.2s ease;
    opacity: 0.6;
}
.sidebar-nav li.open > a .submenu-toggle-icon {
    transform: rotate(90deg);
}
.sidebar-nav .submenu {
    display: none;
    list-style: none;
    padding-left: 28px;
    margin-top: 4px;
    margin-bottom: 8px;
}
.sidebar-nav li.open > .submenu {
    display: block;
}
.sidebar-nav .submenu a {
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-secondary);
}
.sidebar-nav .submenu a:hover, .sidebar-nav .submenu li.active > a {
    color: var(--primary-color);
    background: transparent;
}
.sidebar-nav .submenu li.active > a {
    font-weight: 600;
}
