/* Custom styles for Invoice System */

/* Import Inter font for modern look */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #F8FAFC;
    margin: 0;
    padding: 0;
    height: 100vh;
    color: #0F172A;
    line-height: 1.6;
    overflow: hidden; /* Prevent body scroll */
}

/* Authentication Page Styles */
.auth-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
}

.auth-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.05"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.05"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.03"/><circle cx="10" cy="90" r="0.5" fill="%23ffffff" opacity="0.03"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

/* Auth Card Glassmorphism Effect */
.auth-body .card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Enhanced Input Styles for Auth */
.auth-body .input-group-text {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.auth-body .form-control {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.auth-body .form-control:focus {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Auth Input Group Hover Effect */
.auth-body .input-group:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-body .input-group:hover .input-group-text {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.auth-body .input-group:hover .form-control {
    border-color: rgba(59, 130, 246, 0.3);
}

/* Auth Button Hover Effect */
.auth-body .btn-primary:hover {
    background: linear-gradient(135deg, #1D4ED8 0%, #1E40AF 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 260px;
    height: 70px;
    width: calc(100% - 260px);
    background: #334155;
    color: #ffffff;
    display: flex;
    align-items: center;
    padding: 0 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
    z-index: 1;
}

.header-content h4 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #ffffff;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
}

.sidebar-logo-img {
    height: 40px;
    width: auto;
    margin-bottom: 12px;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.sidebar-logo-img:hover {
    transform: scale(1.05);
}

.sidebar-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    text-align: center;
    letter-spacing: 0.5px;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-section button {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.user-section button:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.main-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #1E293B;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1001;
}

.sidebar nav {
    padding: 24px 0;
    flex: 1;
}

.nav-link {
    display: block;
    padding: 14px 20px;
    color: #a0aec0;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
    margin: 2px 8px;
    border-radius: 0 24px 24px 0;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
    background: rgba(255,255,255,0.1);
    border-left-color: #3B82F6;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-link i {
    margin-right: 12px;
    font-size: 1.1rem;
}

.nav-section {
    margin-bottom: 8px;
}

.sub-link {
    padding-left: 32px !important;
    font-size: 0.85rem;
}

/* Main Content Area */
.main-content {
    position: relative;
    margin-top: 70px;
    margin-bottom: 50px;
    margin-left: 260px;
    padding: 20px;
    background: #F8FAFC;
    overflow-y: auto;
    height: calc(100vh - 120px);
}

/* Footer Styles */
.footer {
    position: fixed;
    bottom: 0;
    left: 260px;
    height: 50px;
    width: calc(100% - 260px);
    background: #334155;
    border-top: 1px solid #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    color: #ffffff;
}

/* General Styles */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 700;
    color: #0F172A;
    letter-spacing: -0.025em;
}



p {
    margin-bottom: 12px;
    line-height: 1.7;
    color: #374151;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 4px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transition: width 0.6s, height 0.6s;
    transform: translate(-50%, -50%);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(160, 174, 192, 0.4);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(160, 174, 192, 0.6);
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.4);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245, 101, 101, 0.6);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.btn-success:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.6);
}

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

/* Form Styles */
.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 0.95rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background-color: #ffffff;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #0F172A;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mb-3 {
    margin-bottom: 24px;
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    background: white;
}

.table th,
.table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table th {
    background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

/* Card Styles */
.card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 24px;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3B82F6, #2563EB, #1D4ED8, #1E40AF);
    background-size: 400% 400%;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.card-body {
    padding: 24px;
}

.card-title {
    margin-bottom: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0F172A;
}

/* Row and Col for forms */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}

.col-md-3,
.col-md-4,
.col-md-2 {
    padding: 0 8px;
    margin-bottom: 8px;
}

.col-md-3 { flex: 0 0 25%; max-width: 25%; }
.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-md-2 { flex: 0 0 16.666%; max-width: 16.666%; }

/* Alert */
.alert {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
}

.alert-danger {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #c53030;
}

.alert-danger::before {
    background: #e53e3e;
}

.alert-success {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #2f855a;
}

.alert-success::before {
    background: #38a169;
}

/* Slide Toggle Styles */
.slide-toggle-container {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.slide-toggle {
    position: relative;
    width: 240px;
    height: 50px;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    border-radius: 25px;
    cursor: pointer;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.slide-toggle:hover {
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.15);
}

.slide-toggle-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
}

.toggle-option {
    flex: 1;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #4a5568;
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
    user-select: none;
}

.toggle-option.active {
    color: #ffffff;
}

.slide-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    border-radius: 22px;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.alert-info {
    background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%);
    color: #2c5282;
}

