/* ============================================
   RegisterPharma - Main Stylesheet
   Modern, polished pharmacy management UI
   ============================================ */

/* ---------- ANIMATIONS ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.04); }
}
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,0.25); }
    50%      { box-shadow: 0 0 0 8px rgba(37,99,235,0); }
}

/* ---------- VARIABLES ---------- */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-darker: #1e40af;
    --primary-light: #dbeafe;
    --primary-lighter: #eff6ff;
    --primary-glow: rgba(37, 99, 235, 0.18);
    --success: #16a34a;
    --success-dark: #15803d;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --warning-light: #fef3c7;
    --info: #0891b2;
    --info-dark: #0e7490;
    --info-light: #cffafe;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.06);
    --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.18);
    --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.04);
    --transition-fast: 0.15s cubic-bezier(.4,0,.2,1);
    --transition: 0.25s cubic-bezier(.4,0,.2,1);
    --transition-slow: 0.35s cubic-bezier(.4,0,.2,1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--gray-800);
    background: linear-gradient(135deg, #f0f4f8 0%, var(--gray-100) 50%, #eef2f7 100%);
    background-attachment: fixed;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--primary-dark); }

hr {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 20px 0;
}

img { max-width: 100%; height: auto; }

::selection {
    background: var(--primary-light);
    color: var(--primary-darker);
}

/* Scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); background-clip: content-box; }

/* Firefox scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--gray-300) transparent; }

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

/* ---------- SIDEBAR ---------- */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0c1222 0%, #162033 50%, #1a2744 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15), 1px 0 0 rgba(255,255,255,0.03);
}

.sidebar-brand {
    padding: 0 22px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--header-height);
    background: rgba(0,0,0,0.18);
    position: relative;
}

.sidebar-brand::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 22px;
    right: 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(96,165,250,0.2), transparent);
}

.sidebar-brand svg {
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.5));
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 18px 0 10px;
}

.nav-section {
    padding: 20px 22px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(148,163,184,0.5);
    font-weight: 700;
}

.nav-section:first-child { padding-top: 4px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    margin: 2px 12px;
    color: rgba(148,163,184,0.85);
    font-size: 13.5px;
    font-weight: 450;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    border-left: none;
    position: relative;
}

.nav-link:hover {
    background: rgba(255,255,255,0.07);
    color: #e2e8f0;
    transform: translateX(2px);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(37,99,235,0.22) 0%, rgba(96,165,250,0.1) 100%);
    color: #fff;
    font-weight: 550;
    box-shadow: inset 0 0 0 1px rgba(96,165,250,0.12), 0 2px 8px rgba(37,99,235,0.15);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #60a5fa, var(--primary));
    box-shadow: 0 0 12px rgba(37,99,235,0.4);
}

.nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.45;
    transition: all var(--transition-fast);
}

.nav-link:hover svg { opacity: 0.75; }
.nav-link.active svg { opacity: 1; filter: drop-shadow(0 0 4px rgba(96,165,250,0.3)); }

.sidebar-footer {
    padding: 16px 22px;
    border-top: 1px solid rgba(255,255,255,0.04);
    font-size: 11px;
    color: rgba(148,163,184,0.35);
    letter-spacing: 0.01em;
    background: rgba(0,0,0,0.08);
}

/* ---------- MAIN CONTENT ---------- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    background: transparent;
    min-height: 100vh;
}

/* ---------- TOP HEADER ---------- */
.top-header {
    height: var(--header-height);
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(226,232,240,0.7);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--gray-600);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.menu-toggle:hover { background: var(--gray-100); color: var(--gray-800); }

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--gray-600);
    padding: 5px 14px 5px 5px;
    border-radius: 50px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    transition: all var(--transition);
    cursor: default;
}

.user-info:hover {
    background: #fff;
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
    letter-spacing: 0.02em;
}

.user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-800);
    line-height: 1.3;
}

.user-role {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 450;
}

/* ---------- PAGE CONTENT ---------- */
.page-content {
    padding: 32px;
    animation: fadeIn 0.4s ease;
    max-width: 1600px;
}

/* ============================================
   COMPONENTS
   ============================================ */

