/* ============================================
   BAHARI MOTOR SERVICE — Design System
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

/* ---------- CSS Custom Properties (Design Tokens) ---------- */
:root {
    /* Primary */
    --primary: #1e3a5f;
    --primary-light: #2e5a8f;
    --primary-dark: #152b47;
    --primary-50: #ebf0f7;

    /* Accent */
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --accent-light: #fef3c7;

    /* Semantic */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    /* Background */
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #1e3a5f;
    --bg-sidebar-hover: #2e5a8f;
    --bg-sidebar-active: rgba(245, 158, 11, 0.15);

    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    --text-sidebar: rgba(255, 255, 255, 0.75);
    --text-sidebar-active: #f59e0b;

    /* Border */
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-full: 9999px;

    /* Shadow */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md:
        0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg:
        0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --topbar-height: 64px;

    /* Transition */
    --transition-fast: 150ms ease;
    --transition: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    display: block;
}

/* ---------- App Layout ---------- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-layout.sidebar-collapsed .app-main {
    margin-left: var(--sidebar-collapsed-width);
}

.app-content {
    flex: 1;
    padding: 24px;
    margin-top: var(--topbar-height);
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(
        180deg,
        var(--primary) 0%,
        var(--primary-dark) 100%
    );
    color: var(--text-white);
    z-index: 1000;
    transition: width var(--transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-layout.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 64px;
}

.sidebar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--transition-fast);
}

.app-layout.sidebar-collapsed .sidebar-brand .brand-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    padding: 16px 20px 8px;
    white-space: nowrap;
}

.app-layout.sidebar-collapsed .nav-section-title {
    text-align: center;
    padding: 16px 8px 8px;
    font-size: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-sidebar);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    white-space: nowrap;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-white);
}

.nav-item.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    border-left-color: var(--accent);
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-item .nav-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-item .nav-label {
    font-size: 13.5px;
    font-weight: 500;
    opacity: 1;
    transition: opacity var(--transition-fast);
}

.app-layout.sidebar-collapsed .nav-item .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.app-layout.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 12px;
    border-left-width: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: var(--border-radius-full);
    min-width: 20px;
    text-align: center;
}

.app-layout.sidebar-collapsed .nav-item .nav-badge {
    position: absolute;
    top: 6px;
    right: 10px;
    font-size: 10px;
    padding: 1px 5px;
}

/* Submenu / Child nav */
.nav-submenu {
    overflow: hidden;
    max-height: 0;
    transition: max-height var(--transition);
}

.nav-submenu.open {
    max-height: 200px;
}

.nav-submenu .nav-item {
    padding-left: 52px;
    font-size: 13px;
    border-left: none;
}

.nav-submenu .nav-item::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    position: absolute;
    left: 32px;
    transition: background var(--transition-fast);
}

.nav-submenu .nav-item.active::before,
.nav-submenu .nav-item:hover::before {
    background: var(--accent);
}

.nav-toggle-icon {
    margin-left: auto;
    transition: transform var(--transition-fast);
}

.nav-toggle-icon.rotated {
    transform: rotate(180deg);
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
}

/* ---------- Topbar ---------- */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 900;
    transition: left var(--transition);
    box-shadow: var(--shadow-sm);
}

.app-layout.sidebar-collapsed .topbar {
    left: var(--sidebar-collapsed-width);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.topbar-toggle:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.topbar-toggle svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.topbar-search {
    position: relative;
    width: 320px;
}

.topbar-search input {
    width: 100%;
    padding: 8px 12px 8px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-full);
    background: var(--bg-main);
    font-family: inherit;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-fast);
}

.topbar-search input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(46, 90, 143, 0.1);
    background: var(--bg-card);
}

.topbar-search input::placeholder {
    color: var(--text-muted);
}

.topbar-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.topbar-search .search-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
    position: relative;
}

.topbar-icon-btn:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.topbar-icon-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
}

.topbar-icon-btn .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.topbar-divider {
    width: 1px;
    height: 32px;
    background: var(--border-color);
    margin: 0 4px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--border-radius);
    transition: background var(--transition-fast);
}

.topbar-user:hover {
    background: var(--bg-main);
}

.topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.topbar-user-info {
    line-height: 1.3;
}

.topbar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ---------- Page Header ---------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-header .breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.page-header .breadcrumb a {
    color: var(--text-secondary);
}

.page-header .breadcrumb a:hover {
    color: var(--primary-light);
}

