/*
 * Home Care System - Modern Glass Morphism UI Framework
 * Complete UI with Professional Design
 */

/* === ROOT VARIABLES === */
:root {
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    --glass-backdrop: blur(20px);

    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-warning: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --gradient-danger: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-info: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --gradient-cosmic: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);

    --text-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

    --sidebar-width: 16rem;
    --sidebar-collapsed: 4.5rem;
    --topbar-height: 60px;
}

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1e293b;
    min-height: 100vh;
}

/* === ANIMATED DASHBOARD BACKGROUND === */
.dashboard-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradient-shift 8s ease infinite;
    min-height: 100vh;
    position: relative;
}

.dashboard-bg::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* === LOGIN PAGE === */
.login-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradient-shift 8s ease infinite;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-bg::after {
    content: '';
    position: fixed;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: dots-float 20s linear infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes dots-float {
    0% { transform: translate(-50px, -50px) rotate(0deg); }
    100% { transform: translate(-50px, -50px) rotate(360deg); }
}

.ultra-glass {
    backdrop-filter: blur(30px);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 25px 60px rgba(31, 38, 135, 0.4);
    border-radius: 28px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out;
}

.ultra-glass::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
}

.login-logo-wrap {
    text-align: center;
    margin-bottom: 1.5rem;
    animation: float 8s ease-in-out infinite;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.5);
    transition: all 0.4s var(--transition-bounce);
}

.login-logo:hover {
    transform: scale(1.2) rotate(10deg);
    box-shadow: 0 0 80px rgba(255, 255, 255, 0.8);
}

.login-title {
    text-align: center;
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
    text-shadow: 0 0 30px rgba(255,255,255,0.5);
}

.login-subtitle {
    text-align: center;
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    margin: 0 0 1.5rem;
}

.glass-input {
    width: 100%;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.4s var(--transition-bounce);
    box-shadow: 0 8px 25px rgba(31, 38, 135, 0.2);
}

.glass-input::placeholder {
    color: rgba(255,255,255,0.6);
}

.glass-input:focus {
    outline: none;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(102, 126, 234, 0.5);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
    transform: translateY(-3px) scale(1.02);
}

.glass-button {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, rgba(102,126,234,0.8) 0%, rgba(118,75,162,0.8) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
    transition: all 0.4s var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.glass-button::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
}

.glass-button:hover::before {
    left: 100%;
}

.glass-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 25px 50px rgba(102, 126, 234, 0.6);
}

.glass-button:active {
    transform: translateY(-2px) scale(1.02);
}

.login-label {
    display: block;
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.login-forgot {
    text-align: center;
    margin-top: 1rem;
}

.login-forgot a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.login-forgot a:hover {
    color: #fff;
    text-decoration: underline;
}

.login-error {
    margin-top: 1rem;
    backdrop-filter: blur(15px);
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.2);
    padding: 0.75rem;
    text-align: center;
    color: #fff;
    font-weight: 500;
}

.login-hint {
    text-align: center;
    color: rgba(255,255,255,0.55);
    font-size: 0.8rem;
    margin-top: 1rem;
}

/* === SIDEBAR === */
.app-sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    backdrop-filter: blur(25px);
    background: rgba(255, 255, 255, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 10px 0 30px rgba(31, 38, 135, 0.2);
    z-index: 50;
    display: flex;
    flex-direction: column;
    transition: all 0.4s var(--transition-bounce);
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.sidebar-brand-icon {
    width: 40px; height: 40px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s, width 0.3s;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    transition: all 0.3s var(--transition-bounce);
    border-radius: 16px;
    margin: 4px 12px;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.nav-item:hover::before {
    left: 100%;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 16px;
    transition: all 0.3s;
}

.nav-item:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateX(6px) scale(1.01);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

.nav-item:hover a {
    color: #667eea;
}

.nav-item.active {
    background: var(--gradient-primary);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.nav-item.active a {
    color: #fff;
    font-weight: 600;
}

.nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-text {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s, width 0.3s;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ef4444;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px;
    border-radius: 12px;
    transition: all 0.3s;
}

.sidebar-footer a:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* === TOP HEADER BAR === */
.app-topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    transition: left 0.4s var(--transition-bounce);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #475569;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s;
}

.topbar-toggle:hover {
    background: rgba(0,0,0,0.05);
}

.topbar-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1e293b;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(147,51,234,0.1) 100%);
    border-radius: 12px;
    border: 1px solid rgba(59,130,246,0.2);
    font-weight: 600;
    font-size: 0.9rem;
    color: #475569;
}

