/* ============================================
   DekerSoft AgriBusiness Suite
   Premium ERP Stylesheet
   ============================================ */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
    /* Primary Palette — Nature/Agriculture Inspired */
    --ds-primary: #1B7A4A;
    --ds-primary-light: #23995D;
    --ds-primary-dark: #145A37;
    --ds-primary-50: rgba(27, 122, 74, 0.08);
    --ds-primary-100: rgba(27, 122, 74, 0.15);

    /* Accent */
    --ds-accent: #E8A838;
    --ds-accent-light: #F0BD5C;
    --ds-accent-dark: #C88E2A;

    /* Semantic Colors */
    --ds-success: #22C55E;
    --ds-warning: #F59E0B;
    --ds-danger: #EF4444;
    --ds-info: #3B82F6;

    /* Neutrals */
    --ds-bg: #F0F2F5;
    --ds-bg-card: #FFFFFF;
    --ds-bg-sidebar: #0F172A;
    --ds-bg-sidebar-hover: #1E293B;
    --ds-bg-navbar: #FFFFFF;
    --ds-text: #1E293B;
    --ds-text-secondary: #64748B;
    --ds-text-muted: #94A3B8;
    --ds-border: #E2E8F0;
    --ds-border-light: #F1F5F9;

    /* Sidebar */
    --ds-sidebar-width: 280px;
    --ds-sidebar-collapsed: 72px;
    --ds-sidebar-text: #CBD5E1;
    --ds-sidebar-icon: #94A3B8;
    --ds-sidebar-active: var(--ds-primary);

    /* Typography */
    --ds-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ds-font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Shadows */
    --ds-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ds-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --ds-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --ds-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    /* Radius */
    --ds-radius: 8px;
    --ds-radius-lg: 12px;
    --ds-radius-xl: 16px;

    /* Transitions */
    --ds-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --ds-transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme */
[data-bs-theme="dark"] {
    --ds-bg: #0F172A;
    --ds-bg-card: #1E293B;
    --ds-bg-navbar: #1E293B;
    --ds-text: #F1F5F9;
    --ds-text-secondary: #94A3B8;
    --ds-text-muted: #64748B;
    --ds-border: #334155;
    --ds-border-light: #1E293B;
    --ds-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --ds-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
}

/* ============================================
   Base & Reset
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--ds-font);
    font-size: 14px;
    color: var(--ds-text);
    background-color: var(--ds-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.app-main {
    flex: 1;
    margin-left: var(--ds-sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--ds-transition-slow);
}

.app-content {
    flex: 1;
    padding: 0;
}

/* ============================================
   Sidebar
   ============================================ */
.app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--ds-sidebar-width);
    background: var(--ds-bg-sidebar);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: var(--ds-transition-slow);
    overflow: hidden;
}

.sidebar-header {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--ds-primary), var(--ds-primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(27, 122, 74, 0.3);
}

.brand-name {
    display: block;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    display: block;
    color: var(--ds-sidebar-icon);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--ds-sidebar-icon);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: var(--ds-transition);
}

.sidebar-toggle:hover {
    color: #fff;
    background: var(--ds-bg-sidebar-hover);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-separator {
    padding: 24px 12px 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ds-primary, #4ade80);
    display: flex;
    align-items: center;
}

.nav-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin-left: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--ds-radius);
    transition: var(--ds-transition);
    font-size: 13.5px;
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--ds-primary-light);
    transform: translateX(4px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-left: 3px solid var(--ds-primary-light);
}

.nav-link.active .nav-icon {
    color: var(--ds-primary-light);
}

.nav-icon {
    font-size: 23px;
    color: var(--ds-sidebar-icon);
    transition: var(--ds-transition);
    flex-shrink: 0;
}

.nav-link:hover .nav-icon {
    color: var(--ds-primary-light);
}

.nav-arrow {
    margin-left: auto;
    font-size: 14px;
    transition: transform 0.2s;
}

.nav-item.open > .nav-link .nav-arrow {
    transform: rotate(90deg);
}

