/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Auth Pages (Login/Register) */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 450px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    color: #1e40af;
    margin-bottom: 10px;
}

.login-header p {
    color: #6b7280;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.login-footer p {
    color: #6b7280;
    margin-bottom: 10px;
}

.company-info-box {
    background: #f0f9ff;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #bae6fd;
}

.company-info-box h3 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: #0369a1;
}

.section-title {
    margin: 0 0 15px 0;
    font-size: 0.9rem;
    color: #374151;
}

/* Sidebar Navigation old bg:1e40af */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 60px;
    height: calc(100vh - 60px);
    background-color: #D6D3D1;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: width 0.3s ease;
}

.sidebar.expanded {
    width: 220px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    background-color: rgba(0,0,0,0.1);
    overflow: hidden;
}

.sidebar-brand:hover {
    text-decoration: none;
    background-color: rgba(0,0,0,0.2);
}

.sidebar-brand .brand-icon {
    min-width: 60px;
    text-align: center;
}

.sidebar-brand .brand-text {
    display: none;
    white-space: nowrap;
    font-size: 1.25rem;
}

.sidebar.expanded .sidebar-brand {
    justify-content: flex-start;
    padding-left: 15px;
    gap: 10px;
}

.sidebar.expanded .sidebar-brand .brand-icon {
    min-width: auto;
}

.sidebar.expanded .sidebar-brand .brand-text {
    display: inline;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
}

.sidebar-menu li {
    margin: 4px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    color: #333;
    transition: background-color 0.2s, color 0.2s;
    position: relative;
}

.sidebar-menu a svg {
    width: 24px;
    height: 24px;
    min-width: 24px;
}

.sidebar-menu a .menu-text {
    display: none;
    white-space: nowrap;
    margin-left: 12px;
    font-size: 0.9rem;
}

.sidebar.expanded .sidebar-menu a {
    justify-content: flex-start;
    padding-left: 18px;
}

.sidebar.expanded .sidebar-menu a .menu-text {
    display: inline;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: rgba(0,0,0,0.1);
    color: #000;
    text-decoration: none;
}

.sidebar-menu a.active {
    background-color: rgba(0,0,0,0.15);
    border-left: 3px solid #333;
}

.sidebar.expanded .sidebar-menu a.active {
    padding-left: 15px;
}

/* Toggle button (in sidebar) */
.sidebar > .sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(0,0,0,0.05);
    border: none;
    border-radius: 6px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s;
    margin: 8px auto;
    flex-shrink: 0;
}

.sidebar > .sidebar-toggle:hover {
    background: rgba(0,0,0,0.1);
    color: #000;
}

.sidebar > .sidebar-toggle svg {
    width: 22px;
    height: 22px;
}

.sidebar > .sidebar-toggle .toggle-collapse {
    display: none;
}

.sidebar.expanded > .sidebar-toggle .toggle-expand {
    display: none;
}

.sidebar.expanded > .sidebar-toggle .toggle-collapse {
    display: block;
}

/* Mobile-only toggle button (in topbar, hidden on desktop) */
.mobile-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(0,0,0,0.05);
    border: none;
    border-radius: 6px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mobile-sidebar-toggle:hover {
    background: rgba(0,0,0,0.1);
    color: #000;
}

.mobile-sidebar-toggle svg {
    width: 22px;
    height: 22px;
}

.mobile-sidebar-toggle .toggle-collapse {
    display: none;
}

.sidebar.expanded ~ .topbar .mobile-sidebar-toggle .toggle-expand {
    display: none;
}

.sidebar.expanded ~ .topbar .mobile-sidebar-toggle .toggle-collapse {
    display: block;
}

/* Version info */
.sidebar-version {
    padding: 12px;
    text-align: center;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.sidebar-version .version-text {
    font-size: 0.7rem;
    color: rgba(0,0,0,0.5);
}

/* Dynamic layout adjustments - sidebar overlays content, does not push it */

/* Topbar  old bg:1e40af background-color: #D6D3D1;*/
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #D6D3D1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 0 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1001;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;    
}

.topbar-logo {
    display: flex;
    align-items: center;    
}

.topbar-logo:hover {
    opacity: 0.9;
}

.topbar-logo img {
    width: 250px;
    height: auto;
    max-height: 50px;
    object-fit: contain;
    object-position: left center;
}

