/* assets/css/style.css - PHARMTOUCH Branding */
:root {
    --primary: #2A0646;
    --primary-light: #3D0A5C;
    --accent: #F2A500;
    --accent-hover: #E09500;
    --accent-dark: #D48A00;
    --teal: #14B8A6;
    --success: #22C55E;
    --danger: #EF4444;
    --gray: #64748B;
    --light-gray: #F1F5F9;
    --border: #E2E8F0;
    --shadow: 0 4px 24px rgba(0,0,0,0.06);
    --radius: 12px;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html {
    scrollbar-color: var(--accent) rgba(42, 6, 70, 0.08);
    scrollbar-width: thin;
}

html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
body { font-family: 'Inter', -apple-system, sans-serif; background: #F8FAFC; color: #0F172A; min-height: 100vh; }

/* Custom branded scrollbars for selected scroll containers */
.scrollbar-enabled {
    scrollbar-color: rgba(242, 165, 0, 0.72) rgba(42, 6, 70, 0.02);
    scrollbar-width: thin;
}

.scrollbar-enabled::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.scrollbar-enabled::-webkit-scrollbar-track {
    background: rgba(42, 6, 70, 0.03);
    border-radius: 999px;
}

.scrollbar-enabled::-webkit-scrollbar-thumb {
    background: rgba(242, 165, 0, 0);
    border-radius: 999px;
    border: 1px solid transparent;
    transition: background 0.18s ease, transform 0.18s ease;
    min-height: 28px;
}

.scrollbar-enabled:hover::-webkit-scrollbar-thumb,
.scrollbar-enabled.scrolling::-webkit-scrollbar-thumb {
    background: rgba(242, 165, 0, 0.72);
}

.scrollbar-enabled.scrolling::-webkit-scrollbar-thumb {
    transform: scaleX(1.02);
}

.scrollbar-enabled::-webkit-scrollbar-thumb:hover {
    background: rgba(242, 165, 0, 0.92);
}

.scrollbar-enabled::-webkit-scrollbar-corner {
    background: transparent;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #2A0646 0%, #3D0A5C 100%);
}
.login-container { width: 100%; max-width: 420px; padding: 20px; }
.login-card {
    background: white;
    padding: 40px 35px;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-header {
    text-align: center;
    margin-bottom: 30px;
}
.login-header i {
    font-size: 48px;
    color: var(--accent);
    display: block;
    margin-bottom: 10px;
}
.login-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}
.login-header p {
    color: var(--gray);
    font-size: 14px;
}
.login-card .form-group {
    margin-bottom: 18px;
}
.login-card label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 5px;
    color: var(--gray);
}
.login-card input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
}
.login-card input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.btn-block { width: 100%; }
.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--gray);
}
.login-footer a { color: var(--accent); text-decoration: none; }

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--primary);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease, opacity 0.2s ease;
    z-index: 2000;
    box-shadow: 0 0 30px rgba(0,0,0,0.25);
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
}
.sidebar.active {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
}
.sidebar-brand {
    padding: 24px 20px;
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand i { font-size: 28px; color: var(--accent); }
.sidebar-nav {
    padding: 20px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.sidebar-nav ul li {
    margin: 2px 12px;
    border-radius: 8px;
    transition: var(--transition);
}
.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: var(--transition);
    cursor: pointer;
}
.sidebar-nav ul li a i { width: 20px; }
.sidebar-nav ul li:hover > a { color: white; background: rgba(255,255,255,0.08); }
.sidebar-nav ul li.active > a,
.sidebar-nav ul li.sidebar-nav-parent.open > a {
    color: white;
    background: rgba(37,99,235,0.3);
}
.sidebar-nav ul li.sidebar-nav-parent { padding: 0; }
.sidebar-nav ul li.sidebar-nav-parent > a {
    margin-bottom: 4px;
    position: relative;
    font-weight: 600;
}
.sidebar-nav ul li.sidebar-nav-parent > a::after {
    content: '▾';
    margin-left: auto;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    transition: transform 0.2s ease;
}
.sidebar-nav ul li.sidebar-nav-parent.open > a::after {
    transform: rotate(180deg);
}
.sidebar-nav ul li.sidebar-nav-parent > a.is-active {
    color: white;
    background: rgba(37,99,235,0.3);
}
.sidebar-nav ul li.sidebar-nav-parent .sidebar-submenu {
    list-style: none;
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 0 0 4px 26px;
    margin: 0;
    position: relative;
}
.sidebar-nav ul li.sidebar-nav-parent .sidebar-submenu::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 4px;
    width: 1px;
    background: rgba(255,255,255,0.18);
}
.sidebar-nav ul li.sidebar-nav-parent.open .sidebar-submenu {
    display: flex;
}
.sidebar-nav ul li.sidebar-nav-parent .sidebar-submenu li {
    margin: 0;
    border-radius: 6px;
    position: relative;
    padding-left: 10px;
}
.sidebar-nav ul li.sidebar-nav-parent .sidebar-submenu li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 10px;
    height: 1px;
    background: rgba(255,255,255,0.18);
    transform: translateY(-50%);
}
.sidebar-nav ul li.sidebar-nav-parent .sidebar-submenu li a {
    padding: 8px 10px;
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    gap: 10px;
    align-items: center;
}
.sidebar-nav ul li.sidebar-nav-parent .sidebar-submenu li a i {
    width: 16px;
    font-size: 12px;
    opacity: 0.85;
}
.sidebar-nav ul li.sidebar-nav-parent .sidebar-submenu li:hover > a,
.sidebar-nav ul li.sidebar-nav-parent .sidebar-submenu li.active > a {
    color: white;
    background: rgba(37,99,235,0.22);
}
.sidebar-nav ul li.sidebar-logout {
    margin-top: auto;
    margin-bottom: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    transition: var(--transition);
    width: calc(100% - 260px);
    max-width: 100%;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-top: 104px; /* Extra offset so page content starts below fixed header */
}
.top-header {
    background: white;
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: fixed !important;
    top: 0 !important;
    left: 260px !important;
    right: 0 !important;
    width: calc(100% - 260px) !important;
    z-index: 2100 !important;
    overflow: visible;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #166534;
    background: linear-gradient(135deg, #ecfdf3 0%, #f0fdf4 100%);
    border: 1px solid #a7f3d0;
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.12);
    line-height: 1;
}
.header-pos-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 8px 18px rgba(42, 6, 70, 0.16);
    text-decoration: none;
    line-height: 1;
    transition: var(--transition);
}
.header-pos-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(42, 6, 70, 0.2);
}
.header-pos-button i {
    font-size: 0.9rem;
}
.header-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
    flex-shrink: 0;
}
.header-status-badge.offline {
    color: #b91c1c;
    background: linear-gradient(135deg, #fef2f2 0%, #fff7f7 100%);
    border-color: #fecaca;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.12);
}
.header-status-badge.offline .header-status-dot {
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.16);
}
.menu-toggle { display: none; background: none; border: none; font-size: 20px; cursor: pointer; }
.header-right { display: flex; align-items: center; gap: 24px; }
.pwa-install-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(242,165,0,0.35);
    background: linear-gradient(135deg, var(--accent) 0%, #FFB84D 100%);
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 18px rgba(242,165,0,0.22);
}
.pwa-install-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(242,165,0,0.28);
}
.pwa-install-button i {
    font-size: 12px;
}
#pwaSplashScreen {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, rgba(42,6,70,0.96) 0%, rgba(61,10,92,0.96) 100%);
    backdrop-filter: blur(8px);
}
.pwa-splash-card {
    width: min(92vw, 390px);
    background: rgba(255,255,255,0.98);
    color: var(--primary);
    border-radius: 28px;
    padding: 28px 24px;
    box-shadow: 0 24px 70px rgba(2,6,23,0.24);
    text-align: center;
    animation: pwaCardIn 0.25s ease;
}
.pwa-splash-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #FFB84D 100%);
    color: #fff;
    margin-bottom: 12px;
}
.pwa-splash-card img {
    width: 88px;
    height: 88px;
    margin-bottom: 14px;
    border-radius: 22px;
}
.pwa-splash-card h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--primary);
}
.pwa-splash-card p {
    color: var(--gray);
    line-height: 1.5;
    margin-bottom: 16px;
}
.pwa-splash-features {
    list-style: none;
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
    text-align: left;
}
.pwa-splash-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray);
    font-size: 13px;
}
.pwa-splash-features li i {
    color: var(--accent);
}
.pwa-splash-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.pwa-splash-install,
.pwa-splash-later {
    border: none;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.pwa-splash-install {
    background: linear-gradient(135deg, var(--accent) 0%, #FFB84D 100%);
    color: white;
}
.pwa-splash-later {
    background: #F1F5F9;
    color: var(--primary);
}
.pwa-splash-install:hover,
.pwa-splash-later:hover {
    transform: translateY(-1px);
}
@keyframes pwaCardIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.notification-bell { position: relative; cursor: pointer; }
.notification-bell .badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 50%;
}
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-avatar { font-size: 32px; color: var(--gray); }
.user-info { line-height: 1.3; }
.user-name { font-weight: 600; font-size: 14px; display: block; }
.user-role { font-size: 12px; color: var(--gray); }

/* Page Content */
.page-content {
    padding: 24px 30px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin-left: 0;
}
.app-footer {
    margin-top: auto;
    padding: 16px 30px;
    border-top: 1px solid var(--border);
    background: #fff;
    color: var(--gray);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
    visibility: visible;
    opacity: 1;
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.app-footer .footer-brand,
.app-footer .footer-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray);
}
.app-footer .footer-brand {
    font-weight: 600;
    color: var(--primary);
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent);
}
.stat-info { flex: 1; }
.stat-label { display: block; font-size: 13px; color: var(--gray); }
.stat-value { font-size: 24px; font-weight: 700; }

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.chart-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.chart-card h3 {
    font-size: 16px;
    margin-bottom: 16px;
}
.chart-card canvas { height: 250px; }