.topbar-user-icon {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

/* === MAIN CONTENT AREA === */
.app-main {
    margin-left: var(--sidebar-width);
    padding-top: calc(var(--topbar-height) + 20px);
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 40px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    transition: margin-left 0.4s var(--transition-bounce);
}

/* === GLASS CARDS === */
.glass-card {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 15px 40px rgba(31, 38, 135, 0.3);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.4s var(--transition-bounce);
    animation: fadeInUp 0.5s ease-out both;
}

.glass-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 50px rgba(31, 38, 135, 0.4);
}

.glass-card h2, .glass-card h3 {
    margin-top: 0;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.glass-card h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
    letter-spacing: 0.3px;
}

.glass-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.glass-card p {
    color: rgba(255,255,255,0.92);
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* === STAT CARDS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(31, 38, 135, 0.3);
    padding: 24px;
    transition: all 0.4s var(--transition-bounce);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out both;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.8s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 25px 60px rgba(31, 38, 135, 0.5);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.stat-icon {
    width: 50px; height: 50px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.4s var(--transition-bounce);
}

.stat-icon:hover {
    transform: rotate(15deg) scale(1.2);
}

.stat-icon.purple   { background: var(--gradient-primary); }
.stat-icon.pink     { background: var(--gradient-secondary); }
.stat-icon.blue     { background: var(--gradient-success); }
.stat-icon.green    { background: var(--gradient-warning); }

.stat-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* === FORMS === */
.glass-card label {
    display: block;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.glass-card input,
.glass-card select,
.glass-card textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 14px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.glass-card input::placeholder,
.glass-card textarea::placeholder {
    color: rgba(255,255,255,0.5);
}

.glass-card input:focus,
.glass-card select:focus,
.glass-card textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.glass-card select option {
    background: #1e293b;
    color: #fff;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 16px;
}

.form-full {
    grid-column: 1 / -1;
}

/* === BUTTONS === */
.btn-glass {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(102,126,234,0.8) 0%, rgba(118,75,162,0.8) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 14px;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.3s var(--transition-bounce);
    position: relative;
    overflow: hidden;
}

.btn-glass::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.btn-glass:hover::before {
    left: 100%;
}

.btn-glass:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.5);
}

.btn-glass.full-width {
    width: 100%;
}

.btn-glass.muted {
    background: rgba(51, 65, 85, 0.6);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.btn-glass.muted:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.btn-glass.danger {
    background: linear-gradient(135deg, rgba(239,68,68,0.8), rgba(220,38,38,0.8));
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.3);
}

.btn-glass.success {
    background: linear-gradient(135deg, rgba(79,172,254,0.8), rgba(0,242,254,0.8));
    box-shadow: 0 10px 25px rgba(79, 172, 254, 0.3);
}

.toolbar-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.toolbar-row form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-row input,
.toolbar-row select {
    margin-bottom: 0;
    width: auto;
}

.toolbar-row label {
    margin-bottom: 0;
}

/* === TABLES === */
.glass-card table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 14px;
    overflow: hidden;
}

.glass-card th,
.glass-card td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.glass-card th {
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.glass-card td {
    color: rgba(255,255,255,0.92);
    font-size: 0.9rem;
}

.glass-card tr:hover td {
    background: rgba(255,255,255,0.05);
}

/* === RECEIPT A4 SIZE === */
.receipt-box {
    background: #fff;
    border: 2px solid #c0392b;
    border-radius: 0;
    padding: 0;
    color: #1e293b;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto 30px;
    overflow: hidden;
    font-size: .92rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,.12);
}

/* Header: logo + brand + barcode */
.receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 18px 24px 10px;
}
.receipt-logo {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex: 1;
}
.receipt-logo-icon svg {
    display: block;
}
.receipt-brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #c0392b;
    margin: 0;
    line-height: 1.2;
}
.receipt-brand-name span {
    font-weight: 400;
    font-size: .85rem;
    display: block;
    color: #555;
}
.receipt-brand-tagline {
    font-size: .62rem;
    color: #777;
    margin: 4px 0 0;
    line-height: 1.4;
    max-width: 380px;
}
.receipt-barcode {
    text-align: center;
    flex-shrink: 0;
}
.receipt-barcode canvas {
    display: block;
    max-width: 200px;
}
.barcode-label {
    display: block;
    font-size: .7rem;
    font-family: monospace;
    color: #333;
    margin-top: 2px;
}

/* Title banner */
.receipt-title-bar {
    background: #c0392b;
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    padding: 6px 0;
    letter-spacing: 1px;
}

/* Patient info two-column */
.receipt-info {
    display: flex;
    justify-content: space-between;
    padding: 14px 24px;
    gap: 20px;
    border-bottom: 1px solid #ddd;
}
.receipt-info p {
    margin: 3px 0;
    font-size: .85rem;
    color: #333;
}
.receipt-info strong {
    color: #111;
}
.receipt-info-right {
    text-align: right;
    flex-shrink: 0;
}