.topbar-logo .logo-text {
    color: #333;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.topbar-user:hover {
    background-color: rgba(0,0,0,0.1);
    color: #000;
    text-decoration: none;
}

.topbar-user svg {
    width: 24px;
    height: 24px;
    color: #333;
}

.topbar-user span {
    font-size: 0.875rem;
    font-weight: 500;
}

.topbar-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #333;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
}

.topbar-settings:hover,
.topbar-settings.active {
    background-color: rgba(59,130,246,0.15);
    color: #3b82f6;
    text-decoration: none;
}

.topbar-settings svg {
    width: 22px;
    height: 22px;
}

.topbar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #333;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
}

.topbar-logout:hover {
    background-color: rgba(220,38,38,0.2);
    color: #dc2626;
    text-decoration: none;
}

.topbar-logout svg {
    width: 22px;
    height: 22px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    margin-left: 80px;
    margin-top: 60px;
    padding: 20px;
    min-height: calc(100vh - 60px);
    transition: margin-left 0.3s ease;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.page-header h1 {
    font-size: 1.75rem;
    color: #1e40af;
}

.page-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s;
    box-sizing: border-box;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: #4b5563;
    color: white;
}

.btn-primary:hover {
    background-color: #374151;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-success {
    background-color: #059669;
    color: white;
}

.btn-success:hover {
    background-color: #047857;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-warning {
    background-color: #d97706;
    color: white;
}

.btn-warning:hover {
    background-color: #b45309;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

tr:hover {
    background-color: #f9fafb;
}

.actions {
    white-space: nowrap;
}

.actions a,
.actions button {
    margin-right: 8px;
}

/* Forms */
.form-container {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-width: 600px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group .error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 5px;
}

.form-group input.is-invalid,
.form-group select.is-invalid {
    border-color: #dc2626;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.checkbox-group-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
}

/* Stacked form fields column */
.form-group-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-stack .form-group {
    margin-bottom: 0;
}

/* Employee dropdown */
.employee-dropdown {
    position: relative;
}

.employee-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    text-align: left;
    gap: 8px;
}

.employee-dropdown-toggle:hover {
    border-color: #9ca3af;
}

.employee-dropdown-toggle span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-dropdown-arrow {
    flex-shrink: 0;
    transition: transform 0.2s;
    color: #6b7280;
}

.employee-dropdown.open .employee-dropdown-arrow {
    transform: rotate(180deg);
}

.employee-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 100;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
}

.employee-dropdown-menu .checkbox-group-list {
    padding: 4px 12px;
}