/* ---------- CARDS ---------- */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow), 0 0 0 1px rgba(0,0,0,0.03);
    border: none;
    transition: box-shadow var(--transition), transform var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(0,0,0,0.03);
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
}

.card-header h2, .card-header h3 {
    font-size: 15px;
    font-weight: 650;
    margin: 0;
    color: var(--gray-800);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

.card-body p {
    margin-bottom: 6px;
    font-size: 13.5px;
    line-height: 1.6;
}

.card-body p:last-child {
    margin-bottom: 0;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ---------- STAT CARDS ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow), 0 0 0 1px rgba(0,0,0,0.03);
    border: none;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card:nth-child(1)::before { background: linear-gradient(90deg, var(--primary), #60a5fa); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, var(--success), #4ade80); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, var(--danger), #f87171); }

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    opacity: 0.04;
    transform: translate(30%, -30%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.stat-card:hover .stat-icon {
    transform: scale(1.08) rotate(-2deg);
}

.stat-icon.blue { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); color: var(--primary); box-shadow: 0 4px 12px rgba(37,99,235,0.12); }
.stat-icon.green { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); color: var(--success); box-shadow: 0 4px 12px rgba(22,163,74,0.12); }
.stat-icon.red { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); color: var(--danger); box-shadow: 0 4px 12px rgba(220,38,38,0.12); }
.stat-icon.orange { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: var(--warning); box-shadow: 0 4px 12px rgba(245,158,11,0.12); }
.stat-icon.cyan { background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%); color: var(--info); box-shadow: 0 4px 12px rgba(8,145,178,0.12); }

.stat-card:nth-child(1)::after { background: var(--primary); }
.stat-card:nth-child(2)::after { background: var(--success); }
.stat-card:nth-child(3)::after { background: var(--warning); }
.stat-card:nth-child(4)::after { background: var(--danger); }

.stat-content { flex: 1; min-width: 0; }
.stat-value {
    font-size: 26px;
    font-weight: 750;
    color: var(--gray-900);
    letter-spacing: -0.03em;
    line-height: 1.2;
}
.stat-value small {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-500);
    letter-spacing: 0;
}
.stat-label {
    font-size: 12.5px;
    color: var(--gray-500);
    margin-top: 4px;
    font-weight: 450;
}

/* ---------- TABLES ---------- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table th {
    background: var(--gray-50);
    padding: 12px 18px;
    text-align: left;
    font-size: 11px;
    font-weight: 650;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

table td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13.5px;
    vertical-align: middle;
    transition: background var(--transition-fast);
}

table td strong {
    font-weight: 600;
    color: var(--gray-800);
}

table tbody tr {
    transition: background var(--transition-fast);
}

table tbody tr:hover {
    background: rgba(37,99,235,0.03);
}

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

table .text-right { text-align: right; }
table .text-center { text-align: center; }
table .text-nowrap { white-space: nowrap; }

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 550;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    font-family: inherit;
    text-decoration: none;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
    letter-spacing: -0.005em;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 60%);
    pointer-events: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: none;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    filter: grayscale(0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(37,99,235,0.2), 0 1px 2px rgba(37,99,235,0.15);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6 0%, var(--primary-darker) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37,99,235,0.35), 0 2px 4px rgba(37,99,235,0.2);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(22,163,74,0.2), 0 1px 2px rgba(22,163,74,0.15);
}
.btn-success:hover {
    box-shadow: 0 4px 14px rgba(22,163,74,0.35), 0 2px 4px rgba(22,163,74,0.2);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(220,38,38,0.2), 0 1px 2px rgba(220,38,38,0.15);
}
.btn-danger:hover {
    box-shadow: 0 4px 14px rgba(220,38,38,0.35), 0 2px 4px rgba(220,38,38,0.2);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%);
    color: #fff;
    box-shadow: 0 2px 4px rgba(245,158,11,0.2);
}
.btn-warning:hover {
    box-shadow: 0 4px 14px rgba(245,158,11,0.35);
    color: #fff;
}

.btn-outline {
    background: #fff;
    border: 1.5px solid var(--gray-200);
    color: var(--gray-700);
    box-shadow: var(--shadow-xs);
}
.btn-outline::after { display: none; }
.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-800);
    box-shadow: var(--shadow);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.btn-lg {
    padding: 13px 28px;
    font-size: 15px;
    border-radius: var(--radius);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ---------- FORMS ---------- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 550;
    color: var(--gray-700);
    margin-bottom: 6px;
    letter-spacing: -0.005em;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--gray-800);
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    box-shadow: var(--shadow-inner);
}

.form-control:hover {
    border-color: var(--gray-300);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow), var(--shadow-inner);
    background: #fff;
}

.form-control::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 6.646a.5.5 0 0 1 .708 0L8 9.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 88px;
    line-height: 1.6;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--primary);
    width: 17px;
    height: 17px;
    vertical-align: middle;
    margin-right: 7px;
    cursor: pointer;
    border-radius: 4px;
}

input[type="file"].form-control {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}

input[type="file"].form-control::file-selector-button {
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    margin-right: 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all var(--transition-fast);
}

input[type="file"].form-control::file-selector-button:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-inline {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.form-inline .form-group { margin-bottom: 0; }

/* ---------- ALERTS ---------- */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: slideUp 0.3s ease;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.alert-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #166534;
    border: 1px solid rgba(187,247,208,0.6);
}
.alert-success::before { background: var(--success); }