/* Cards */
.card, .stat-card, .chart-card, .table-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-header h3 {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-body { padding: 24px; }

/* Forms */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 4px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    background: white;
}

.upload-panel {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 24px;
    padding: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    box-shadow: 0 18px 55px rgba(15, 23, 42, 0.08);
}

.upload-dropzone {
    position: relative;
    display: grid;
    place-items: center;
    gap: 10px;
    padding: 28px 24px;
    border: 1px dashed rgba(15, 23, 42, 0.18);
    border-radius: 22px;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s ease;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    overflow: hidden;
}

.upload-dropzone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 32%);
    pointer-events: none;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: rgba(59, 130, 246, 0.8);
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
    transform: translateY(-1px);
}

.upload-dropzone i {
    position: relative;
    z-index: 1;
    font-size: 28px;
    color: var(--accent);
}

.upload-dropzone strong {
    position: relative;
    z-index: 1;
    display: block;
    color: #0f172a;
    font-weight: 700;
    margin-top: 4px;
}

.upload-dropzone small {
    position: relative;
    z-index: 1;
    display: block;
    color: #64748b;
    font-size: 13px;
}

.upload-preview-list,
.upload-timeline {
    margin-top: 18px;
    display: grid;
    gap: 16px;
}

.upload-preview-item,
.upload-timeline-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.upload-preview-item img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.upload-description-input {
    width: 100%;
    min-height: 78px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    padding: 10px 12px;
    resize: vertical;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #0f172a;
    background: #f8fafc;
    margin-top: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.upload-description-input:focus {
    outline: none;
    border-color: rgba(34, 197, 94, 0.45);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.upload-preview-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.upload-preview-info strong {
    font-size: 14px;
    color: #0f172a;
    word-break: break-word;
}

.upload-preview-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.upload-preview-delete:hover {
    background: rgba(220, 38, 38, 0.16);
    transform: scale(1.05);
}

.upload-preview-item {
    position: relative;
}

.upload-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.upload-panel-header label {
    margin-bottom: 0;
    font-weight: 700;
    color: #0f172a;
}

.clear-upload-btn {
    display: none;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    font-size: 0.95rem;
}

.clear-upload-btn:hover {
    color: #0f172a;
    text-decoration: underline;
}

.upload-status {
    font-size: 13px;
    color: #475569;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.upload-status.uploading {
    color: #d97706;
}

.upload-status.completed {
    color: #16a34a;
}

.upload-status.error {
    color: #dc2626;
}

.upload-preview-loader {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(229, 231, 235, 1);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: upload-spin 0.9s linear infinite;
}

@keyframes upload-spin {
    to { transform: rotate(360deg); }
}

.confirm-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(2px);
    z-index: 2147483647;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow-y: auto;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.confirm-modal.show {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.modal-open {
    overflow: hidden;
}

.notification-popup {
    z-index: 2147483647 !important;
    position: fixed;
    isolation: isolate;
}

.confirm-modal-card {
    width: min(92vw, 420px);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
    padding: 24px;
    text-align: left;
    transform: translateY(8px) scale(0.98);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
    position: relative;
    max-height: calc(100vh - 40px);
    overflow: auto;
}

.confirm-modal.show .confirm-modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.confirm-modal-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.confirm-modal-text {
    margin: 0 0 18px;
    color: #475569;
    line-height: 1.6;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.confirm-modal-btn {
    min-width: 110px;
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.95rem;
}

.confirm-modal-cancel {
    background: #f3f4f6;
    color: #1f2937;
}

.confirm-modal-proceed {
    background: #2563eb;
    color: #ffffff;
}

.confirm-modal-proceed:hover {
    background: #1d4ed8;
}

@keyframes slideDown {
    from { transform: translateY(-14px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.notification-list {
    display: grid;
    gap: 14px;
}

.notification-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.notification-row:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 18px 45px rgba(37, 99, 235, 0.12);
}

.notification-row.unread {
    border-left: 4px solid #2563eb;
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
}

.notification-row.read {
    opacity: 0.94;
}

.notification-row-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.notification-row-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    font-size: 18px;
    flex-shrink: 0;
}

.notification-row-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.notification-row-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.notification-row-body {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
}

.notification-row-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.notification-row-time {
    font-size: 12px;
    color: #64748b;
}

.notification-row-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.notification-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.notification-detail-card {
    width: min(92vw, 480px);
    padding: 0;
    overflow: hidden;
}

.notification-detail-body {
    position: relative;
    padding: 24px;
}

.notification-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.notification-detail-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.notification-detail-icon-success { background: rgba(34, 197, 94, 0.14); color: #15803d; }
.notification-detail-icon-error { background: rgba(239, 68, 68, 0.14); color: #dc2626; }
.notification-detail-icon-warning { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.notification-detail-icon-info { background: rgba(37, 99, 235, 0.12); color: #2563eb; }

.notification-detail-header-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-detail-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    margin-bottom: 12px;
}

.notification-detail-badge-success { background: rgba(34, 197, 94, 0.14); color: #15803d; }
.notification-detail-badge-error { background: rgba(239, 68, 68, 0.14); color: #dc2626; }
.notification-detail-badge-warning { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.notification-detail-badge-info { background: rgba(37, 99, 235, 0.12); color: #2563eb; }

.notification-detail-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f3f4f6;
    color: #475569;
    cursor: pointer;
}

.notification-detail-meta {
    margin-top: 10px;
    font-size: 12px;
    color: #64748b;
}

@media (max-width: 768px) {
    .notification-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .notification-row-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

.upload-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #eef2ff;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.upload-progress-bar span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #22c55e);
    transition: width 0.25s ease;
}


.upload-timeline-step {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #E2E8F0;
    margin-top: 6px;
    flex-shrink: 0;
}

.upload-timeline-item.active .upload-timeline-step {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(242, 165, 0, 0.12);
}

.upload-timeline-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.upload-timeline-title {
    font-weight: 700;
    color: #0F172A;
    font-size: 14px;
}

.upload-timeline-description {
    font-size: 13px;
    color: #64748B;
    line-height: 1.4;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.brand-datetime-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 18px;
    border: 1px solid rgba(42, 6, 70, 0.14);
    background: linear-gradient(135deg, #ffffff 0%, #fdf6e9 100%);
    box-shadow: 0 10px 24px rgba(42, 6, 70, 0.08);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.brand-datetime-picker::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(242, 165, 0, 0.07), transparent 35%, rgba(42, 6, 70, 0.03));
    pointer-events: none;
    z-index: -1;
}
.brand-datetime-picker:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(242, 165, 0, 0.16), 0 12px 28px rgba(42, 6, 70, 0.10);
    transform: translateY(-1px);
}
.brand-datetime-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent-dark) 100%);
    box-shadow: 0 10px 18px rgba(42, 6, 70, 0.18);
    flex-shrink: 0;
}
.brand-datetime-inputs {
    display: flex;
    flex: 1;
    gap: 8px;
    flex-wrap: wrap;
}
.brand-datetime-date,
.brand-datetime-time {
    border: 1px solid rgba(42, 6, 70, 0.16);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    color: #0f172a;
    background: white;
    min-height: 44px;
    font-weight: 600;
}
.brand-datetime-date {
    flex: 1 1 180px;
}
.brand-datetime-time {
    flex: 0 0 112px;
}
.brand-datetime-date:focus,
.brand-datetime-time:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(242, 165, 0, 0.14);
}
.brand-datetime-now-btn {
    padding: 10px 14px;
    border-radius: 12px;
    white-space: nowrap;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: var(--primary);
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(242, 165, 0, 0.2);
}
.brand-datetime-now-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
}
.brand-datetime-helper {
    margin-top: 8px;
    font-size: 12px;
    color: var(--gray);
    font-weight: 600;
    letter-spacing: 0.01em;
}
.brand-datetime-readonly {
    background: linear-gradient(135deg, #f8fafc 0%, #f5f3ff 100%);
    border-color: rgba(42, 6, 70, 0.12);
}
.brand-datetime-readonly-inputs {
    flex: 1;
}
.brand-datetime-readonly-field {
    width: 100%;
    cursor: not-allowed;
    background: rgba(255,255,255,0.86);
    color: #334155;
}
.measurement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    text-decoration: none;
}
.btn:disabled {
    opacity: 0.85;
    cursor: not-allowed;
}
.btn-primary { background: var(--button-primary); color: white; }
.btn-primary:hover { background: var(--button-primary-hover); }
.login-button .btn-content {
    width: 100%;
    justify-content: center;
}
.btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.5);
    border-top-color: #ffffff;
    border-radius: 50%;
    margin-left: 8px;
    animation: spin 0.8s linear infinite;
}
.btn.loading .btn-spinner {
    display: inline-block;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.login-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.login-loader {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 28px 30px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
    text-align: center;
    min-width: 260px;
}
.login-loader-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(37,99,235,0.18);
    border-top-color: var(--button-primary-hover);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
.login-loader-text {
    font-weight: 700;
    color: #0F172A;
    font-size: 15px;
}
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #16A34A; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-info { background: var(--teal); color: white; }
.btn-info:hover { background: #0D9488; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* Mobile dropdown menus */
.notification-bell,
.user-profile {
    position: relative;
}
.notification-dropdown,
.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 280px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
    z-index: 2000;
    overflow: hidden;
}
.notification-dropdown.active,
.user-dropdown.active {
    display: block;
}
.dropdown-header {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    background: #F8FAFC;
}
.notification-item {
    display: block;
    padding: 12px 14px;
    text-decoration: none;
    color: var(--gray);
    border-bottom: 1px solid var(--border);
}
.notification-item.unread {
    background: #FFF8E8;
}
.notification-item:hover {
    background: #F8FAFC;
}
.notification-item-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 3px;
}
.notification-item-message {
    font-size: 13px;
    margin-bottom: 3px;
}
.notification-item-time {
    font-size: 11px;
    color: #94A3B8;
}
.dropdown-footer {
    display: block;
    padding: 12px 14px;
    text-align: center;
    text-decoration: none;
    color: var(--accent);
    font-weight: 600;
    background: white;
}
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: var(--gray);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}
.user-dropdown a:last-child {
    border-bottom: none;
}
.user-dropdown a:hover {
    background: #F8FAFC;
}
.sidebar-close {
    display: none;
    margin-left: auto;
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}
.mobile-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.45);
    z-index: 900;
}
.mobile-nav-backdrop.active {
    display: block;
}
body.sidebar-open {
    overflow: hidden;
}