.employee-dropdown.open .employee-dropdown-menu {
    display: block;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-group input {
    width: auto;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-confirmed {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-invoiced {
    background-color: #ede9fe;
    color: #5b21b6;
}

.badge-restorder {
    background-color: #ffedd5;
    color: #9a3412;
}

.badge-draft {
    background-color: #e5e7eb;
    color: #374151;
}

.badge-sent {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-paid {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-overdue {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-active {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-inactive {
    background-color: #e5e7eb;
    color: #6b7280;
}

/* Search Form */
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-form input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    width: 300px;
}

/* Filter Form */
.filter-form {
    padding: 15px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-form .form-group {
    margin-bottom: 0;
}

.filter-form select,
.filter-form input[type="date"] {
    min-width: 120px;
}

.filter-card {
    margin-bottom: 20px;
}

/* Filter Links */
.filter-links {
    margin-bottom: 20px;
}

.filter-links a {
    display: inline-block;
    padding: 6px 14px;
    margin-right: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    color: #374151;
    font-size: 0.875rem;
}

.filter-links a:hover,
.filter-links a.active {
    background-color: #2563eb;
    color: white;
    text-decoration: none;
}

/* Calendar */
.calendar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.calendar-title h2 {
    font-size: 1.25rem;
    margin: 0;
}

.calendar-nav {
    display: flex;
    gap: 10px;
}

/* Week View */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 500px;
}

.week-day {
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}

.week-day:last-child {
    border-right: none;
}

.week-day.today {
    background-color: #eff6ff;
}

.week-day.drag-over {
    background-color: #e0f2fe;
    outline: 2px dashed #3b82f6;
    outline-offset: -2px;
}

.week-event[draggable] {
    cursor: grab;
}

.week-event[draggable]:active {
    cursor: grabbing;
}

.week-day-header {
    padding: 12px 10px;
    text-align: center;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.week-day.today .week-day-header {
    background-color: #dbeafe;
}

.week-day-header .day-name {
    display: block;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.week-day-header .day-date {
    display: block;
    font-size: 1.25rem;
    font-weight: bold;
    color: #1e40af;
    margin-top: 2px;
}

.week-day.today .week-day-header .day-date {
    color: #1e40af;
}

.week-day-events {
    flex: 1;
    padding: 8px;
    overflow: auto;
    max-height: 430px;
}

.week-event {
    display: block;
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 0.813rem;
    text-decoration: none;
    transition: transform 0.1s, box-shadow 0.1s;
}

.week-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
}

.week-event .event-time {
    display: block;
    font-weight: 600;
    margin-bottom: 3px;
}

.week-event .event-title {
    display: block;
    font-weight: 500;
}

.week-event .event-customer {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 2px;
}

.week-event.cleaning {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 3px solid #2563eb;
}

.week-event.meeting {
    background-color: #fef3c7;
    color: #92400e;
    border-left: 3px solid #f59e0b;
}

.week-event.reminder {
    background-color: #e5e7eb;
    color: #374151;
    border-left: 3px solid #6b7280;
}

.week-event.order {
    background-color: #374151;
    color: #f9fafb;
    border-left: 3px solid #1f2937;
    padding: 3px 6px;
    margin-bottom: 4px;
    font-size: 0.72rem;
}

.week-event.order .event-time {
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 0;
}

.week-event.order .event-title {
    font-size: 0.72rem;
}

.week-event.order .event-customer {
    font-size: 0.62rem;
    margin-top: 1px;
}

.week-event.order.status-pending,
.week-event.order.status-confirmed,
.week-event.order.status-completed,
.week-event.order.status-cancelled,
.week-event.order.status-invoiced {
    background-color: #1565c0;
    color: #ffffff;
    border-left: 3px solid #0d47a1;
}

.week-event.order.status-cancelled {
    opacity: 0.6;
}


.no-events {
    color: #9ca3af;
    font-size: 0.813rem;
    text-align: center;
    padding: 20px 10px;
}

/* Calendar Legend */
.calendar-legend {
    margin-top: 20px;
}

.legend-items {
    display: flex;
    gap: 20px;
    padding: 10px 0;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

.legend-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* Responsive week view */
@media (max-width: 900px) {
    .week-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .week-day {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .week-day:last-child {
        border-bottom: none;
    }

    .week-day-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
    }

    .week-day-header .day-name {
        display: inline;
    }

    .week-day-header .day-date {
        display: inline;
        font-size: 1rem;
        margin-top: 0;
        margin-left: 8px;
    }

    .week-day-events {
        min-height: 60px;
    }

    .no-events {
        padding: 10px;
    }
}

/* Dashboard */
.dashboard-stats-small {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-card-small {
    background: white;
    border-radius: 6px;
    padding: 10px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-card-small .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e40af;
}

.stat-card-small .stat-label {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Today's Calendar */
.today-calendar {
    margin-bottom: 20px;
}

.today-items {
    padding: 10px;
}

.today-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    text-decoration: none;
    transition: transform 0.1s;
}

.today-item:hover {
    transform: translateX(4px);
    text-decoration: none;
}

.today-item .item-time {
    font-size: 1.1rem;
    font-weight: 700;
    min-width: 70px;
}

.today-item .item-content {
    flex: 1;
    margin-left: 12px;
}

.today-item .item-title {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
}

.today-item .item-detail {
    display: block;
    font-size: 0.75rem;
    opacity: 0.8;
}

.today-item .item-employee {
    display: block;
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 2px;
}

.today-item.order,
.today-item.order.status-pending,
.today-item.order.status-confirmed,
.today-item.order.status-completed,
.today-item.order.status-invoiced {
    background-color: #1565c0;
    color: #ffffff;
    border-left: 4px solid #0d47a1;
}

.today-item.order.status-cancelled {
    background-color: #1565c0;
    color: #ffffff;
    border-left: 4px solid #0d47a1;
    opacity: 0.6;
}

.today-item.event.cleaning {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #2563eb;
}

.today-item.event.meeting {
    background-color: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.today-item.event.reminder {
    background-color: #e5e7eb;
    color: #374151;
    border-left: 4px solid #6b7280;
}

.today-item .badge {
    margin-left: auto;
}

/* Dashboard Top Section */
.dashboard-top {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.dashboard-top .dashboard-stats-small {
    flex: 1;
    margin-bottom: 0;
}

.profit-card {
    min-width: 280px;
}

.profit-card .card-header {
}

.profit-card-content {
    padding: 10px 15px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.profit-item {
    text-align: center;
    flex: 1;
}

.profit-item-label {
    color: #6b7280;
    font-size: 0.7rem;
}

.profit-item-value {
    font-size: 1rem;
    font-weight: 600;
}

.profit-item-value.negative {
    color: #dc2626;
}

.profit-item-value.positive {
    color: #16a34a;
}

/* Dashboard Shortcuts */
.dashboard-shortcuts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.shortcut-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    font-size: 0.875rem;
    transition: transform 0.15s, box-shadow 0.15s;
    border-left: 4px solid transparent;
}

.shortcut-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    text-decoration: none;
}

.shortcut-card svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.shortcut-orders { border-left-color: #1e40af; }
.shortcut-orders svg { color: #1e40af; }
.shortcut-calendar { border-left-color: #2563eb; }
.shortcut-calendar svg { color: #2563eb; }
.shortcut-timesheets { border-left-color: #7c3aed; }
.shortcut-timesheets svg { color: #7c3aed; }
.shortcut-invoices { border-left-color: #059669; }
.shortcut-invoices svg { color: #059669; }

@media (max-width: 600px) {
    .dashboard-shortcuts {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Detail View */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-item {
    padding: 10px 0;
}

.detail-item label {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 3px;
}

.detail-item .value {
    font-weight: 500;
}

/* Invoice specific */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.invoice-company p {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.invoice-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.invoice-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.invoice-totals {
    margin-top: 20px;
    text-align: right;
}

.invoice-totals .total-row {
    display: flex;
    justify-content: flex-end;
    gap: 30px;
    padding: 5px 0;
}

.invoice-totals .grand-total {
    font-size: 1.25rem;
    font-weight: bold;
    border-top: 2px solid #333;
    padding-top: 10px;
}


/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

/* Responsive - Tablet (768px) */
@media (max-width: 768px) {
    .sidebar {
        width: 50px;
        top: 50px;
        height: calc(100vh - 50px);
    }

    .sidebar.expanded {
        width: 200px;
    }

    .sidebar-menu a {
        height: 44px;
    }

    .sidebar-menu a svg {
        width: 20px;
        height: 20px;
    }

    .sidebar-version .version-text {
        font-size: 0.65rem;
    }

    .topbar {
        height: 50px;
        padding: 0 10px;
    }

    .topbar-left {
        gap: 10px;
    }

    .sidebar > .sidebar-toggle {
        width: 36px;
        height: 36px;
        margin: 6px auto;
    }

    .mobile-sidebar-toggle {
        width: 36px;
        height: 36px;
    }

    .topbar-logo img {
        width: 150px;
        max-height: 40px;
    }

    .topbar-logo .logo-text {
        font-size: 1.1rem;
    }

    .topbar-user span {
        display: none;
    }

    .container {
        margin-left: 60px;
        margin-top: 50px;
        padding: 15px;
    }



    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    /* Responsive tables with horizontal scroll */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.875rem;
        min-width: 600px;
    }

    th, td {
        padding: 8px 10px;
    }

    /* Search form */
    .search-form {
        flex-direction: column;
    }

    .search-form input {
        width: 100%;
    }

    /* Filter links wrap */
    .filter-links {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .filter-links a {
        margin-right: 0;
        margin-bottom: 0;
    }

    /* Form container full width */
    .form-container {
        max-width: 100%;
    }

    /* Invoice details stack */
    .invoice-details {
        flex-direction: column;
        gap: 20px;
    }

    /* Calendar header */
    .calendar-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .calendar-title {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .calendar-nav {
        justify-content: center;
    }

    /* Dashboard stats cards */
    .dashboard-stats-small {
        justify-content: center;
    }

    .stat-card-small {
        flex: 1 1 calc(50% - 6px);
        min-width: 140px;
    }

    /* Cards */
    .card {
        padding: 15px;
    }

    /* Buttons touch-friendly */
    .btn {
        padding: 10px 18px;
        min-height: 44px;
    }

    .btn-sm {
        padding: 8px 14px;
        min-height: 40px;
    }

    /* Actions column */
    .actions {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .actions a,
    .actions button {
        margin-right: 0;
    }

    /* Auth pages */
    .login-container {
        padding: 30px 25px;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }
}

/* Show only on mobile - hidden by default */
.show-mobile {
    display: none !important;
}

/* Responsive - Mobile (600px) */
@media (max-width: 600px) {
    /* Hide elements on mobile */
    .hide-mobile {
        display: none !important;
    }

    /* Show elements only on mobile */
    .show-mobile {
        display: table-cell !important;
    }

    /* Mobile navigation - sidebar becomes overlay */
    .sidebar {
        position: fixed;
        left: -220px;
        width: 220px;
        top: 50px;
        height: calc(100vh - 50px);
        transition: left 0.3s ease;
        z-index: 1002;
    }

    .sidebar > .sidebar-toggle {
        display: none;
    }

    .mobile-sidebar-toggle {
        display: flex;
    }

    .sidebar.expanded {
        left: 0;
        width: 220px;
    }

    .sidebar.expanded .sidebar-menu a {
        justify-content: flex-start;
        padding-left: 18px;
    }

    .sidebar.expanded .sidebar-menu a .menu-text {
        display: inline;
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1001;
    }

    .sidebar.expanded ~ .sidebar-overlay {
        display: block;
    }

    /* Container full width on mobile */
    .container {
        margin-left: 0;
        margin-top: 50px;
        padding: 12px;
        width: 100%;
    }

    .sidebar.expanded ~ .topbar ~ .container {
        margin-left: 0;
    }

    /* Topbar adjustments */
    .topbar {
        padding: 0 8px;
    }

    .topbar-logo img {
        width: 120px;
        max-height: 35px;
    }

    .topbar-logo .logo-text {
        font-size: 1rem;
    }

    .topbar-actions {
        gap: 8px;
    }

    .topbar-user {
        padding: 6px 8px;
    }

    .topbar-logout {
        width: 36px;
        height: 36px;
    }

    /* Page header */
    .page-header {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }

    .page-header h1 {
        font-size: 1.25rem;
    }

    /* Page header actions on mobile */
    .page-header-actions {
        width: 100%;
        flex-direction: column;
    }

    .page-header-actions .btn {
        width: 100%;
        text-align: center;
    }

    /* Single buttons in page header */
    .page-header .btn {
        width: 100%;
        text-align: center;
    }

    /* Form styling */
    .form-container {
        padding: 15px;
        border-radius: 6px;
        overflow-x: hidden;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .form-group input[type="date"],
    .form-group input[type="time"] {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding: 10px 4px 10px 8px;
        font-size: 15px;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* Tables - card style on mobile */
    .table-container {
        border-radius: 6px;
    }

    table {
        min-width: 500px;
    }

    th, td {
        padding: 10px 8px;
        font-size: 0.813rem;
    }

    /* Cards */
    .card {
        padding: 12px;
        border-radius: 6px;
        margin-bottom: 15px;
    }

    .card-header {
        font-size: 1rem;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    /* Dashboard top section */
    .dashboard-top {
        flex-direction: column;
        gap: 12px;
    }

    .profit-card {
        min-width: auto;
        width: 100%;
    }

    .profit-card-content {
        padding: 12px;
        gap: 10px;
    }

    .profit-item-value {
        font-size: 0.9rem;
    }

    /* Dashboard stats */
    .dashboard-stats-small {
        gap: 8px;
    }

    .stat-card-small {
        flex: 1 1 100%;
        padding: 12px;
    }

    .stat-card-small .stat-value {
        font-size: 1.25rem;
    }

    /* Dashboard grid single column */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Dashboard card tables - compact and scrollable */
    .dashboard-grid .card {
        padding: 0;
        overflow: hidden;
    }

    .dashboard-grid .card .card-header {
        padding: 12px 15px;
        margin-bottom: 0;
    }

    .dashboard-grid .card .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dashboard-grid .card table {
        min-width: 300px;
        font-size: 0.813rem;
    }

    .dashboard-grid .card th,
    .dashboard-grid .card td {
        padding: 10px 12px;
    }

    .dashboard-grid .card .empty-state {
        padding: 25px 15px;
    }

    /* Detail items */
    .detail-item {
        padding: 8px 0;
    }

    .detail-item label {
        font-size: 0.813rem;
    }

    /* Calendar */
    .calendar {
        border-radius: 6px;
    }

    .calendar-header {
        padding: 12px;
    }

    .calendar-title h2 {
        font-size: 1rem;
    }

    .calendar-nav .btn {
        padding: 8px 12px;
        font-size: 0.813rem;
    }

    /* Week events */
    .week-day-header {
        padding: 8px 12px;
    }

    .week-day-header .day-name {
        font-size: 0.813rem;
    }

    .week-day-header .day-date {
        font-size: 0.875rem;
    }

    .week-event {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    /* Today's calendar items */
    .today-item {
        padding: 8px 10px;
    }

    .today-item .item-time {
        font-size: 1rem;
        min-width: 60px;
    }

    .today-item .item-content {
        margin-left: 8px;
    }

    .today-item .item-title {
        font-size: 1rem;
    }

    /* Invoice specific */
    .invoice-totals {
        text-align: left;
    }

    .invoice-totals .total-row {
        justify-content: space-between;
        gap: 10px;
    }

    .invoice-totals .grand-total {
        font-size: 1.1rem;
    }

    /* Alerts */
    .alert {
        padding: 10px 12px;
        font-size: 0.875rem;
        border-radius: 6px;
    }

    /* Badges */
    .badge {
        padding: 2px 8px;
        font-size: 0.7rem;
    }

    /* Search form */
    .search-form {
        gap: 8px;
    }

    .search-form input {
        padding: 10px 12px;
        font-size: 16px;
    }

    .search-form .btn {
        width: 100%;
    }

    /* Filter form */
    .filter-form {
        padding: 12px;
        gap: 12px;
    }

    .filter-form .form-group {
        flex: 1 1 100%;
    }

    .filter-form select,
    .filter-form input[type="date"] {
        width: 100%;
        font-size: 16px;
    }

    .filter-form .btn {
        flex: 1;
    }

    /* Filter links */
    .filter-links {
        gap: 6px;
    }

    .filter-links a {
        padding: 8px 12px;
        font-size: 0.813rem;
    }

    /* Empty state */
    .empty-state {
        padding: 30px 20px;
    }

    /* Actions in tables - horizontal wrap */
    .actions {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
    }

    .actions .btn-sm {
        width: auto;
        min-height: 36px;
        padding: 6px 10px;
    }

    /* Auth pages */
    .auth-body {
        padding: 15px;
    }

    .login-container {
        padding: 25px 20px;
    }

    .login-header {
        margin-bottom: 20px;
    }

    .login-header h1 {
        font-size: 1.375rem;
    }

    .login-header p {
        font-size: 0.875rem;
    }

    .login-footer {
        margin-top: 15px;
        padding-top: 15px;
    }

    .company-info-box {
        padding: 12px;
        margin-bottom: 15px;
    }
}

/* Responsive - Very small screens (360px) */
@media (max-width: 360px) {
    .container {
        padding: 10px;
    }

    .topbar-logo img {
        width: 100px;
        max-height: 30px;
    }

    .topbar-logo .logo-text {
        font-size: 0.875rem;
    }

    .page-header h1 {
        font-size: 1.125rem;
    }

    .form-container {
        padding: 12px;
    }

    .card {
        padding: 10px;
    }

    .btn {
        padding: 10px 14px;
        font-size: 0.813rem;
    }

    .calendar-title h2 {
        font-size: 0.875rem;
    }

    .stat-card-small .stat-value {
        font-size: 1.125rem;
    }

    .stat-card-small .stat-label {
        font-size: 0.7rem;
    }

    /* Auth pages */
    .auth-body {
        padding: 10px;
    }

    .login-container {
        padding: 20px 15px;
    }

    .login-header h1 {
        font-size: 1.25rem;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .topbar,
    .sidebar-toggle,
    .page-header .btn,
    .form-actions,
    .actions {
        display: none !important;
    }

    .container {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }

    .card,
    .table-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: white;
    }
}