.alert-danger, .alert-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border: 1px solid rgba(254,202,202,0.6);
}
.alert-danger::before, .alert-error::before { background: var(--danger); }

.alert-info {
    background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
    color: #155e75;
    border: 1px solid rgba(165,243,252,0.6);
}
.alert-info::before { background: var(--info); }

.alert-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    border: 1px solid rgba(253,230,138,0.6);
}
.alert-warning::before { background: var(--warning); }

.alert a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.alert a:hover {
    opacity: 0.8;
}

.alert-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.4;
    line-height: 1;
    transition: opacity var(--transition-fast);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
}
.alert-close:hover { opacity: 0.9; }

/* ---------- BADGES ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 100px;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #a16207; }
.badge-info { background: #cffafe; color: #0e7490; }
.badge-primary { background: #dbeafe; color: #1d4ed8; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ---------- PAGINATION ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px 0;
}

.pagination .btn {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
}

.pagination .btn-primary {
    box-shadow: 0 2px 4px rgba(37,99,235,0.2);
}

.pagination-info {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
    padding: 0 12px;
}

/* ---------- MODAL ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.25s ease;
}

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

.modal-header h3 { font-size: 17px; font-weight: 650; margin: 0; color: var(--gray-900); }

.modal-body { padding: 24px; }

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---------- UTILITY ---------- */
.text-muted { color: var(--gray-500); }
.text-danger { color: var(--danger); font-weight: 500; }
.text-success { color: var(--success); font-weight: 500; }
.text-warning { color: var(--warning-dark); font-weight: 500; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.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; }
.d-flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.hidden { display: none !important; }

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0c1222 0%, #162033 30%, #1e3a5f 60%, #2563eb 100%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(96,165,250,0.12) 0%, transparent 70%);
    top: -250px;
    right: -200px;
    border-radius: 50%;
    pointer-events: none;
    animation: pulse 8s ease-in-out infinite;
}

.login-container::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%);
    bottom: -200px;
    left: -150px;
    border-radius: 50%;
    pointer-events: none;
    animation: pulse 10s ease-in-out infinite reverse;
}

.login-card {
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(24px);
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 100px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.08);
    padding: 48px 44px;
    width: 100%;
    max-width: 430px;
    animation: slideUp 0.5s cubic-bezier(.4,0,.2,1);
    position: relative;
    z-index: 1;
}

.login-card .login-icon {
    text-align: center;
    margin-bottom: 28px;
}

.login-card .login-icon-circle {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(37,99,235,0.35);
    transition: transform var(--transition);
}

.login-card .login-icon-circle:hover {
    transform: scale(1.05) rotate(-3deg);
}

.login-card h1 {
    font-size: 26px;
    text-align: center;
    margin-bottom: 8px;
    color: var(--gray-900);
    font-weight: 750;
    letter-spacing: -0.03em;
}

.login-card .subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: 14.5px;
    margin-bottom: 36px;
    font-weight: 400;
    line-height: 1.5;
}