.page-header .breadcrumb .separator {
    font-size: 10px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: box-shadow var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---------- Stat Cards ---------- */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.stat-card.stat-revenue::before {
    background: var(--primary-light);
}
.stat-card.stat-transactions::before {
    background: var(--accent);
}
.stat-card.stat-queue::before {
    background: var(--success);
}
.stat-card.stat-lowstock::before {
    background: var(--danger);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card-content {
    flex: 1;
}

.stat-card-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 4px;
    line-height: 1.2;
}

.stat-card-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: var(--border-radius-full);
}

.stat-card-change.positive {
    color: var(--success);
    background: var(--success-light);
}

.stat-card-change.negative {
    color: var(--danger);
    background: var(--danger-light);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
}

.stat-card.stat-revenue .stat-card-icon {
    background: var(--primary-50);
    color: var(--primary-light);
}

.stat-card.stat-transactions .stat-card-icon {
    background: var(--accent-light);
    color: var(--accent-hover);
}

.stat-card.stat-queue .stat-card-icon {
    background: var(--success-light);
    color: var(--success);
}

.stat-card.stat-lowstock .stat-card-icon {
    background: var(--danger-light);
    color: var(--danger);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-main);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 15px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--border-radius);
}

/* ---------- Tables ---------- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--border-radius-lg);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    background: var(--bg-main);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background: rgba(241, 245, 249, 0.5);
}

.data-table tbody td {
    padding: 12px 16px;
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table .actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--border-radius-full);
    white-space: nowrap;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}
.badge-warning {
    background: var(--warning-light);
    color: var(--accent-hover);
}
.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}
.badge-info {
    background: var(--info-light);
    color: var(--info);
}
.badge-neutral {
    background: var(--bg-main);
    color: var(--text-secondary);
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-card);
    outline: none;
    transition: all var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(46, 90, 143, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn var(--transition-fast);
}

.modal-backdrop.show {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    width: 480px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp var(--transition);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ---------- Kanban Board ---------- */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    align-items: flex-start;
}

.kanban-column {
    background: var(--bg-main);
    border-radius: var(--border-radius-lg);
    padding: 16px;
    min-height: 300px;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid transparent;
}

.kanban-column.col-waiting .kanban-column-header {
    border-color: var(--info);
}
.kanban-column.col-estimasi .kanban-column-header {
    border-color: var(--warning);
}
.kanban-column.col-wip .kanban-column-header {
    border-color: var(--accent);
}
.kanban-column.col-selesai .kanban-column-header {
    border-color: var(--success);
}

.kanban-column-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-count {
    background: var(--bg-card);
    border-radius: var(--border-radius-full);
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

.kanban-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.kanban-card.priority-high {
    border-left-color: var(--danger);
}
.kanban-card.priority-medium {
    border-left-color: var(--warning);
}
.kanban-card.priority-low {
    border-left-color: var(--success);
}

.kanban-card-plate {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.kanban-card-vehicle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.kanban-card-mechanic {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.kanban-card-mechanic .mechanic-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--primary-light);
}

/* ---------- POS Layout ---------- */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    height: calc(100vh - var(--topbar-height) - 48px);
}

.pos-catalog {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
}

.pos-catalog-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.pos-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
}

.pos-tab {
    flex: 1;
    padding: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pos-tab:first-child {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.pos-tab:last-child {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    border-left: none;
}

.pos-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pos-products-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    align-content: flex-start;
}

.pos-product-card {
    background: var(--bg-main);
    border-radius: var(--border-radius);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.pos-product-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.pos-product-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    background: var(--primary-50);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.pos-product-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-product-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-hover);
}

.pos-nota {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.pos-nota-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.pos-nota-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.pos-nota-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
}

.pos-nota-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.pos-nota-item:last-child {
    border-bottom: none;
}

.nota-item-info {
    flex: 1;
}

.nota-item-name {
    font-size: 13px;
    font-weight: 500;
}

.nota-item-qty {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.nota-item-price {
    font-weight: 600;
    white-space: nowrap;
}

.nota-item-remove {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    margin-left: 8px;
    transition: all var(--transition-fast);
}

.nota-item-remove:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.pos-nota-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
}

.nota-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.nota-summary-row.total {
    font-size: 18px;
    font-weight: 700;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid var(--text-primary);
    color: var(--text-primary);
}