/* Items table */
.receipt-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    flex: 1;
}
.receipt-table th {
    background: #f5f5f5;
    border: 1px solid #bbb;
    padding: 8px 12px;
    font-weight: 700;
    font-size: .85rem;
    color: #222;
}
.receipt-table td {
    border: 1px solid #bbb;
    padding: 8px 12px;
    font-size: .85rem;
    color: #333;
    min-height: 32px;
}

/* Summary box */
.receipt-summary {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 30px;
    padding: 16px 24px;
    border: 1px solid #bbb;
    margin: 16px 24px;
    position: relative;
}
.receipt-paid-stamp {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%) rotate(-18deg);
    font-size: 2.2rem;
    font-weight: 900;
    color: #c0392b;
    border: 4px solid #c0392b;
    border-radius: 10px;
    padding: 2px 18px;
    opacity: .7;
}
.receipt-summary-table {
    text-align: right;
}
.receipt-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    padding: 3px 0;
    font-size: .88rem;
}
.receipt-net {
    font-weight: 700;
    border-top: 1px solid #999;
    padding-top: 6px;
    margin-top: 4px;
}

/* Bank info */
.receipt-bank {
    text-align: center;
    padding: 8px 24px;
    font-size: .82rem;
    color: #444;
    border-top: 1px solid #ddd;
}

/* Footer */
.receipt-footer {
    background: #c0392b;
    color: #fff;
    text-align: center;
    padding: 10px 24px;
    font-size: .78rem;
}
.receipt-footer p {
    margin: 2px 0;
}
.receipt-footer strong {
    color: #fce4ec;
}
.receipt-footer-tagline {
    font-style: italic;
    margin-top: 4px !important;
    font-size: .72rem;
    opacity: .85;
}

/* Legacy invoice-box kept for backward compat */
.invoice-box {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 40px rgba(31, 38, 135, 0.2);
    color: #1e293b;
}

.invoice-box h2, .invoice-box h3 {
    color: #1e293b;
}

.invoice-box table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-box th, .invoice-box td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.invoice-box th {
    background: #eef2ff;
    color: #1e293b;
}

/* === QUICK ACTIONS === */
.quick-actions {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px !important;
    font-size: .92rem;
    font-weight: 600;
}
.quick-icon {
    font-size: 1.2rem;
}

/* === CHART CARDS === */
.chart-card {
    padding: 20px;
}
.chart-card h3 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.chart-wrap {
    position: relative;
    height: 300px;
    width: 100%;
}

/* === ALERTS === */
.alert-success {
    backdrop-filter: blur(15px);
    background: rgba(22, 163, 74, 0.15);
    border: 1px solid rgba(22, 163, 74, 0.3);
    border-radius: 14px;
    padding: 12px 16px;
    color: #dcfce7;
    font-weight: 600;
    margin-bottom: 14px;
}

.alert-error {
    backdrop-filter: blur(15px);
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 14px;
    padding: 12px 16px;
    color: #fecaca;
    font-weight: 600;
    margin-bottom: 14px;
}

/* === KPI COLORS === */
.kpi-positive { color: #4ade80 !important; }
.kpi-negative { color: #f87171 !important; }

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.3); }
    50% { box-shadow: 0 0 40px rgba(102, 126, 234, 0.6); }
}

/* === MOBILE SIDEBAR BACKDROP === */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 45;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .app-sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .app-sidebar.show {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(31, 38, 135, 0.2);
    }

    .app-topbar {
        left: 0;
    }

    .app-main {
        margin-left: 0;
    }

    .topbar-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .glass-card {
        padding: 18px;
        border-radius: 18px;
    }

    .ultra-glass {
        margin: 16px;
        padding: 1.75rem;
        border-radius: 20px;
    }

    .stat-card:hover {
        transform: translateY(-5px) scale(1.02);
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .app-main {
        padding-left: 12px;
        padding-right: 12px;
    }

    .glass-card {
        padding: 14px;
    }

    .toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-row form {
        width: 100%;
    }
}

/* === SERVICES GRID === */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
    margin-top: 1rem;
}
.service-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.5rem;
    text-align: center;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}
.service-card-icon {
    font-size: 2.4rem;
    margin-bottom: .6rem;
}
.service-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: .4rem;
}
.service-card-desc {
    font-size: .85rem;
    color: #555;
    margin-bottom: .8rem;
    min-height: 2.4em;
}
.service-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    margin-bottom: .8rem;
}
.badge-active {
    background: rgba(67, 233, 123, .25);
    color: #1b8a3e;
}
.badge-inactive {
    background: rgba(250, 112, 154, .25);
    color: #c0392b;
}
.service-inactive {
    opacity: .55;
}
.service-card-actions {
    display: flex;
    gap: .5rem;
    justify-content: center;
}
.btn-sm {
    padding: 5px 12px !important;
    font-size: .78rem !important;
}
.btn-danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%) !important;
}