.login-card .form-group label {
    font-weight: 550;
    color: var(--gray-700);
    font-size: 13.5px;
}

.login-card .form-control {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14.5px;
    border: 1.5px solid var(--gray-200);
    background: var(--gray-50);
    box-shadow: none;
}

.login-card .form-control:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.login-card .form-control:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.login-card .btn-primary {
    padding: 13px 24px;
    font-size: 15px;
    border-radius: var(--radius);
    margin-top: 10px;
    font-weight: 600;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}

.login-card .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}

.login-card .alert {
    margin-bottom: 24px;
    font-size: 13px;
}

/* ============================================
   POS / VENTE
   ============================================ */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    height: calc(100vh - var(--header-height) - 64px);
}

.pos-products {
    overflow-y: auto;
    padding-right: 4px;
}

.pos-cart {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.03);
    border: none;
}

.pos-search {
    padding: 16px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow), 0 0 0 1px rgba(0,0,0,0.03);
    margin-bottom: 20px;
    border: none;
}

.pos-search input {
    width: 100%;
    padding: 13px 18px 13px 46px;
    font-size: 15px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--gray-50);
    font-family: inherit;
    transition: all var(--transition-fast);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 16px center;
    color: var(--gray-800);
}

.pos-search input::placeholder {
    color: var(--gray-400);
}

.pos-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px var(--primary-glow);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 16px center;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.product-card {
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 18px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.product-card:hover {
    border-color: rgba(37,99,235,0.3);
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(37,99,235,0.1);
    transform: translateY(-3px);
}

.product-card:hover::before {
    opacity: 1;
}

.product-card:active {
    transform: translateY(0) scale(0.98);
    box-shadow: var(--shadow);
}

.product-card .product-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--gray-800);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-price {
    color: var(--primary);
    font-weight: 750;
    font-size: 17px;
    letter-spacing: -0.02em;
}

.product-card .product-stock {
    font-size: 11.5px;
    color: var(--gray-500);
    margin-top: 8px;
    font-weight: 450;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #fff;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-100);
    gap: 12px;
    transition: background var(--transition-fast);
    animation: slideInLeft 0.25s ease;
}

.cart-item:hover {
    background: var(--gray-50);
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
    font-size: 13.5px;
    font-weight: 550;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item-price { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.cart-item-qty button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--gray-700);
    box-shadow: var(--shadow-xs);
}

.cart-item-qty button:hover {
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: var(--shadow);
}

.cart-item-qty button:active {
    transform: scale(0.92);
}

.cart-item-qty span {
    width: 34px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--gray-900);
}

.cart-item-total {
    font-weight: 700;
    font-size: 13.5px;
    white-space: nowrap;
    color: var(--gray-800);
    min-width: 75px;
    text-align: right;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    border-radius: 6px;
    transition: all var(--transition-fast);
    line-height: 1;
}

.cart-item-remove:hover {
    color: var(--danger);
    background: var(--danger-light);
}

.cart-summary {
    background: linear-gradient(180deg, var(--gray-50) 0%, #fff 100%);
    padding: 18px 20px;
    border-top: 2px solid var(--gray-200);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13.5px;
    color: var(--gray-600);
}

.cart-summary-row.total {
    font-size: 22px;
    font-weight: 750;
    padding: 12px 0 4px;
    border-top: 2px solid var(--gray-200);
    margin-top: 8px;
    color: var(--gray-900);
    letter-spacing: -0.03em;
}

.cart-actions {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
    border-top: 1px solid var(--gray-100);
}

.cart-actions .btn-success {
    padding: 15px 24px;
    font-size: 15px;
    border-radius: var(--radius);
    font-weight: 650;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 14px rgba(22,163,74,0.25);
}

.cart-actions .btn-success:hover {
    box-shadow: 0 6px 20px rgba(22,163,74,0.35);
}

/* ============================================
   TICKET PREVIEW
   ============================================ */
.ticket-preview {
    background: #fff;
    border: 2px dashed var(--gray-300);
    padding: 28px 24px;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 12px;
    max-width: 320px;
    margin: 0 auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    position: relative;
    line-height: 1.5;
}

.ticket-preview::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 20px;
    right: 20px;
    height: 16px;
    background: repeating-linear-gradient(
        90deg,
        transparent 0,
        transparent 8px,
        var(--gray-200) 8px,
        var(--gray-200) 10px
    );
    background-size: 10px 100%;
}