.btn-pay {
    width: 100%;
    padding: 14px;
    margin-top: 12px;
    font-size: 15px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-pay:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-pay svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* ---------- Grid Layouts ---------- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-links a,
.pagination-links span {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.pagination-links a:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.pagination-links .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.empty-state-text {
    font-size: 13px;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ---------- Toast Notifications ---------- */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    font-weight: 500;
    animation: slideDown var(--transition);
    border-left: 4px solid var(--primary);
    min-width: 300px;
}

.toast.toast-success {
    border-left-color: var(--success);
}
.toast.toast-warning {
    border-left-color: var(--warning);
}
.toast.toast-danger {
    border-left-color: var(--danger);
}

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
    .sidebar {
        width: var(--sidebar-collapsed-width);
    }

    .sidebar .brand-text,
    .sidebar .nav-label,
    .sidebar .nav-section-title {
        opacity: 0;
        width: 0;
        overflow: hidden;
    }

    .sidebar .nav-item {
        justify-content: center;
        padding: 12px;
        border-left-width: 0;
    }

    .app-main {
        margin-left: var(--sidebar-collapsed-width);
    }

    .topbar {
        left: var(--sidebar-collapsed-width);
    }

    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .pos-layout {
        grid-template-columns: 1fr 340px;
    }
}

@media (max-width: 767px) {
    .sidebar {
        width: var(--sidebar-width);
        transform: translateX(-100%);
        transition: transform var(--transition);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar .brand-text,
    .sidebar .nav-label,
    .sidebar .nav-section-title {
        opacity: 1;
        width: auto;
        overflow: visible;
    }

    .sidebar .nav-item {
        justify-content: flex-start;
        padding: 10px 20px;
        border-left-width: 3px;
    }

    .app-main {
        margin-left: 0;
    }

    .topbar {
        left: 0;
    }

    .topbar-search {
        display: none;
    }

    .topbar-user-info {
        display: none;
    }

    .app-content {
        padding: 16px;
    }

    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .kanban-board {
        grid-template-columns: 1fr;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .mobile-overlay.show {
        display: block;
    }
}

/* ---------- Utility Classes ---------- */
.text-center {
    text-align: center;
}
.text-right {
    text-align: right;
}
.text-muted {
    color: var(--text-muted);
}
.text-success {
    color: var(--success);
}
.text-danger {
    color: var(--danger);
}
.text-warning {
    color: var(--warning);
}
.font-bold {
    font-weight: 700;
}
.mt-1 {
    margin-top: 8px;
}
.mt-2 {
    margin-top: 16px;
}
.mt-3 {
    margin-top: 24px;
}
.mb-1 {
    margin-bottom: 8px;
}
.mb-2 {
    margin-bottom: 16px;
}
.mb-3 {
    margin-bottom: 24px;
}
.gap-sm {
    gap: 8px;
}
.flex {
    display: flex;
}
.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
.w-full {
    width: 100%;
}

/* ---------- Grid Utilities ---------- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.text-right {
    text-align: right;
}

/* ---------- POS Layout ---------- */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    height: calc(100vh - var(--topbar-height) - 48px);
    min-height: 600px;
}

.pos-catalog {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.pos-items-grid::-webkit-scrollbar {
    width: 4px;
}

.pos-items-grid::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.pos-item-card {
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 14px 10px;
    text-align: center;
    transition: all var(--transition-fast);
    user-select: none;
}

.pos-item-card:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pos-item-card:active {
    transform: scale(0.96);
}

.pos-nota {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ---------- Kanban Board ---------- */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    min-height: 500px;
}

.kanban-column {
    background: var(--bg-main);
    border-radius: var(--border-radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--border-radius);
    padding: 10px 14px;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
}

.kanban-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* ---------- Modal Styling (Livewire) ---------- */
.modal-backdrop.show {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-main);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Actions Group ---------- */
.actions {
    display: flex;
    gap: 4px;
}

/* ---------- Pagination (Livewire) ---------- */
nav[role="navigation"] {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

nav[role="navigation"] span,
nav[role="navigation"] a,
nav[role="navigation"] button {
    padding: 6px 12px;
    border-radius: var(--border-radius);
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

nav[role="navigation"] span[aria-current="page"],
nav[role="navigation"] .relative span:first-child {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

nav[role="navigation"] a:hover,
nav[role="navigation"] button:hover {
    background: var(--bg-main);
    color: var(--primary);
}

nav[role="navigation"] span[aria-disabled="true"] {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- Responsive: POS ---------- */
@media (max-width: 1024px) {
    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .pos-nota {
        max-height: 500px;
    }
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .pos-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    .kanban-board {
        grid-template-columns: 1fr;
    }
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== Pagination ========== */
.pagination-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 4px;
}

.page-item .page-link,
.page-item span.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.page-item .page-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.page-item.active .page-link,
.page-item.active span.page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 700;
    cursor: default;
}

.page-item.disabled .page-link,
.page-item.disabled span.page-link {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-info {
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .pagination-nav {
        justify-content: center;
    }
    .pagination-info {
        width: 100%;
        text-align: center;
    }
}