/* Tables */
.table-responsive { overflow-x: auto; }
.scrollable-table-wrapper {
    max-height: 420px;
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    position: relative;
}
.scrollable-table-wrapper .table-responsive {
    min-width: 760px;
    max-height: 420px;
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    z-index: 1;
    -webkit-overflow-scrolling: touch;
}
.modern-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 14px;
    background: white;
}
.modern-table th,
.modern-table td {
    white-space: nowrap;
    overflow-wrap: normal;
}
.modern-table thead th {
    text-align: left;
    padding: 14px 18px;
    background: #F8FAFC;
    font-weight: 600;
    color: #334155;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1;
}
.modern-table tbody td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.modern-table tbody tr:hover td {
    background: #F8FAFC;
}
.modern-table .table-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #64748B;
}
.modern-table .table-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.modern-table .table-link:hover {
    text-decoration: underline;
}
.modern-table .table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.modern-table .table-actions .btn {
    white-space: nowrap;
}
.measurement-history-toolbar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 16px;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--light-gray);
    font-weight: 600;
    color: var(--gray);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
table td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
table tr:hover td { background: #F8FAFC; }

.mobile-responsive-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    table-layout: auto;
}
.mobile-responsive-table th,
.mobile-responsive-table td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}
.mobile-responsive-table .table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.mobile-responsive-table .table-actions .btn {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .mobile-responsive-table {
        min-width: 560px;
    }
    .mobile-responsive-table th,
    .mobile-responsive-table td {
        padding: 10px 12px;
    }
}