.ticket-preview .ticket-header {
    text-align: center;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.6;
}

.ticket-preview .ticket-line {
    border-top: 1px dashed var(--gray-400);
    margin: 12px 0;
}

.ticket-preview .ticket-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.ticket-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 12px;
}

.ticket-table th {
    background: var(--gray-100);
    padding: 6px 4px;
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--gray-300);
}

.ticket-table td {
    padding: 4px 4px;
    border-bottom: 1px dotted var(--gray-300);
    font-size: 11px;
    vertical-align: top;
}

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

.ticket-table td:first-child {
    max-width: 120px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .pos-layout {
        grid-template-columns: 1fr 380px;
    }
}

@media (max-width: 1024px) {
    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .pos-cart { min-height: 450px; }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle {
        display: block;
    }
    .page-content {
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 12px;
    }
    .stat-card {
        padding: 18px;
        gap: 14px;
    }
    .stat-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }
    .stat-value {
        font-size: 22px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .top-header {
        padding: 0 16px;
    }
    .card-header {
        padding: 14px 18px;
    }
    .card-body {
        padding: 18px;
    }
    .card-footer {
        padding: 14px 18px;
    }
    table th, table td {
        padding: 10px 14px;
    }
    .btn-group {
        flex-direction: column;
        align-items: stretch;
    }
    .report-filters {
        flex-direction: column;
    }
    .report-filters .form-group {
        width: 100%;
    }
    .filter-bar {
        flex-direction: column;
    }
    .login-card {
        padding: 32px 28px;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 12px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .stat-card {
        padding: 16px;
    }
    .stat-value {
        font-size: 20px;
    }
    .page-title {
        font-size: 16px;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    .login-card {
        padding: 28px 20px;
    }
}

/* ============================================
   PAGE-SPECIFIC LAYOUTS
   ============================================ */

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Caisse status info rows */
.caisse-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13.5px;
}

.caisse-info-row:last-child { border-bottom: none; }

.caisse-info-row .label {
    color: var(--gray-500);
    font-weight: 450;
}

.caisse-info-row .value {
    font-weight: 600;
    color: var(--gray-800);
}

/* Settings dual-pane layout */
.settings-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }
}

/* Reports filter bar */
.report-filters {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    padding: 18px 22px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow), 0 0 0 1px rgba(0,0,0,0.03);
    border: none;
    margin-bottom: 24px;
}

.report-filters .form-group {
    margin-bottom: 0;
    min-width: 140px;
}

/* Report tab navigation */
.tab-nav {
    display: flex;
    gap: 4px;
    padding: 5px;
    background: var(--gray-100);
    border-radius: var(--radius);
    margin-bottom: 24px;
    border: 1px solid var(--gray-200);
    width: fit-content;
    box-shadow: var(--shadow-inner);
}

.tab-nav .btn {
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-weight: 500;
    padding: 9px 18px;
    font-size: 13px;
}

.tab-nav .btn::after { display: none; }

.tab-nav .btn:hover {
    background: rgba(255,255,255,0.5);
    color: var(--gray-800);
    transform: none;
    box-shadow: none;
}

.tab-nav .btn-primary {
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow);
    font-weight: 600;
}

.tab-nav .btn-primary:hover {
    background: #fff;
    transform: none;
}

/* Inventory count input */
.inv-count-input {
    width: 80px;
    display: inline-block;
    text-align: center;
    padding: 8px 10px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.inv-count-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

/* Product detail grid */
.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--gray-400);
}

.empty-state svg {
    margin-bottom: 14px;
    opacity: 0.35;
}

.empty-state p {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 6px;
    line-height: 1.5;
}

/* Closing report */
.report-card {
    max-width: 640px;
}

