@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #080b11;
    --surface-color: rgba(17, 25, 40, 0.65);
    --surface-hover: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.35);
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    
    --info: #06b6d4;
    --info-bg: rgba(6, 182, 212, 0.15);

    --sidebar-width: 280px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-logo {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo img {
    height: 36px;
    width: auto;
}

.sidebar-logo span {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-item a:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
    transform: translateX(4px);
}

.sidebar-item.active a {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.sidebar-item.active a i {
    color: #fff;
}

.sidebar-item i {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.sidebar-item a:hover i {
    transform: scale(1.1);
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* Main Panel */
.main-panel {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    height: var(--header-height);
    background: rgba(8, 11, 17, 0.4);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
}

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

.user-badge {
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-badge .role-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.user-badge.admin .role-dot {
    background: var(--warning);
}

.user-badge.user .role-dot {
    background: var(--success);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* Content Area */
.content-area {
    padding: 32px;
    flex-grow: 1;
}

/* Cards / Glassmorphism Panels */
.glass-card {
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    margin-bottom: 24px;
}

.glass-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

/* Dashboard Statistics / Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.3s, border-color 0.3s;
}

.summary-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.3);
}

.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.summary-icon.primary { background: var(--primary-glow); color: var(--primary); }
.summary-icon.success { background: var(--success-bg); color: var(--success); }
.summary-icon.danger { background: var(--danger-bg); color: var(--danger); }
.summary-icon.warning { background: var(--warning-bg); color: var(--warning); }

.summary-details h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.summary-details p {
    font-size: 1.4rem;
    font-weight: 700;
}

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

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

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    background: rgba(8, 11, 17, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(8, 11, 17, 0.8);
}

input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-family: inherit;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px var(--primary-glow);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--surface-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    filter: brightness(1.1);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    filter: brightness(1.1);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    margin-top: 10px;
}

th {
    padding: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-primary);
}

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

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* Alerts / Notifications */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-danger {
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* Login Page specifically */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface-color);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header img {
    height: 48px;
    margin-bottom: 16px;
}

.login-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 6px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 11, 17, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    padding: 24px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.modal-title {
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

/* Payment Method Badges Selector (Settings Page) */
.payment-modes-config {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(8, 11, 17, 0.4);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 10px;
    margin-top: 8px;
}

.payment-mode-tag {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.payment-mode-tag:hover {
    border-color: var(--danger);
    background: var(--danger-bg);
}

.payment-mode-tag a {
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s;
}

.payment-mode-tag:hover a {
    color: var(--danger);
}

.payment-mode-add-container {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Bill Creation Info Block */
.success-actions-block {
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.success-actions-title h4 {
    color: var(--success);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.success-actions-title p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.success-actions-buttons {
    display: flex;
    gap: 12px;
}

/* Payment History Log (modal) */
.history-payment-list {
    background: rgba(8, 11, 17, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.history-payment-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.history-payment-item:last-child {
    border-bottom: none;
}

/* Filter Forms preloading */
.pre-filter-box {
    max-width: 500px;
    margin: 40px auto;
    text-align: center;
}

/* Receipt Voucher Layout - J.R. Travels Replication */
.receipt-voucher-wrapper {
    background: #fff !important;
    color: #000 !important;
    padding: 40px;
    border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    font-family: Arial, sans-serif;
}

.receipt-voucher-wrapper,
.receipt-voucher-wrapper table td,
.receipt-voucher-wrapper table th,
.receipt-voucher-wrapper span,
.receipt-voucher-wrapper div,
.receipt-voucher-wrapper i {
    color: #000 !important;
}

.receipt-voucher-wrapper .receipt-address-line span,
.receipt-voucher-wrapper .receipt-address-line {
    color: #000 !important;
}

.receipt-voucher-wrapper .receipt-phone-icon,
.receipt-voucher-wrapper .receipt-phone-icon i,
.receipt-voucher-wrapper .receipt-location-dot,
.receipt-voucher-wrapper .receipt-location-dot i,
.receipt-voucher-wrapper .receipt-meta-icon,
.receipt-voucher-wrapper .receipt-meta-icon i {
    color: #fff !important;
}

.receipt-voucher-wrapper .receipt-title {
    color: #000 !important;
}

.receipt-voucher-wrapper .receipt-logo-subtitle {
    color: #3b82f6 !important;
}

.receipt-voucher-wrapper .proprietor-stamp {
    color: #4f46e5 !important;
}

.receipt-voucher-wrapper .amount-paid-green {
    color: #047857 !important;
}

.receipt-header-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.receipt-header-table td {
    padding: 0;
    border: none;
    background: none !important;
}

.receipt-logo-column {
    text-align: center;
    width: 50%;
}

.receipt-logo-column img {
    max-height: 65px;
    margin-bottom: 5px;
}

.receipt-logo-subtitle {
    font-size: 8px;
    font-weight: bold;
    color: #3b82f6;
    text-transform: uppercase;
}

.receipt-contact-left {
    width: 25%;
    font-size: 12px;
    font-weight: bold;
    vertical-align: middle;
}

.receipt-contact-right {
    width: 25%;
    font-size: 12px;
    font-weight: bold;
    text-align: right;
    vertical-align: middle;
}

.receipt-phone-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 10px;
    margin-right: 5px;
}

.receipt-meta-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 10px;
    margin-left: 5px;
}

.receipt-address-line {
    text-align: center;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.receipt-location-dot {
    width: 16px;
    height: 16px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
}

.receipt-title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 1px;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    padding: 8px 0;
    margin-bottom: 25px;
}

.receipt-meta-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.receipt-meta-table td {
    padding: 8px 12px;
    font-size: 13px;
    border: none;
    background: none !important;
}

.receipt-meta-table tr.row-bg td {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0;
}

.receipt-grid-border {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 25px;
}

.receipt-grid-border th {
    border: 1px solid #000;
    color: #000;
    background: #fff;
    padding: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.receipt-grid-border td {
    border: 1px solid #000;
    color: #000;
    background: #fff;
    padding: 12px 10px;
    text-align: center;
    font-size: 13px;
}

.receipt-footer-table {
    width: 100%;
    margin-top: 40px;
}

.receipt-footer-table td {
    border: none;
    padding: 0;
    font-size: 13px;
    background: none !important;
}

.receipt-footer-table .signature-box {
    text-align: right;
    font-weight: bold;
}

.receipt-footer-table .signature-line {
    width: 120px;
    border-bottom: 1px solid #ccc;
    display: inline-block;
    margin-bottom: 5px;
}

.receipt-footer-table .proprietor-stamp {
    font-size: 9px;
    color: #6366f1;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* CSS specific for window print */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
        background-image: none !important;
    }
    
    .sidebar,
    .header,
    .btn,
    .alert,
    .success-actions-block,
    .no-print {
        display: none !important;
    }
    
    .main-panel {
        margin-left: 0 !important;
        min-height: auto !important;
    }
    
    .content-area {
        padding: 0 !important;
    }
    
    .receipt-voucher-wrapper {
        box-shadow: none !important;
        padding: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    table, th, td, tr {
        page-break-inside: avoid;
    }
}
