/* Terra Seven Construction Custom Styles */

:root {
    --terra-primary: #1e3a8a;
    --terra-secondary: #3b82f6;
    --terra-accent: #1d4ed8;
    --terra-light: #dbeafe;
    --terra-dark: #1e40af;
    --terra-success: #059669;
    --terra-warning: #d97706;
    --terra-danger: #dc2626;
}

/* Base layout fixes */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-image: url('../images/build.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.app {
    position: relative;
    min-height: 100vh;
}

/* Header Branding */
.app-header {
    position: fixed;
    top: 0;
    left: 250px;
    right: 0;
    height: 70px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.app-header__branding {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.app-header__logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.app-header__logo:hover {
    transform: scale(1.02);
}

.header-logo {
    height: 50px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(30, 58, 138, 0.2);
}

/* Sidebar toggle button */
.app-sidebar__toggle {
    background: none;
    border: none;
    color: var(--terra-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.app-sidebar__toggle:hover {
    color: var(--terra-secondary);
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.05);
}

/* Sidebar Styling */
.app-sidebar {
    background: linear-gradient(135deg, var(--terra-primary) 0%, var(--terra-secondary) 100%);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 250px;
    z-index: 1000;
    overflow-y: auto;
}

.app-sidebar__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* Sidebar User Info Styling */
.app-sidebar__user {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.app-sidebar__user-name {
    color: white;
    font-weight: 600;
    margin: 0 0 5px 0;
    font-size: 16px;
}

.app-sidebar__user-designation {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 5px 0;
    font-size: 12px;
}

.app-sidebar__user-branch {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.app-sidebar__user-branch:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.app-sidebar__user-branch i {
    margin-right: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 10px;
}

/* Special styling for users without branch assignment */
.app-sidebar__user-branch--no-branch {
    background: rgba(220, 38, 38, 0.2) !important;
    border-color: rgba(220, 38, 38, 0.4) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.app-sidebar__user-branch--no-branch:hover {
    background: rgba(220, 38, 38, 0.3) !important;
    border-color: rgba(220, 38, 38, 0.5) !important;
}

.app-menu__item {
    color: rgba(255, 255, 255, 0.8) !important;
    border-left: 3px solid transparent;
}

.app-menu__item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white !important;
    border-left-color: var(--terra-secondary);
}

.app-menu__item.active {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    border-left-color: white;
}

.app-menu__icon {
    color: rgba(255, 255, 255, 0.8);
}

.app-menu__item:hover .app-menu__icon,
.app-menu__item.active .app-menu__icon {
    color: white;
}

/* Dashboard Cards */
.widget-small.primary {
    background: linear-gradient(135deg, var(--terra-primary) 0%, var(--terra-secondary) 100%);
}

.widget-small.info {
    background: linear-gradient(135deg, var(--terra-secondary) 0%, var(--terra-accent) 100%);
}

.widget-small.warning {
    background: linear-gradient(135deg, var(--terra-warning) 0%, #f59e0b 100%);
}

.widget-small.danger {
    background: linear-gradient(135deg, var(--terra-danger) 0%, #ef4444 100%);
}

/* Completed card text color */
.widget-small.success h4,
.widget-small.success p,
.widget-small.success b {
    color: #000000 !important;
}

/* Buttons */
.btn-primary {
    background: var(--terra-primary);
    border-color: var(--terra-primary);
}

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

.btn-info {
    background: var(--terra-secondary);
    border-color: var(--terra-secondary);
}

.btn-info:hover {
    background: var(--terra-accent);
    border-color: var(--terra-accent);
}

/* Login Page */
.login-content .logo {
    text-align: center;
}

.login-content .logo .terra-logo {
    height: 80px;
    width: auto;
    margin-bottom: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(30, 58, 138, 0.2);
}

.login-content .logo h2 {
    color: var(--terra-primary);
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-content .logo p {
    color: var(--terra-secondary);
    font-size: 16px;
    font-weight: 400;
    margin: 0;
    opacity: 0.9;
}

/* Page Titles */
.app-title h1 {
    color: var(--terra-primary);
}

.app-title p {
    color: var(--terra-secondary);
}

/* Breadcrumbs */
.app-breadcrumb .breadcrumb-item a {
    color: var(--terra-secondary);
}

.app-breadcrumb .breadcrumb-item.active a {
    color: var(--terra-primary);
}

/* Tables */
.table thead th {
    background: var(--terra-light);
    color: var(--terra-primary);
    border-color: var(--terra-secondary);
}

/* Form Controls */
.form-control:focus {
    border-color: var(--terra-secondary);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

/* Remember me checkbox styling */
.animated-checkbox input[type="checkbox"]:checked + span {
    color: var(--terra-primary);
    font-weight: 500;
}

.animated-checkbox input[type="checkbox"]:checked {
    accent-color: var(--terra-primary);
}

/* Navigation */
.navbar-brand {
    color: var(--terra-primary) !important;
    font-weight: bold;
}

/* Header Navigation Menu */
.app-nav {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.app-nav__item {
    color: var(--terra-primary);
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    text-decoration: none;
}

.app-nav__item:hover {
    color: var(--terra-secondary);
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.05);
    text-decoration: none;
}

/* User name in header */
.app-nav__item .user-name {
    margin-left: 8px;
    font-weight: 500;
    color: var(--terra-primary);
    font-size: 14px;
}

.app-nav__item:hover .user-name {
    color: var(--terra-secondary);
}

/* Responsive user name */
@media (max-width: 768px) {
    .app-nav__item .user-name {
        display: none;
    }
    
    .app-nav__item {
        min-width: 35px;
        height: 35px;
    }
}

.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 8px 0;
}

.dropdown-item {
    padding: 8px 20px;
    color: var(--terra-primary);
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--terra-secondary);
}

/* Custom Terra Seven Construction Logo */
.terra-logo {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 18px;
}

.terra-logo i {
    color: var(--terra-primary);
    margin-right: 8px;
    font-size: 20px;
}

.terra-logo .terra-text {
    color: var(--terra-primary);
}

.terra-logo .construction-text {
    color: var(--terra-secondary);
}

/* Construction-themed icons */
.construction-icon {
    color: var(--terra-primary);
}

.material-icon {
    color: var(--terra-secondary);
}

.project-icon {
    color: var(--terra-success);
}

/* Footer */
.app-footer {
    background: var(--terra-primary);
    color: white;
    text-align: center;
    padding: 15px 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .app-header {
        left: 0;
        padding: 0 15px;
    }
    
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .app.sidenav-toggled .app-sidebar {
        transform: translateX(0);
    }
    
    .app-content,
    .construction-bg {
        margin-left: 0;
    }
    
    .header-logo {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 0 10px;
    }
    
    .header-logo {
        height: 35px;
    }
}

/* Custom animations */
@keyframes terraFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.terra-animate {
    animation: terraFadeIn 0.6s ease-out;
}

/* Construction-themed backgrounds */
.construction-bg {
    background: linear-gradient(135deg, var(--terra-light) 0%, #f8fafc 100%);
    margin-left: 250px;
    margin-top: 70px;
    min-height: calc(100vh - 70px);
    padding: 20px;
}

/* Main content area */
.app-content {
    margin-left: 250px;
    margin-top: 70px;
    padding: 20px;
    min-height: calc(100vh - 70px);
    background: rgba(248, 249, 250, 0.3);
    backdrop-filter: blur(1px);
}

/* Custom card shadows */
.terra-card {
    box-shadow: 0 4px 6px rgba(30, 58, 138, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.1);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(2px);
}

.terra-card:hover {
    box-shadow: 0 8px 15px rgba(30, 58, 138, 0.15);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Ensure tiles and content areas are readable */
.tile {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(2px);
}

.app-title {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(1px);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
} 

/* Enhanced Login Form Styles */
.login-content .form-group {
    margin-bottom: 20px;
}

.login-content .form-control {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #ffffff;
}

.login-content .form-control:focus {
    border-color: var(--terra-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
    outline: none;
}

.login-content .form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.login-content .invalid-feedback {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    color: #dc3545;
    animation: fadeIn 0.3s ease;
}

.login-content .btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-content .btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-content .btn i {
    margin-right: 8px;
    transition: all 0.3s ease;
}

.login-content .btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.3);
}

.login-content .btn.btn-hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.3);
}

.login-content .btn-primary {
    background: linear-gradient(135deg, var(--terra-primary) 0%, #1e40af 100%);
    border: none;
    color: white;
}

.login-content .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1e40af 0%, var(--terra-primary) 100%);
}

.login-content .utility {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.login-content .animated-checkbox {
    display: flex;
    align-items: center;
}

.login-content .animated-checkbox input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.login-content .semibold-text a {
    color: var(--terra-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.login-content .semibold-text a:hover {
    color: #1e40af;
    text-decoration: underline;
}

/* Flip Animation Enhancements */
.login-box {
    transition: transform 0.6s ease-in-out;
    transform-style: preserve-3d;
    position: relative;
}

.login-box.flipped {
    transform: rotateY(180deg);
}

.login-form,
.forget-form {
    backface-visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.forget-form {
    transform: rotateY(180deg);
}

/* Loading States */
.btn i.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Responsive Enhancements */
@media (max-width: 768px) {
    .login-content .logo h2 {
        font-size: 24px;
    }
    
    .login-content .logo p {
        font-size: 14px;
    }
    
    .login-content .form-control {
        padding: 10px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .login-content .btn {
        padding: 10px 20px;
        font-size: 16px;
    }
}

/* Focus Management */
.login-content .form-control:focus {
    transform: scale(1.02);
}

/* Error State Animations */
.login-content .form-control.is-invalid {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success State */
.login-content .form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Accessibility Improvements */
.login-content .form-control:focus {
    outline: 2px solid var(--terra-primary);
    outline-offset: 2px;
}

.login-content .btn:focus {
    outline: 2px solid var(--terra-primary);
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .login-content .form-control {
        background-color: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .login-content .form-control:focus {
        background-color: #111827;
        border-color: var(--terra-primary);
    }
} 

/* Invoice Branch Information Styling */
.branch-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.branch-info p {
    margin: 5px 0;
    font-size: 12px;
    color: #333;
}

.branch-info p strong {
    color: var(--terra-primary);
    font-weight: 600;
}

.branch-info .text-warning {
    color: var(--terra-warning) !important;
}

/* Branch Badge Styling */
.badge.badge-info {
    background-color: var(--terra-secondary);
    color: white;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 15px;
}

.badge.badge-warning {
    background-color: var(--terra-warning);
    color: white;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 15px;
}

.badge i {
    margin-right: 4px;
    font-size: 10px;
} 

/* Invoice Print Styles - Ensure One Page Layout */
@media print {
    /* Hide non-essential elements when printing */
    .app-title,
    .breadcrumb,
    .d-print-none,
    .btn,
    .app-content,
    .construction-bg {
        display: none !important;
    }
    
    /* Reset margins and padding for print */
    body, html {
        margin: 0 !important;
        padding: 0 !important;
        font-size: 10px !important;
        line-height: 1.1 !important;
        background: white !important;
    }
    
    /* Invoice container styling for print */
    .print-invoice {
        margin: 0 !important;
        padding: 5px !important;
        box-shadow: none !important;
        border: none !important;
        background: white !important;
        width: 100% !important;
        max-width: none !important;
    }
    
    /* Ultra-compact header spacing */
    .invoice .row.mb-2 {
        margin-bottom: 8px !important;
    }
    
    .invoice .row.mb-2 h6 {
        font-size: 11px !important;
        margin: 0 !important;
        line-height: 1.1 !important;
    }
    
    .invoice .row.mb-2 small {
        font-size: 9px !important;
        margin: 2px 0 0 0 !important;
        line-height: 1.1 !important;
    }
    
    /* Ultra-compact invoice info spacing */
    .invoice-info.mb-2 {
        margin-bottom: 8px !important;
    }
    
    .invoice-info .col-4 {
        padding: 0 5px !important;
    }
    
    .invoice-info address.mb-1 {
        font-size: 9px !important;
        line-height: 1.1 !important;
        margin: 0 !important;
    }
    
    .invoice-info .col-4:last-child {
        font-size: 9px !important;
        line-height: 1.1 !important;
    }
    
    /* Ultra-compact table styling */
    .table {
        margin-bottom: 8px !important;
        font-size: 9px !important;
    }
    
    .table-sm th {
        padding: 3px 2px !important;
        font-size: 9px !important;
        font-weight: bold !important;
    }
    
    .table-sm td {
        padding: 2px 2px !important;
        font-size: 9px !important;
    }
    
    /* Ultra-compact stamp area */
    .stamp-area {
        margin-top: 8px !important;
    }
    
    .stamp-section h6.mb-1 {
        font-size: 10px !important;
        margin: 0 0 4px 0 !important;
        line-height: 1.1 !important;
    }
    
    .stamp-section p.mb-1 {
        font-size: 8px !important;
        margin: 2px 0 !important;
        line-height: 1.1 !important;
    }
    
    .branch-info {
        padding: 4px !important;
        margin-top: 2px !important;
    }
    
    .branch-info p.mb-1 {
        font-size: 8px !important;
        margin: 1px 0 !important;
        line-height: 1.1 !important;
    }
    
    /* Optimize logo size for print */
    .invoice img {
        height: 30px !important;
        width: auto !important;
    }
    
    /* Ensure proper page breaks */
    .invoice {
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
        page-break-before: avoid !important;
    }
    
    /* Ultra-compact spacing for all rows */
    .row {
        margin: 0 !important;
    }
    
    .col-md-12, .col-6, .col-4 {
        padding: 0 2px !important;
    }
    
    /* Remove all unnecessary spacing */
    .mt-3, .mt-4, .mb-4, .mt-2, .mb-2 {
        margin: 0 !important;
    }
    
    /* Ensure table fits in available space */
    .table-responsive {
        overflow: visible !important;
    }
    
    /* Ultra-compact signature and stamp areas */
    .signature-line, .stamp-box {
        margin: 2px 0 !important;
    }
    
    .signature-placeholder {
        font-size: 8px !important;
        line-height: 1.1 !important;
    }
    
    .stamp-text {
        font-size: 7px !important;
        line-height: 1.0 !important;
    }
    
    /* Force single page layout */
    @page {
        margin: 0.5in !important;
        size: A4 !important;
    }
    
    /* Additional compact styling for print */
    .invoice * {
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* Ensure all text fits */
    .invoice {
        font-size: 9px !important;
        line-height: 1.1 !important;
    }
    
    /* Compact address formatting */
    address {
        font-style: normal !important;
        line-height: 1.1 !important;
    }
    
    /* Optimize signature area */
    .signature-box {
        height: 20px !important;
        line-height: 20px !important;
    }
    
    /* Optimize stamp area */
    .stamp-circle {
        padding: 2px !important;
    }
}

/* Additional compact styling for screen view */
.print-invoice {
    max-width: 800px;
    margin: 0 auto;
}

.invoice .row.mb-4 h5,
.invoice .row.mb-4 h6 {
    margin: 0;
}

.invoice-info address {
    margin: 0;
    line-height: 1.4;
}

.table th,
.table td {
    padding: 8px 6px;
}

.stamp-section h5 {
    margin-bottom: 10px;
}

.branch-info {
    margin-top: 8px;
}

/* Compact invoice styling for better fit */
.invoice {
    font-size: 12px;
    line-height: 1.3;
}

.invoice .row.mb-2 {
    margin-bottom: 10px !important;
}

.invoice .row.mt-2 {
    margin-top: 10px !important;
}

.invoice-info.mb-2 {
    margin-bottom: 10px !important;
}

.invoice-info address.mb-1 {
    margin-bottom: 5px !important;
}

.stamp-section h6.mb-1 {
    margin-bottom: 5px !important;
}

.stamp-label.mb-1 {
    margin-bottom: 5px !important;
}

.branch-info p.mb-1 {
    margin-bottom: 3px !important;
}

/* Table optimization */
.table-sm th,
.table-sm td {
    padding: 4px 6px !important;
    font-size: 11px !important;
}

.table-sm th {
    font-weight: bold !important;
}

/* Logo optimization */
.invoice img {
    height: 50px !important;
    width: auto !important;
}

/* Compact spacing utilities */
.mb-1 {
    margin-bottom: 5px !important;
}

.mt-1 {
    margin-top: 5px !important;
}

.mb-2 {
    margin-bottom: 10px !important;
}

.mt-2 {
    margin-top: 10px !important;
} 

/* Additional ultra-compact styling for print */
@media print {
    /* Force single page layout with minimal margins */
    @page {
        margin: 0.25in !important;
        size: A4 portrait !important;
    }
    
    /* Make invoice container take full page width */
    .print-invoice {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 2px !important;
    }
    
    /* Ultra-compact row spacing */
    .invoice .row {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Minimal column padding */
    .invoice .col-6,
    .invoice .col-4,
    .invoice .col-12 {
        padding: 0 1px !important;
    }
    
    /* Ultra-compact table */
    .invoice .table {
        margin: 0 !important;
        font-size: 8px !important;
    }
    
    .invoice .table th,
    .invoice .table td {
        padding: 1px 2px !important;
        font-size: 8px !important;
        line-height: 1.0 !important;
    }
    
    /* Minimal spacing between sections */
    .invoice .row.mb-2 {
        margin-bottom: 4px !important;
    }
    
    .invoice .row.mt-2 {
        margin-top: 4px !important;
    }
    
    /* Compact address blocks */
    .invoice address {
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.0 !important;
        font-size: 8px !important;
    }
    
    /* Minimal stamp area */
    .invoice .stamp-area {
        margin-top: 4px !important;
    }
    
    .invoice .stamp-section {
        padding: 2px !important;
    }
    
    .invoice .stamp-section h6 {
        font-size: 9px !important;
        margin: 0 0 2px 0 !important;
        line-height: 1.0 !important;
    }
    
    .invoice .stamp-section p {
        font-size: 7px !important;
        margin: 1px 0 !important;
        line-height: 1.0 !important;
    }
    
    /* Compact branch info */
    .invoice .branch-info {
        padding: 2px !important;
        margin: 0 !important;
    }
    
    .invoice .branch-info p {
        font-size: 7px !important;
        margin: 0 !important;
        line-height: 1.0 !important;
    }
    
    /* Ensure logo is minimal */
    .invoice img {
        height: 25px !important;
        width: auto !important;
    }
    
    /* Force all content to fit */
    .invoice {
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
        page-break-before: avoid !important;
        max-height: 100vh !important;
        overflow: hidden !important;
    }
    
    /* Hide any overflow */
    .invoice * {
        max-height: none !important;
        overflow: visible !important;
    }
} 

/* Fix sidebar overlap issues */
.app-content {
    margin-left: 250px; /* Account for sidebar width */
    padding: 20px;
    min-height: calc(100vh - 60px); /* Account for header height */
    transition: margin-left 0.3s ease;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .app-content {
        margin-left: 0;
        padding: 15px;
    }
}

/* Ensure proper spacing for diagnostic page */
.diagnostic-page .app-content {
    margin-left: 250px;
    padding: 20px;
}

/* Fix tile layout spacing */
.tile {
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tile-heading {
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tile-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.tile-actions {
    display: flex;
    gap: 10px;
}

.tile-body {
    padding: 20px;
}

/* Ensure tables don't overflow */
.table-responsive {
    overflow-x: auto;
    border-radius: 4px;
}

/* Fix badge spacing in tables */
.table .badge {
    margin: 2px;
}

/* Responsive table adjustments */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 8px 4px;
    }
} 

/* Logo upload section styling */
.logo-upload-section {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.logo-upload-section:hover {
    border-color: var(--terra-primary);
    background: #f0f8ff;
}

.current-logo {
    text-align: center;
}

.current-logo label {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: block;
}

.logo-preview {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.logo-preview img {
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.logo-preview img:hover {
    border-color: var(--terra-primary);
    transform: scale(1.05);
}

.logo-upload {
    margin-top: 15px;
    text-align: center;
}

.logo-upload input[type="file"] {
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    background: white;
    transition: all 0.3s ease;
}

.logo-upload input[type="file"]:hover {
    border-color: var(--terra-primary);
}

.logo-upload input[type="file"]:focus {
    border-color: var(--terra-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#logo-preview {
    text-align: center;
    padding: 15px;
    background: #e8f5e8;
    border-radius: 6px;
    border: 1px solid #28a745;
}

#logo-preview label {
    font-weight: 600;
    color: #155724;
    margin-bottom: 10px;
    display: block;
}

/* Company settings form improvements */
.company-settings-form .form-group {
    margin-bottom: 20px;
}

.company-settings-form .form-control {
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.company-settings-form .form-control:focus {
    border-color: var(--terra-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.company-settings-form .btn {
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.company-settings-form .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
} 

/* Dynamic company logo styling */
.header-logo {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

.app-sidebar__user-avatar {
    max-width: 40px;
    height: auto;
    object-fit: contain;
    border-radius: 50%;
}

.terra-logo {
    max-height: 60px;
    width: auto;
    object-fit: contain;
}

/* Logo fallback handling */
.header-logo:not([src]),
.app-sidebar__user-avatar:not([src]),
.terra-logo:not([src]) {
    display: none;
}

/* Ensure logos don't break layout */
img[src*="company-logo"] {
    object-fit: contain;
    max-width: 100%;
    height: auto;
}

/* Logo preview styling */
.logo-preview img {
    object-fit: contain;
    max-width: 100%;
    height: auto;
}

/* Invoice logo styling */
.invoice img[src*="company-logo"] {
    max-height: 50px;
    width: auto;
    object-fit: contain;
}

/* Tile heading logo styling */
.tile-heading img[src*="company-logo"] {
    max-height: 40px;
    width: auto;
    object-fit: contain;
} 

/* Role restriction system styling */
.role-restriction-info {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    font-size: 12px;
}

.role-restriction-info i {
    color: #ffc107;
    margin-right: 5px;
}

.role-restriction-warning {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    font-size: 12px;
}

.role-restriction-warning i {
    color: #dc3545;
    margin-right: 5px;
}

/* User management action buttons */
.user-actions .btn {
    margin: 2px;
}

.user-actions .text-muted {
    font-style: italic;
    color: #6c757d !important;
}

/* Role badge enhancements */
.badge.badge-danger {
    background-color: #dc3545;
}

.badge.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge.badge-info {
    background-color: #17a2b8;
}

.badge.badge-secondary {
    background-color: #6c757d;
}

.badge.badge-light {
    background-color: #f8f9fa;
    color: #212529;
} 

/* User profile image styling */
.user-profile-image {
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-profile-image:hover {
    border-color: #007bff;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Sidebar user avatar styling */
.app-sidebar__user-avatar {
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.app-sidebar__user-avatar:hover {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Image upload section styling */
.image-upload-section {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.image-upload-section:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.image-upload-section:focus-within {
    border-color: #007bff;
    background: #f0f8ff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.image-preview {
    text-align: center;
    margin-top: 10px;
}

.image-preview img {
    border: 2px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.image-preview img:hover {
    border-color: #007bff;
    transform: scale(1.02);
}

.current-image {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.current-image label {
    font-weight: 600;
    color: #28a745;
    margin-bottom: 10px;
    display: block;
}

/* File input styling */
.form-control-file {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px;
    background: white;
    transition: all 0.3s ease;
}

.form-control-file:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Image removal button styling */
.btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
    transition: all 0.3s ease;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* User table image column styling */
#usersTable th:first-child,
#usersTable td:first-child {
    width: 60px;
    text-align: center;
    vertical-align: middle;
}

/* Large user profile image styling */
.user-profile-image-large {
    transition: all 0.3s ease;
    border: 4px solid #e9ecef !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.user-profile-image-large:hover {
    border-color: #007bff !important;
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15) !important;
}

.user-profile-header {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    margin-bottom: 20px;
}

.user-profile-header h3 {
    color: #495057;
    margin-bottom: 10px;
}

.badge-lg {
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 20px;
}

/* Responsive image handling */
@media (max-width: 768px) {
    .user-profile-image {
        width: 35px !important;
        height: 35px !important;
    }
    
    .app-sidebar__user-avatar {
        width: 35px !important;
        height: 35px !important;
    }
    
    .image-upload-section {
        padding: 15px;
    }
    
    .image-preview img {
        max-height: 120px !important;
        max-width: 160px !important;
    }
} 

/* Client Account Management Styling */
.client-account-permissions {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.client-account-permissions h5 {
    color: #28a745;
    margin-bottom: 10px;
}

.client-account-permissions ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.client-account-permissions li {
    color: #155724;
    margin-bottom: 5px;
}

/* Permission-based button styling */
.btn-permission-restricted {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-permission-allowed {
    opacity: 1;
    cursor: pointer;
}

/* Client account action buttons */
.client-account-actions .btn {
    margin: 5px;
    transition: all 0.3s ease;
}

.client-account-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Transaction type badges */
.badge.badge-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.badge.badge-success {
    background-color: #28a745;
}

.badge.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge.badge-info {
    background-color: #17a2b8;
}

.badge.badge-secondary {
    background-color: #6c757d;
}

/* Account balance styling */
.account-balance-positive {
    color: #28a745;
    font-weight: bold;
}

.account-balance-zero {
    color: #6c757d;
    font-weight: bold;
}

.account-balance-negative {
    color: #dc3545;
    font-weight: bold;
} 