.report-card table td {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.report-label {
    color: var(--gray-500);
    font-weight: 450;
    width: 50%;
}

.report-value {
    font-weight: 600;
    text-align: right;
}

/* Separator line */
.separator {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 22px 0;
}

.separator-thick {
    border: none;
    border-top: 2px solid var(--gray-300);
    margin: 18px 0;
}

/* Big number display */
.big-number {
    font-size: 30px;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.big-number.positive { color: var(--success); }
.big-number.negative { color: var(--danger); }

/* Logout button in header */
.header-right .btn-outline {
    border-radius: 50%;
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: var(--gray-200);
    color: var(--gray-500);
    transition: all var(--transition);
}

.header-right .btn-outline:hover {
    background: var(--danger-light);
    border-color: transparent;
    color: var(--danger);
    box-shadow: 0 2px 8px rgba(220,38,38,0.15);
    transform: rotate(8deg);
}

/* Form card styling */
.form-card {
    max-width: 720px;
}

.form-card-sm {
    max-width: 540px;
}

/* Section title inside card body */
.section-title {
    font-size: 14px;
    font-weight: 650;
    color: var(--gray-800);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-100);
    letter-spacing: -0.01em;
}

/* Audit log details tooltip */
.audit-details {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
    color: var(--gray-600);
    font-size: 12.5px;
}

/* Filter bar for audit/lists */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px 22px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow), 0 0 0 1px rgba(0,0,0,0.03);
    border: none;
    margin-bottom: 22px;
}

.filter-bar .form-group {
    margin-bottom: 0;
    min-width: 130px;
    flex: 1;
}

.filter-bar .form-group:first-child {
    flex: 2;
}

/* Ticket print specific */
@media print {
    .ticket-preview {
        border: none;
        box-shadow: none;
        padding: 0;
        max-width: 100%;
    }
    .ticket-preview::before { display: none; }
}

/* ============================================
   EXTRA MICRO-INTERACTIONS & POLISH
   ============================================ */

/* Focus-visible for keyboard navigation */
.btn:focus-visible,
.form-control:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Smooth card entrance */
.card {
    animation: fadeIn 0.3s ease;
}

/* Row actions appear on hover */
table tbody tr .btn-outline {
    opacity: 0.5;
    transition: opacity var(--transition-fast), all var(--transition-fast);
}

table tbody tr:hover .btn-outline {
    opacity: 1;
}

/* Tooltip style for badges on hover */
.badge {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.badge:hover {
    transform: scale(1.06);
}

/* Inline h4 inside card-body (caisse, settings) */
.card-body h4 {
    font-size: 14px;
    font-weight: 650;
    color: var(--gray-800);
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

/* Table inside card-body for detail views (caisse report, product detail) */
.card-body table td {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

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

/* Sticky sidebar card (settings ticket preview) */
.card[style*="sticky"] {
    top: calc(var(--header-height) + 32px) !important;
}

/* Number input inside table (inventory) */
table input[type="number"] {
    width: 80px;
    display: inline-block;
    text-align: center;
    padding: 8px 10px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-fast);
}

table input[type="number"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    outline: none;
}

/* Discount input in cart */
.cart-summary input[type="number"] {
    width: 80px;
    text-align: right;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 13px;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.cart-summary input[type="number"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
    outline: none;
}

/* Total row in tables with bold border */
table tbody tr[style*="border-top"] td {
    font-weight: 700;
}

/* Mobile sidebar overlay */
@media (max-width: 768px) {
    .sidebar.open {
        box-shadow: 8px 0 40px rgba(0,0,0,0.3);
    }
    .sidebar.open ~ .main-content::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.3);
        z-index: 99;
    }
}

/* Smooth scroll target highlight */
:target {
    animation: glowPulse 1.5s ease;
}

/* Selection in tables */
table tbody tr td::selection {
    background: var(--primary-light);
}

/* ---------- PRINT ---------- */
@media print {
    body { background: #fff; }
    .sidebar, .top-header, .btn, .no-print, .filter-bar, .report-filters, .tab-nav { display: none !important; }
    .main-content { margin-left: 0; }
    .page-content { padding: 0; animation: none; max-width: 100%; }
    .card { box-shadow: none; border: 1px solid #ddd; animation: none; }
    .stat-card { box-shadow: none; border: 1px solid #ddd; animation: none; }
    .dashboard-grid, .product-detail-grid, .settings-layout { gap: 12px; }
    table tbody tr:hover { background: transparent; }
    .badge { border: 1px solid currentColor; }
    * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