/* Badges */
.badge {
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}
.badge-new { background: #DBEAFE; color: #1E40AF; }
.badge-measurement_taken { background: #FEF3C7; color: #92400E; }
.badge-cutting { background: #FCE7F3; color: #9D174D; }
.badge-sewing { background: #E0E7FF; color: #3730A3; }
.badge-finishing { background: #D1FAE5; color: #065F46; }
.badge-quality_check { background: #FEE2E2; color: #991B1B; }
.badge-ready { background: #DBEAFE; color: #1E40AF; }
.badge-delivered { background: #D1FAE5; color: #065F46; }

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.alert-success { background: #D1FAE5; color: #065F46; }
.alert-danger { background: #FEE2E2; color: #991B1B; }
.alert-info { background: #DBEAFE; color: #1E40AF; }

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: min(280px, 85vw);
        transform: translateX(-100%);
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        z-index: 2200;
    }
    .sidebar.active {
        transform: translateX(0);
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        z-index: 2200;
    }
    .main-content { margin-left: 0; width: 100%; }
    .top-header { left: 0 !important; width: 100% !important; }
    .app-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (min-width: 1025px) {
    .page-content {
        padding-left: 30px;
    }
    .app-footer {
        padding-left: 30px;
        padding-right: 30px;
    }
}

@media (max-width: 768px) {
    .menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .top-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
    .header-left, .header-right { min-width: 0; }
    .header-left h2 { font-size: 18px; line-height: 1.2; }
    .page-content { padding: 16px; }
    .measurement-grid { grid-template-columns: 1fr 1fr; }
    .notification-dropdown, .user-dropdown { right: 0; left: auto; min-width: min(88vw, 280px); position: fixed; top: 70px; max-width: calc(100vw - 24px); }
    .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .scrollable-table-wrapper { max-height: 100%; overflow-x: auto; }
    .scrollable-table-wrapper .table-responsive {
        min-width: 0;
        overflow-x: auto;
        overflow-y: auto;
    }
    .modern-table thead th {
        white-space: nowrap;
    }
    .modern-table tbody td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .measurement-grid { grid-template-columns: 1fr; }
    .user-info { display: none; }
    .header-right { gap: 12px; }
    .page-content { padding: 12px; }
}

/* Add to assets/css/style.css */

/* Chart Cards */
.chart-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.chart-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
.chart-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.chart-card h3 i {
    font-size: 18px;
}
.chart-card canvas {
    max-height: 250px;
    width: 100% !important;
}

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 992px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .chart-card {
        padding: 16px;
    }
    .chart-card canvas {
        max-height: 200px;
    }
}

/* Table Card */
.table-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: visible;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F8FAFC;
}
.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-header h3 i {
    color: var(--accent);
}

.table-responsive {
    overflow-x: auto;
    padding: 0;
}
.table-responsive table {
    width: 100%;
    border-collapse: collapse;
}
.table-responsive th {
    background: #F8FAFC;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.table-responsive td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.table-responsive tr:hover td {
    background: #F8FAFC;
}
.table-responsive tr:last-child td {
    border-bottom: none;
}

/* Stat Cards Enhancement */
.stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    transition: var(--transition);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--accent);
    flex-shrink: 0;
}
.stat-info {
    flex: 1;
    min-width: 0;
}
.stat-label {
    display: block;
    font-size: 13px;
    color: var(--gray);
    font-weight: 500;
}
.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    display: block;
    margin-top: 2px;
}