/* === DYNAMIC ROWS (multi-service) === */
.dynamic-rows {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.dynamic-row {
    display: flex;
    gap: .5rem;
    align-items: center;
}
.dynamic-row select,
.dynamic-row input {
    flex: 1;
    min-width: 0;
}
.dynamic-row .btn-sm {
    flex: 0 0 auto;
}
.inv-row select { flex: 2; }
.inv-row input { flex: 1; }

/* === FILTER TABS === */
.filter-tabs {
    display: flex;
    gap: 6px;
}
.filter-tabs .active-tab {
    background: var(--gradient-primary) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}
.filter-form {
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-form label {
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
}

/* === P&L REPORT === */
.only-print { display: none; }

.pl-report {
    background: #fff;
    color: #1e293b;
    font-family: 'Segoe UI', Arial, sans-serif;
    width: 100%;
    margin: 0 auto 24px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0,0,0,.12);
}
.pl-report-header {
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 3px solid #c0392b;
    padding-bottom: 12px;
    margin-bottom: 18px;
}
.pl-report-logo {
    height: 55px;
    width: auto;
}
.pl-report-header h1 {
    font-size: 1.4rem;
    color: #c0392b;
    margin: 0;
}
.pl-report-header p {
    margin: 2px 0;
    font-size: .88rem;
    color: #555;
}
.pl-period {
    font-weight: 700;
    color: #222 !important;
}

.pl-report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}
.pl-section-head th {
    background: #c0392b;
    color: #fff;
    padding: 7px 12px;
    font-size: .9rem;
    text-align: left;
}
.pl-report-table th {
    background: #f5f5f5;
    border: 1px solid #ccc;
    padding: 6px 10px;
    font-size: .82rem;
    color: #222;
}
.pl-report-table td {
    border: 1px solid #ccc;
    padding: 6px 10px;
    font-size: .82rem;
}
.pl-total-row td {
    background: #fef3f3;
    border-top: 2px solid #c0392b;
}

.pl-summary {
    margin-top: auto;
    border: 2px solid #333;
    padding: 14px 20px;
    max-width: 320px;
    margin-left: auto;
}
.pl-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: .9rem;
}
.pl-net {
    font-weight: 800;
    font-size: 1.05rem;
    border-top: 2px solid #333;
    padding-top: 8px;
    margin-top: 6px;
}
.pl-profit { color: #1b7a3e; }
.pl-loss { color: #c0392b; }

.pl-report-footer {
    margin-top: 20px;
    border-top: 1px solid #ccc;
    padding-top: 8px;
    text-align: center;
    font-size: .72rem;
    color: #888;
}

/* === PRINT === */
@page {
    size: A4 portrait;
    margin: 0;
}

@media print {
    *, *::before, *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html, body {
        width: 210mm;
        height: 297mm;
        margin: 0 !important;
        padding: 0 !important;
    }

    .app-sidebar,
    .app-topbar,
    .sidebar-backdrop,
    .no-print,
    .toolbar-row,
    .glass-card.no-print {
        display: none !important;
    }

    .only-print {
        display: block !important;
    }

    body, .dashboard-bg {
        background: #fff !important;
        animation: none !important;
    }

    .app-main {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .glass-card {
        background: #fff !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        border: 1px solid #e5e7eb !important;
        color: #000 !important;
    }

    .glass-card h2, .glass-card h3, .glass-card td, .glass-card th, .glass-card p, .glass-card label {
        color: #000 !important;
        -webkit-text-fill-color: #000 !important;
        background: none !important;
    }

    .invoice-box {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .receipt-box {
        width: 100% !important;
        min-height: 100vh !important;
        border: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .receipt-table {
        flex: 1;
    }

    .receipt-footer {
        margin-top: auto;
    }

    /* P&L report print */
    .pl-report {
        width: 100% !important;
        min-height: auto !important;
        padding: 15mm !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    .pl-section-head th {
        background: #c0392b !important;
        color: #fff !important;
    }
    .pl-total-row td {
        background: #fef3f3 !important;
    }
}

/* === SITE FOOTER === */
.site-footer {
    margin-left: var(--sidebar-width);
    padding: 18px 24px;
    text-align: center;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255,255,255,0.12);
}
.site-footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.footer-logo {
    height: 36px;
    width: auto;
    margin-bottom: 4px;
    border-radius: 6px;
}
.site-footer p {
    margin: 0;
    font-size: .78rem;
    color: rgba(255,255,255,0.7);
}
.site-footer a {
    color: #a5b4fc;
    text-decoration: none;
    font-weight: 600;
}
.site-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.35); }