.nav-badge {
    margin-left: auto;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

/* Submenu */
.nav-submenu {
    list-style: none;
    padding: 4px 0 4px 44px;
    margin: 0;
    display: none;
}

.nav-item.open > .nav-submenu {
    display: block;
}

.nav-sublink {
    display: block;
    padding: 7px 12px;
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    border-radius: 6px;
    transition: var(--ds-transition);
    border-left: 2px solid transparent;
}

.nav-sublink:hover {
    color: var(--ds-primary-light);
    background: rgba(255, 255, 255, 0.04);
    border-left-color: var(--ds-primary-light);
    transform: translateX(4px);
}

.nav-sublink.active {
    color: var(--ds-primary-light);
    background: rgba(255, 255, 255, 0.06);
    border-left-color: var(--ds-primary-light);
    font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    font-size: 28px;
    color: var(--ds-sidebar-icon);
}

.user-info {
    overflow: hidden;
}

.user-name {
    display: block;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    display: block;
    color: var(--ds-text-muted);
    font-size: 11px;
}

/* ============================================
   Top Navbar
   ============================================ */
.app-navbar {
    background: var(--ds-bg-navbar);
    border-bottom: 1px solid var(--ds-border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1040;
    box-shadow: var(--ds-shadow-sm);
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-search {
    position: relative;
    width: 360px;
}

.navbar-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ds-text-muted);
    font-size: 18px;
}

.navbar-search .form-control {
    padding-left: 40px;
    padding-right: 70px;
    height: 40px;
    background: var(--ds-bg);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    font-size: 13px;
    transition: var(--ds-transition);
}

.navbar-search .form-control:focus {
    background: var(--ds-bg-card);
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px var(--ds-primary-50);
}

.search-shortcut {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    padding: 2px 6px;
    background: var(--ds-bg);
    border: 1px solid var(--ds-border);
    border-radius: 4px;
    color: var(--ds-text-muted);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--ds-text-secondary);
    border-radius: var(--ds-radius);
    transition: var(--ds-transition);
    font-size: 24px;
}

.btn-icon i {
    font-size: 24px;
}

.btn-icon:hover, .btn-action:hover {
    background: var(--ds-primary-50);
    color: var(--ds-primary);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--ds-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.btn-user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: var(--ds-radius);
    transition: var(--ds-transition);
    color: var(--ds-text);
    font-size: 13px;
    font-weight: 500;
}

.btn-user-menu:hover {
    background: var(--ds-primary-50);
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    background: var(--ds-primary-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ds-primary);
    font-size: 18px;
}

/* ============================================
   Content Area
   ============================================ */
.content-header {
    padding: 20px 24px 12px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--ds-text);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.breadcrumb {
    font-size: 12px;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--ds-text-muted);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--ds-primary);
}

.breadcrumb-item.active {
    color: var(--ds-text-secondary);
}

.content-body {
    padding: 0 24px 24px;
}

/* ============================================
   Cards — Premium Style
   ============================================ */
.card {
    background: var(--ds-bg-card);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-sm);
    transition: var(--ds-transition);
}

.card:hover {
    box-shadow: var(--ds-shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--ds-border-light);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 14px;
}

.card-body {
    padding: 20px;
}

/* KPI Cards */
.kpi-card {
    position: relative;
    overflow: hidden;
    border: none;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.kpi-card.kpi-sales::before { background: linear-gradient(90deg, var(--ds-primary), var(--ds-primary-light)); }
.kpi-card.kpi-products::before { background: linear-gradient(90deg, var(--ds-info), #60A5FA); }
.kpi-card.kpi-clients::before { background: linear-gradient(90deg, var(--ds-accent), var(--ds-accent-light)); }
.kpi-card.kpi-alerts::before { background: linear-gradient(90deg, var(--ds-danger), #F87171); }

.kpi-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.kpi-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--ds-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-change {
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
}

.kpi-change.positive {
    color: var(--ds-success);
    background: rgba(34, 197, 94, 0.1);
}

.kpi-change.negative {
    color: var(--ds-danger);
    background: rgba(239, 68, 68, 0.1);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--ds-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.kpi-icon.icon-sales { background: var(--ds-primary-50); color: var(--ds-primary); }
.kpi-icon.icon-products { background: rgba(59, 130, 246, 0.1); color: var(--ds-info); }
.kpi-icon.icon-clients { background: rgba(232, 168, 56, 0.1); color: var(--ds-accent); }
.kpi-icon.icon-alerts { background: rgba(239, 68, 68, 0.1); color: var(--ds-danger); }

/* ============================================
   Tables — Premium Style
   ============================================ */
.table {
    font-size: 13px;
}

.table thead th {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ds-text-secondary);
    border-bottom: 2px solid var(--ds-border);
    padding: 12px 16px;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--ds-border-light);
}

.table tbody tr {
    transition: var(--ds-transition);
}

.table tbody tr:hover {
    background: var(--ds-primary-50);
}

/* ============================================
   Buttons — Premium Style
   ============================================ */
.btn {
    font-weight: 500;
    font-size: 13px;
    border-radius: var(--ds-radius);
    padding: 8px 16px;
    transition: var(--ds-transition);
    letter-spacing: -0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--ds-primary), var(--ds-primary-light));
    border: none;
    box-shadow: 0 2px 8px rgba(27, 122, 74, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--ds-primary-dark), var(--ds-primary));
    box-shadow: 0 4px 12px rgba(27, 122, 74, 0.35);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--ds-success), #4ADE80);
    border: none;
}

