/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background-color: #e8f5f0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, #56c7b5 0%, #43a5c8 50%, #6ecfb8 100%);
    color: white;
    box-shadow: 0 2px 15px rgba(67, 165, 200, 0.3);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-menu a:hover {
    background-color: rgba(255,255,255,0.25);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #b2f0e6 0%, #a8dce8 30%, #c5f5e0 60%, #90d5c4 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(67, 165, 200, 0.15);
    width: 100%;
    max-width: 420px;
    border-top: 4px solid #56c7b5;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: #2d6e6e;
}

.login-form h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: #6b8a8a;
    font-weight: normal;
}

.login-info {
    margin-top: 2rem;
    padding: 1rem;
    background: #eef9f5;
    border-radius: 5px;
    font-size: 0.9rem;
}

.login-info p {
    margin: 0.25rem 0;
}

/* Logo Styles */
.logo-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-img {
    max-width: 30%;
    height: auto;
    margin: 0 auto 10px;
    display: block;
}

.logo-subtitle {
    font-size: 0.8rem;
    color: #6b8a8a;
    letter-spacing: 1px;
    margin-top: 4px;
    text-transform: uppercase;
    font-weight: 500;
}

/* Header logo */
.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo-img {
    height: auto;
    max-height: 25px;
    width: auto;
}


/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #56c7b5;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn:hover {
    background: #43b0a0;
    transform: translateY(-2px);
}

.btn-primary {
    background: #56c7b5;
}

.btn-primary:hover {
    background: #43b0a0;
}

.btn-success {
    background: #48bb78;
}

.btn-info {
    background: #43a5c8;
}

.btn-warning {
    background: #ecc94b;
    color: #333;
}

.btn-secondary {
    background: #8daab0;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-danger,
.btn[style*="dc3545"] {
    background: #e57373;
}

/* Forms */
.form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(67, 165, 200, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2d6e6e;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #b2dfdb;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: #fafffe;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #56c7b5;
    box-shadow: 0 0 0 3px rgba(86, 199, 181, 0.15);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Search Form */
.search-form {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(67, 165, 200, 0.1);
}

.search-form .form-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-form select {
    min-width: 200px;
    padding: 0.75rem;
    border: 1px solid #b2dfdb;
    border-radius: 5px;
}

.search-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #b2dfdb;
    border-radius: 5px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(67, 165, 200, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e0f2f1;
}

.data-table th {
    background: #e8f5f0;
    font-weight: 600;
    color: #2d6e6e;
}

.data-table tr:hover {
    background: #f0faf7;
}

.text-right {
    text-align: right;
}

/* BY/TO Amount Columns */
.amount-by {
    text-align: right;
    color: #38a169;
    font-weight: 600;
}

.amount-to {
    text-align: right;
    color: #e57373;
    font-weight: 600;
}

.amount-by:before {
    content: "Rs. ";
}

.amount-to:before {
    content: "Rs. ";
}

/* Status and Badges */
.status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status.active {
    background: #c6f6d5;
    color: #276749;
}

.status.inactive {
    background: #fed7d7;
    color: #9b2c2c;
}

.status.completed {
    background: #c6f6d5;
    color: #276749;
}

.status.draft {
    background: #fefcbf;
    color: #975a16;
}

.status.pending {
    background: #fefcbf;
    color: #b8860b;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-warning {
    background: #fefcbf;
    color: #975a16;
}

/* Dashboard */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    color: #2d6e6e;
    font-size: 2rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(67, 165, 200, 0.1);
    text-align: center;
    transition: transform 0.3s;
    border-top: 3px solid #b2f0e6;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(67, 165, 200, 0.15);
}

.stat-card.alert {
    border-left: 5px solid #e57373;
}

.stat-card h3 {
    color: #6b8a8a;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: #43a5c8;
    margin-bottom: 0.5rem;
}

.stat-amount {
    font-size: 1.2rem;
    color: #38a169;
    margin-bottom: 1rem;
}

.stat-card a {
    color: #56c7b5;
    text-decoration: none;
    font-weight: 500;
}

.quick-actions {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(67, 165, 200, 0.1);
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Recent Transactions Section */
.recent-transactions {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(67, 165, 200, 0.1);
    margin-top: 2rem;
}

.recent-transactions .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.recent-transactions .section-header h2 {
    color: #2d6e6e;
    font-size: 1.5rem;
}

.transaction-filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.transaction-filter-buttons .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    background: #eef9f5;
    color: #2d6e6e;
    border: 1px solid #b2dfdb;
}

.transaction-filter-buttons .btn:hover {
    background: #d5f0ea;
}

.transaction-filter-buttons .btn.active {
    background: #56c7b5;
    color: white;
    border-color: #56c7b5;
}

.transaction-action-buttons {
    display: flex;
    gap: 0.75rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.transaction-action-buttons .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Transaction List Header */
.transaction-list-header {
    background: linear-gradient(135deg, #56c7b5, #43a5c8);
    color: white;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
}

.transaction-list-header .header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.transaction-list-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.add-button-inline .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Transaction Cards */
.transaction-card {
    background: #fafffe;
    border: 1px solid #b2dfdb;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.transaction-header {
    background: #e8f5f0;
    color: #2d6e6e;
    padding: 0.75rem 1.5rem;
    border-bottom: 2px solid #b2dfdb;
}

.transaction-header h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: #43a5c8;
}

.transaction-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #6b8a8a;
}

.transaction-meta span {
    display: flex;
    gap: 0.25rem;
}

.transaction-card .table-container {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.transaction-card .data-table td.amount,
.recent-transactions .data-table td.amount {
    text-align: right;
    font-weight: 600;
    color: #43a5c8;
}

.transaction-card .data-table .total-row,
.recent-transactions .data-table .total-row {
    background: #eef9f5;
    font-weight: bold;
    border-top: 2px solid #b2dfdb;
}

.recent-transactions .data-table td.doc-number {
    font-weight: 600;
    color: #43a5c8;
    vertical-align: middle;
    border-right: 2px solid #b2dfdb;
}

.recent-transactions .data-table td[rowspan] {
    vertical-align: middle;
    background: #eef9f5;
}

.recent-transactions .data-table .action-cell {
    text-align: center;
    white-space: nowrap;
}

.recent-transactions .data-table .action-cell .btn {
    display: block;
    margin: 0.25rem auto;
    min-width: 60px;
}

.no-data, .no-selection {
    text-align: center;
    padding: 3rem 2rem;
    color: #6b8a8a;
}

.no-data p, .no-selection p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Item Rows for Sales/GRN */
.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #eef9f5;
    border-radius: 5px;
}

.item-row select,
.item-row input {
    padding: 0.5rem;
    border: 1px solid #b2dfdb;
    border-radius: 3px;
}

.item-row button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
}

.low-stock {
    background-color: #fff5f5;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #c6f6d5;
    color: #276749;
    border: 1px solid #9ae6b4;
}

.alert-error {
    background: #fed7d7;
    color: #9b2c2c;
    border: 1px solid #feb2b2;
}

/* Footer */
.main-footer {
    background: #2d6e6e;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }

    .container {
        padding: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .item-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .search-form .form-row {
        flex-direction: column;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

}
