/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
:root {
    --primary: #5D4037;      /* Deep brown */
    --secondary: #8D6E63;    /* Medium brown */
    --accent: #D7CCC8;       /* Light brown */
    --light: #EFEBE9;        /* Very light brown */
    --dark: #4E342E;         /* Dark brown */
    --success: #7CB342;      /* Olive green */
    --warning: #FFD700;      /* Bright Gold */
    --danger: #E64A19;       /* Deep orange */
    --text: #3E2723;         /* Dark brown text */
    --text-light: #5D4037;   /* Medium brown text */
    --gold-light: #FFECB3;   /* Light gold */
    --gold-dark: #FFA000;    /* Amber gold */
}

body {
    background-color: #FAF9F7;
    color: var(--text);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
     background: linear-gradient(135deg, #FFD700, #8B4513, #5D4037);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('images/brown-texture.jpg') center/cover;
    opacity: 0.1;
}

.login-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(93, 64, 55, 0.2);
    width: 90%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    border: 1px solid var(--accent);
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo img {
    max-width: 160px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(93, 64, 55, 0.3));
}

.logo h1 {
    color: var(--primary);
    font-size: 1.6rem;
    margin-top: 0.8rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 500;
    color: var(--text-light);
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--accent);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--light);
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary);
    background: white;
    box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.1);
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(93, 64, 55, 0.3);
}

.btn:hover {
    background: linear-gradient(135deg, var(--dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(93, 64, 55, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #FF5722);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #BF360C, var(--danger));
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #8BC34A);
}

.btn-success:hover {
    background: linear-gradient(135deg, #558B2F, var(--success));
}

/* Dashboard Styles */
.header {
     background: linear-gradient(135deg, #FFD700, #8B4513, #5D4037);
    box-shadow: 0 4px 20px rgba(93, 64, 55, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info span {
    font-weight: 500;
    color: white;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.main-content {
    padding: 2.5rem 0;
    background: var(--light);
    min-height: calc(100vh - 80px);
}

.section-title {
    margin-bottom: 2rem;
    color: var(--primary);
    font-size: 1.7rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.add-client-btn {
    background: linear-gradient(135deg, var(--success), #8BC34A);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(124, 179, 66, 0.3);
}

.add-client-btn:hover {
    background: linear-gradient(135deg, #558B2F, var(--success));
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 179, 66, 0.4);
}

/* Client Form Styles */
.client-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(93, 64, 55, 0.1);
    margin-bottom: 2.5rem;
    display: none;
    border: 1px solid var(--accent);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-field {
    flex: 1 1 250px;
}

.form-field label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 500;
    color: var(--text-light);
}

.form-field input {
    width: 100%;
    padding: 0.9rem;
    border: 2px solid var(--accent);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--light);
    transition: all 0.3s ease;
}

.form-field input:focus {
    outline: none;
    border-color: var(--secondary);
    background: white;
    box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Client Table Styles */
.clients-table {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(93, 64, 55, 0.1);
    overflow: hidden;
    overflow-x: auto;
    border: 1px solid var(--accent);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1.2rem;
    text-align: left;
    border-bottom: 1px solid var(--accent);
}

th {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

tr:hover {
    background: var(--light);
}

.action-buttons {
    display: flex;
    gap: 0.6rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edit-btn {
    background: linear-gradient(135deg, var(--warning), #FFB300);
    color: white;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #FF8F00, var(--warning));
    transform: translateY(-1px);
}

.delete-btn {
    background: linear-gradient(135deg, var(--danger), #FF5722);
    color: white;
}

.delete-btn:hover {
    background: linear-gradient(135deg, #BF360C, var(--danger));
    transform: translateY(-1px);
}

.receive-btn {
    background: linear-gradient(135deg, var(--success), #8BC34A);
    color: white;
}

.receive-btn:hover {
    background: linear-gradient(135deg, #558B2F, var(--success));
    transform: translateY(-1px);
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(93, 64, 55, 0.1);
    text-align: center;
    border: 1px solid var(--accent);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0.8rem 0;
}

.stat-label {
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
}

.total-amount {
    color: var(--primary);
}

.received-amount {
    color: var(--success);
}

.remaining-amount {
    color: var(--danger);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(78, 52, 46, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent);
}

.modal-title {
    font-size: 1.4rem;
    color: var(--primary);
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--danger);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1.2rem;
    }
    
    .section-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.2rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 1.2rem;
    }
    
    .form-field {
        flex: 1 1 100%;
    }
    
    .clients-table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 1rem 0.7rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .login-form {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .login-form {
        padding: 1.8rem;
    }
    
    .client-form, .modal-content {
        padding: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
}