.btn-outline-primary {
    color: var(--ds-primary);
    border-color: var(--ds-primary);
}

.btn-outline-primary:hover {
    background: var(--ds-primary);
    border-color: var(--ds-primary);
}

/* ============================================
   Badges — Premium Style
   ============================================ */
.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge i {
    font-size: 14px;
}

.status-badge.status-active { background: rgba(34, 197, 94, 0.1); color: var(--ds-success); }
.status-badge.status-inactive { background: rgba(100, 116, 139, 0.1); color: var(--ds-text-secondary); }
.status-badge.status-warning { background: rgba(245, 158, 11, 0.1); color: var(--ds-warning); }
.status-badge.status-danger { background: rgba(239, 68, 68, 0.1); color: var(--ds-danger); }

/* ============================================
   Forms — Premium Style
   ============================================ */
.form-control, .form-select {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    font-size: 13px;
    padding: 10px 14px;
    transition: var(--ds-transition);
    background: var(--ds-bg-card);
    color: var(--ds-text);
}

.form-control:focus, .form-select:focus {
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 3px var(--ds-primary-50);
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ds-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
}

/* ============================================
   POS (Point of Sale) — Special Layout
   ============================================ */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 16px;
    height: calc(100vh - 100px);
    min-height: 720px;
}

.pos-products {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-search {
    position: relative;
    margin-bottom: 16px;
}

.pos-search .form-control {
    height: 48px;
    font-size: 15px;
    padding-left: 44px;
    border-radius: var(--ds-radius-lg);
    background: var(--ds-bg-card);
    border: 2px solid var(--ds-border);
}

.pos-search .form-control:focus {
    border-color: var(--ds-primary);
    box-shadow: 0 0 0 4px var(--ds-primary-50);
}

.pos-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ds-text-muted);
    font-size: 20px;
}

.pos-cart {
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-xl);
    border: 1px solid var(--ds-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--ds-shadow-md);
}

.pos-cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ds-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pos-cart-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.pos-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--ds-radius);
    border: 1px solid var(--ds-border-light);
    margin-bottom: 8px;
    transition: var(--ds-transition);
}

.pos-cart-item:hover {
    border-color: var(--ds-primary-100);
    background: var(--ds-primary-50);
}

.pos-cart-item .item-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.pos-cart-item .item-qty {
    width: 50px;
    text-align: center;
    font-size: 13px;
    padding: 4px;
    border-radius: 6px;
    border: 1px solid var(--ds-border);
}

.pos-cart-item .item-price {
    font-weight: 600;
    font-size: 13px;
    min-width: 60px;
    text-align: right;
}

.pos-cart-item .item-remove {
    color: var(--ds-danger);
    cursor: pointer;
    font-size: 16px;
    transition: var(--ds-transition);
}

.pos-cart-totals {
    padding: 8px 16px;
    border-top: 2px solid var(--ds-border);
    background: var(--ds-bg);
}

.pos-total-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 12px;
}

.pos-total-row.total-final {
    font-size: 16px;
    font-weight: 800;
    color: var(--ds-primary);
    padding: 4px 0;
    border-top: 1px solid var(--ds-border);
    margin-top: 4px;
}

