:root {
    --primary-color: #006269;
    --primary-hover: #004f54;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

/* Tooltip Styles */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip-container .tooltip-text {
    visibility: hidden;
    width: 300px;
    background-color: var(--surface-color);
    color: var(--text-primary);
    text-align: left;
    border-radius: 6px;
    padding: 1rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -150px;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
    line-height: 1.5;
}

.tooltip-container .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--surface-color) transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sticky wrapper: keeps banner + navbar pinned together at the top */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 70;
}

/* Navigation */
.navbar {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: auto;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    transition: transform 0.3s ease;
}

/* Hamburger Menu Button (hidden on desktop) */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 100;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger animation when active */
.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 60;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

/* Layout */
.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    flex: 1;
}

/* Cards */
.card {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

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

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

.btn-secondary:hover {
    background-color: var(--background-color);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    background-color: var(--background-color);
    padding: 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

/* Utilities */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.flex {
    display: flex;
}

.gap-2 {
    gap: 0.5rem;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

/* Status Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
    text-align: center;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: none;
}

.badge-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-secondary_pending {
    background-color: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.badge-approved {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-denied {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-paid {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-rec_pending {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-rec_approved {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-rec_denied {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-reconciled {
    background-color: #f3e8ff;
    color: #6b21a8;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.alert-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* Login Page Specific */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
}

@media print {

    .navbar,
    .btn,
    .no-print,
    footer,
    form,
    .alert {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body {
        background-color: white !important;
        color: black !important;
        font-size: 12px !important;
    }

    h1 {
        font-size: 18px !important;
        margin-bottom: 0.5rem !important;
    }

    h2,
    h3,
    .card-title {
        font-size: 14px !important;
        margin-bottom: 0.5rem !important;
    }

    .container {
        padding: 0 !important;
        max-width: 100% !important;
    }

    .table th,
    .table td {
        padding: 0.25rem 0.5rem !important;
        font-size: 12px !important;
    }

    .badge {
        border: 1px solid #000;
        color: #000 !important;
        background: none !important;
        padding: 0.1rem 0.4rem !important;
        font-size: 10px !important;
    }

    /* Ensure tooltips are hidden */
    .tooltip-container {
        border-bottom: none !important;
    }

    .tooltip-text {
        display: none !important;
    }
}

/* Custom Utilities for New Request Form */
.grid-2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 768px) {
    .grid-2-cols {
        grid-template-columns: 1fr;
    }
}

.p-4 {
    padding: 1rem;
}

.p-2 {
    padding: 0.5rem;
}

.pt-4 {
    padding-top: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.border {
    border: 1px solid var(--border-color);
}

.border-t {
    border-top: 1px solid var(--border-color);
}

.rounded {
    border-radius: var(--radius-md);
}

.bg-gray-50 {
    background-color: #f8fafc;
}

.cursor-pointer {
    cursor: pointer;
}

.text-xs {
    font-size: 0.75rem;
}

.text-red-500 {
    color: var(--danger-color);
}

.text-blue-800 {
    color: #1e40af;
}

.bg-blue-50 {
    background-color: #eff6ff;
}

.border-blue-100 {
    border-color: #dbeafe;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    .navbar {
        display: none !important;
    }

    footer {
        display: none !important;
    }

    /* Print attachments container - hidden on screen, visible in print */
    #print-attachments {
        display: block !important;
        page-break-before: always;
        padding-top: 0;
        margin-top: 0;
    }

    #print-attachments h2 {
        font-size: 16px !important;
        font-weight: bold;
        margin: 0 0 0.5rem 0 !important;
        padding: 0 !important;
    }

    #print-attachments .attachment-item {
        margin-bottom: 1rem;
        page-break-inside: avoid;
    }

    #print-attachments .attachment-label {
        font-size: 12px !important;
        font-weight: bold;
        margin-bottom: 0.25rem;
        page-break-after: avoid;
    }

    #print-attachments img,
    #print-attachments canvas {
        max-width: 85%;
        height: auto;
        display: block;
        margin-bottom: 0.25rem;
        border: 1px solid #000;
        page-break-inside: avoid;
    }

    /* Add page break between PDF pages if needed */
    #print-attachments .pdf-page {
        page-break-inside: avoid;
        margin-bottom: 0.5rem;
    }
}

/* Screen styles - hide attachments container */
#print-attachments {
    display: none;
}

/* Dual-Mode Signature Styles */
.signature-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.signature-tab {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: var(--background-color);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    text-align: center;
    font-size: 0.9375rem;
}

.signature-tab.active {
    background: var(--surface-color);
    border-bottom-color: var(--surface-color);
    color: var(--primary-color);
    font-weight: 600;
}

.signature-tab:hover:not(.active) {
    background: #e2e8f0;
}

.signature-tab i {
    margin-right: 0.375rem;
}

.signature-mode {
    display: none;
}

.signature-mode.active {
    display: block;
}

.signature-canvas-container {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px;
    background: #fff;
    position: relative;
    margin-top: 0;
}

.signature-canvas {
    touch-action: none;
    width: 100%;
    height: 150px;
    cursor: crosshair;
    display: block;
}

.signature-type-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
}

.signature-type-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.signature-type-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--background-color);
    border-radius: 0.25rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: inline-block;
    margin-left: 0.5rem;
}

/* Print override for signature badge */
@media print {
    .signature-type-badge {
        display: none !important;
    }

    .no-print {
        display: none !important;
    }
}

/* Mobile Responsive Navbar */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
    }

    .navbar-brand {
        font-size: 1.125rem;
        z-index: 100;
    }

    .navbar-brand img {
        height: 32px !important;
    }

    /* Show hamburger menu on mobile */
    .hamburger-menu {
        display: flex;
    }

    /* Transform navbar into mobile drawer */
    .navbar-nav {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 280px;
        max-width: 85%;
        background-color: var(--surface-color);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 5rem 0 2rem 0;
        gap: 0;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transform: translateX(100%);
        z-index: 90;
        overflow-y: auto;
    }

    .navbar-nav.active {
        transform: translateX(0);
    }

    /* Style mobile nav links */
    .navbar-nav .nav-link {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        text-align: left;
        color: var(--text-primary);
    }

    .navbar-nav .nav-link:hover {
        background-color: var(--background-color);
    }

    .navbar-nav .nav-username {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
        font-weight: 600;
        opacity: 1 !important;
        color: var(--primary-color);
    }

    .navbar-nav .btn {
        margin: 1rem 1.5rem;
        width: calc(100% - 3rem);
        text-align: center;
    }

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}