/* =====================================================
   Herstel Friesland - Reparatie Systeem
   ===================================================== */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #3b82f6;
    --topbar-height: 60px;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f1f5f9;
}

/* =====================================================
   Layout
   ===================================================== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* =====================================================
   Sidebar
   ===================================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
}

.sidebar-nav {
    list-style: none;
    padding: 15px 0;
    flex: 1;
}

.sidebar-nav .nav-item {
    margin: 2px 10px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 24px;
    margin-right: 12px;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
}

.sidebar-nav .nav-link .badge {
    font-size: 0.7rem;
}

.recent-items-list {
    padding: 0 0 5px 0;
    list-style: none;
}

.recent-items-list li a {
    display: block;
    padding: 3px 10px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 4px;
    transition: all 0.15s;
}

.recent-items-list li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.recent-items-list li a .recent-sub {
    font-size: 0.65rem;
    opacity: 0.6;
}

.sidebar-footer {
    padding: 15px 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer .nav-link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

.sidebar-footer .nav-link i {
    margin-right: 12px;
}

.sidebar-footer .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* =====================================================
   Main Content
   ===================================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* =====================================================
   Topbar
   ===================================================== */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.search-box input {
    padding-left: 40px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.search-box input:focus {
    background: #fff;
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* =====================================================
   Page Content
   ===================================================== */
.page-content {
    padding: 25px;
    flex: 1;
}

.page-header {
    margin-bottom: 25px;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 5px;
}

/* =====================================================
   Cards
   ===================================================== */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 15px 20px;
    font-weight: 600;
}

.card-header h5 {
    margin: 0;
    font-size: 1rem;
}

.card-body {
    padding: 20px;
}

/* Stat Cards */
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* =====================================================
   Tables
   ===================================================== */
.table {
    margin: 0;
}

.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #64748b;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
    padding: 12px 15px;
}

/* =====================================================
   Badges
   ===================================================== */
.badge {
    font-weight: 500;
    padding: 5px 10px;
}

/* Custom badge colors */
.bg-orange {
    background-color: #f97316 !important;
}

.bg-purple {
    background-color: #8b5cf6 !important;
}

.bg-cyan {
    background-color: #06b6d4 !important;
}

/* =====================================================
   Custom Border Colors
   ===================================================== */
.border-orange {
    border-color: #f97316 !important;
}

.border-purple {
    border-color: #8b5cf6 !important;
}

.border-cyan {
    border-color: #06b6d4 !important;
}

/* =====================================================
   Forms
   ===================================================== */
.form-label {
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* =====================================================
   Buttons
   ===================================================== */
.btn {
    font-weight: 500;
    border-radius: 8px;
}

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

.btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* =====================================================
   Sidebar Collapsed State
   ===================================================== */
.sidebar-collapse-btn {
    text-decoration: none !important;
    line-height: 1;
}

.sidebar-collapse-btn:hover {
    opacity: 0.8;
}

.sidebar.collapsed {
    width: 68px;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 20px 10px;
}

.sidebar.collapsed .sidebar-brand {
    display: none;
}

.sidebar.collapsed .sidebar-nav .nav-link span,
.sidebar.collapsed .sidebar-nav .nav-link .badge {
    display: none;
}

.sidebar.collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 12px 10px;
}

.sidebar.collapsed .sidebar-nav .nav-link i {
    margin-right: 0;
    font-size: 1.25rem;
}

.sidebar.collapsed .sidebar-footer .nav-link span {
    display: none;
}

.sidebar.collapsed .sidebar-footer .nav-link {
    justify-content: center;
    padding: 10px;
}

.sidebar.collapsed .sidebar-footer .nav-link i {
    margin-right: 0;
}

.sidebar.collapsed + .main-content {
    margin-left: 68px;
}

.sidebar, .main-content {
    transition: all 0.3s ease;
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

/* =====================================================
   Login Page
   ===================================================== */
.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-logo i {
    color: #fff !important;
}

/* =====================================================
   Tickets Page
   ===================================================== */
.ticket-filters {
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.status-tabs .nav-link {
    color: #64748b;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    margin-right: 5px;
}

.status-tabs .nav-link:hover {
    background: #f1f5f9;
}

.status-tabs .nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
}

/* =====================================================
   Ticket Detail
   ===================================================== */
.ticket-info-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
}

.ticket-info-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.ticket-info-item:last-child {
    border-bottom: none;
}

.ticket-info-label {
    width: 140px;
    color: #64748b;
    font-weight: 500;
}

.ticket-info-value {
    flex: 1;
    color: #1e293b;
}

/* Memo Timeline */
.memo-timeline {
    position: relative;
    padding-left: 30px;
}

.memo-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.memo-item {
    position: relative;
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
}

.memo-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 20px;
    width: 10px;
    height: 10px;
    background: var(--sidebar-active);
    border-radius: 50%;
}

.memo-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #64748b;
}

/* =====================================================
   Balie / Kassa
   ===================================================== */
.balie-wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: calc(100vh - var(--topbar-height) - 50px);
}

.product-search-input {
    font-size: 1.5rem;
    padding: 15px 20px;
    text-align: center;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
}

.cart-item-price {
    color: #64748b;
    font-size: 0.9rem;
}

.cart-item-qty {
    width: 60px;
    text-align: center;
}

.cart-total {
    background: #f8fafc;
    padding: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

/* =====================================================
   Print Styles
   ===================================================== */
@media print {
    .sidebar,
    .topbar,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .page-content {
        padding: 0;
    }
}

/* =====================================================
   Autosave Icons & Animations
   ===================================================== */
.autosave-icon {
    min-width: 32px;
    justify-content: center;
    background: transparent;
    border-left: none;
}

.autosave-icon i {
    font-size: 0.9rem;
}

/* Spin animation for loading icon */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Cursor pointer for clickable rows */
.cursor-pointer {
    cursor: pointer;
}

/* =====================================================
   Form Validation Styling
   ===================================================== */
.form-control.is-invalid,
.form-select.is-invalid {
    border: 1px solid #dc3545 !important;
    background-image: none; /* Verwijder Bootstrap's standaard icon */
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}