.pos-cart-actions {
    padding: 8px 16px;
    border-top: 1px solid var(--ds-border-light);
}

.btn-pos-pay {
    width: 100%;
    height: 42px;
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--ds-primary), var(--ds-primary-light));
    border: none;
    color: #fff;
    border-radius: var(--ds-radius-lg);
    box-shadow: 0 2px 8px rgba(27, 122, 74, 0.3);
    transition: var(--ds-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-pos-pay:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 122, 74, 0.4);
    background: linear-gradient(135deg, var(--ds-primary-dark), var(--ds-primary));
    color: #fff;
}

/* POS Keyboard Shortcuts Bar */
.pos-shortcuts {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    font-size: 13px;
    color: var(--ds-text);
    font-weight: 500;
}

.pos-shortcut {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pos-shortcut kbd {
    font-size: 11px;
    padding: 3px 6px;
    background: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid #1e293b;
    border-radius: 4px;
    font-family: var(--ds-font-mono);
    opacity: 1 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Footer
   ============================================ */
.app-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--ds-border);
    background: var(--ds-bg-card);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--ds-text-muted);
}

/* ============================================
   Notification Dropdown
   ============================================ */
.notification-dropdown {
    width: 360px;
    padding: 0;
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-lg);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ds-border-light);
}

.notification-header h6 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.mark-all-read {
    font-size: 12px;
    color: var(--ds-primary);
    text-decoration: none;
}

.notification-body {
    max-height: 320px;
    overflow-y: auto;
}

.notification-empty {
    text-align: center;
    padding: 24px;
    color: var(--ds-text-muted);
}

.notification-empty i {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.notification-footer {
    text-align: center;
    padding: 10px;
    border-top: 1px solid var(--ds-border-light);
}

.notification-footer a {
    font-size: 12px;
    color: var(--ds-primary);
    text-decoration: none;
    font-weight: 500;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.card {
    animation: fadeIn 0.3s ease-out;
}

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

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

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

    .navbar-search {
        width: 200px;
    }

    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .content-body {
        padding: 0 16px 16px;
    }
}

@media (max-width: 575.98px) {
    .navbar-search {
        display: none;
    }

    .content-header {
        padding: 16px;
    }

    .kpi-value {
        font-size: 22px;
    }

    /* Force overflow auto for tables on small screens to prevent layout breakage */
    .table:not(.table-borderless) {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   DataTables Override
   ============================================ */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    padding: 6px 12px;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    padding: 4px 8px;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--ds-primary) !important;
    color: #fff !important;
    border-color: var(--ds-primary) !important;
    border-radius: var(--ds-radius);
}

/* ============================================
   Login Page
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0F172A 0%, #1E3A28 50%, #0F172A 100%);
    padding: 16px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--ds-bg-card);
    border-radius: var(--ds-radius-xl);
    box-shadow: var(--ds-shadow-lg);
    padding: 40px;
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand .brand-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    font-size: 28px;
}

.login-brand h1 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.login-brand p {
    color: var(--ds-text-muted);
    font-size: 13px;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-primary { color: var(--ds-primary) !important; }
.bg-primary-subtle { background-color: var(--ds-primary-50) !important; }
.border-primary { border-color: var(--ds-primary) !important; }
.fw-800 { font-weight: 800; }
.gap-lg { gap: 24px; }
.rounded-xl { border-radius: var(--ds-radius-xl); }

/* Custom Home Icon Sizing */
.breadcrumb-item a .ti-home {
    font-size: 18px !important;
    vertical-align: -2px;
    color: var(--ds-primary);
    transition: var(--ds-transition);
}
.breadcrumb-item a .ti-home:hover {
    color: var(--ds-primary-light);
}

/* Print Stylesheet Helpers */
@media print {
    .no-print, 
    .app-sidebar, 
    .app-navbar, 
    .sidebar-toggle, 
    .btn-action, 
    .page-actions, 
    .card-header .no-print, 
    .card-footer, 
    .list-group,
    .btn,
    footer {
        display: none !important;
    }
    .app-main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    body {
        background: #fff !important;
        color: #000 !important;
    }
    body.printing > .app-wrapper,
    body.printing > .modal-backdrop,
    body.printing > .modal {
        display: none !important;
    }
    body.printing > #print-container {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        background: #fff;
    }
}