.alert-info::before {
    background: #3182ce;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header {
        height: 60px;
        left: 0;
        width: 100%;
        top: 0;
    }

    .sidebar {
        width: 250px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        margin-top: 60px;
        padding: 16px;
    }

    .footer {
        left: 0;
        width: 100%;
        height: 40px;
    }

    h1 {
        font-size: 2rem;
    }

    .col-md-3,
    .col-md-4,
    .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .row {
        margin: 0;
    }

    .table {
        font-size: 0.8rem;
    }

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

    .btn {
        width: 100%;
        margin-bottom: 8px;
        padding: 14px;
    }

    .card-body {
        padding: 16px;
    }
}

/* Category Tables in Items List */
.category-table th:nth-child(1),
.category-table td:nth-child(1) {
    width: 70%;
    text-align: left;
}

.category-table th:nth-child(2),
.category-table td:nth-child(2) {
    width: 30%;
    text-align: right;
}

/* Professional Dashboard Styles */
.text-gray-800 { color: #5a6c7d !important; }
.text-gray-300 { color: #dddfe2 !important; }
.font-weight-bold { font-weight: 700 !important; }
.font-weight-normal { font-weight: 400 !important; }
.text-uppercase { text-transform: uppercase !important; }
.text-xs { font-size: .7rem; }
.shadow { box-shadow: 0 .125rem .25rem rgba(0,0,0,.075)!important; }
.shadow-sm { box-shadow: 0 .125rem .25rem rgba(0,0,0,.075)!important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-2 { padding-top: .5rem !important; padding-bottom: .5rem !important; }
.m-0 { margin: 0 !important; }
.mt-3 { margin-top: 1rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mr-2 { margin-right: .5rem !important; }
.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.d-sm-flex { display: flex !important; }
.flex-row { flex-direction: row !important; }
.no-gutters { margin-right: 0; margin-left: 0; }
.no-gutters > .col, .no-gutters > [class*="col-"] { padding-right: 0; padding-left: 0; }
.animated--fade-in { animation: fadeIn .5s ease-in-out; }

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Border Left Cards */
.border-left-primary { border-left: .25rem solid #4e73df !important; }
.border-left-success { border-left: .25rem solid #1cc88a !important; }
.border-left-info { border-left: .25rem solid #36b9cc !important; }
.border-left-warning { border-left: .25rem solid #f6c23e !important; }

/* Card Styles */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid #e3e6f0;
    border-radius: .35rem;
}

.card-header {
    padding: .75rem 1.25rem;
    margin-bottom: 0;
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
}

.card-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

/* Dropdown */
.dropdown-toggle { white-space: nowrap; }
.dropdown-toggle::after {
    display: inline-block;
    margin-left: .255em;
    vertical-align: .255em;
    content: "";
    border-top: .3em solid;
    border-right: .3em solid transparent;
    border-bottom: 0;
    border-left: .3em solid transparent;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    min-width: 10rem;
    padding: .5rem 0;
    margin: .125rem 0 0;
    font-size: .85rem;
    color: #858796;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #e3e6f0;
    border-radius: .35rem;
    box-shadow: 0 .15rem 1.75rem 0 rgba(58,59,69,.15);
}
.dropdown-menu-right { right: 0; left: auto; }
.dropdown-header {
    display: block;
    padding: .5rem 1.5rem;
    margin-bottom: 0;
    font-size: .875rem;
    color: #6c757d;
    white-space: nowrap;
}
.dropdown-item {
    display: block;
    width: 100%;
    padding: .25rem 1.5rem;
    clear: both;
    font-weight: 400;
    color: #858796;
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}
.dropdown-item:hover, .dropdown-item:focus {
    color: #2e59d9;
    text-decoration: none;
    background-color: #f8f9fc;
}

/* Chart Areas */
.chart-area {
    position: relative;
    height: 10rem;
    width: 100%;
}
.chart-pie {
    position: relative;
    height: 15rem;
    width: 100%;
}

/* Table Enhancements */
.table-borderless th, .table-borderless td {
    border: 0;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: .35em .65em;
    font-size: .75em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .375rem;
}

.badge.bg-success { background-color: #1cc88a !important; }
.badge.bg-warning { background-color: #f6c23e !important; }
.badge.bg-primary { background-color: #4e73df !important; }

/* Button Enhancements */
.btn-block { display: block; width: 100%; }

/* Alert Enhancements */
.alert-dismissible .btn-close {
    padding: 1.25rem 1rem;
}

/* Dashboard Welcome Section */
.d-sm-flex {
    display: flex !important;
}

/* Custom column classes for 5 cards in a row */
.col-xl-2-4 {
    flex: 0 0 20%;
    max-width: 20%;
}

/* Professional Dashboard Gradients */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

@media (min-width: 576px) {
    .d-sm-flex {
        display: flex !important;
    }
}

