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

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
}

/* Navbar Styles */
.navbar {
    background-color: #1a1a1a;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 2px;
    color: #ffffff;
    text-decoration: none;
    text-transform: uppercase;
}

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

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

.nav-menu a:hover {
    color: #c5a572;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #c5a572;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #1a1a1a;
    min-width: 200px;
    list-style: none;
    padding: 0.5rem 0;
    margin-top: 0;
    padding-top: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border-top: 2px solid #c5a572;
    z-index: 1001;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.dropdown-menu a:hover {
    background-color: #2d2d2d;
    color: #c5a572;
}

.dropdown-menu a::after {
    display: none;
}

/* Main Content Area */
.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    background-color: #ffffff;
    min-height: calc(100vh - 80px);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
    padding: 4rem 2rem;
    text-align: center;
    margin: -2rem -2rem 2rem -2rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: 3px;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 1px;
    color: #c5a572;
}

/* Section Styles */
.section {
    padding: 3rem 0;
}

.section h2 {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    text-transform: uppercase;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: #1a1a1a;
    color: #ffffff;
    text-decoration: none;
    border: 2px solid #1a1a1a;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: transparent;
    color: #1a1a1a;
}

.btn-secondary {
    background-color: #c5a572;
    border-color: #c5a572;
}

.btn-secondary:hover {
    background-color: transparent;
    color: #c5a572;
}

/* Footer */
footer {
    background-color: #1a1a1a;
    color: #ffffff;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

footer p {
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Data Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-table thead {
    background-color: #1a1a1a;
    color: #ffffff;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.data-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #f8f8f8;
}

.data-table td {
    padding: 1rem;
    color: #333;
}

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

/* Error Message */
.error-message {
    background-color: #ffe6e6;
    border-left: 4px solid #cc0000;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.error-message p {
    color: #cc0000;
    margin: 0;
}

/* Flash Messages */
.flash-message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.flash-message.success {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

.flash-message.error {
    background-color: #ffe6e6;
    border-left: 4px solid #cc0000;
    color: #cc0000;
}

.flash-message p {
    margin: 0;
}

/* Clickable Rows */
.contact-row {
    cursor: pointer;
}

.contact-row:hover {
    background-color: #f0f0f0 !important;
}

.contact-details {
    background-color: #fafafa;
}

.vendor-row {
    cursor: pointer;
}

.vendor-row:hover {
    background-color: #f0f0f0 !important;
}

.vendor-details {
    background-color: #fafafa;
}

/* Edit Form Styles */
.edit-form {
    padding: 2rem;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    margin: 0.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group select.status-select {
    width: 50%;
}

.form-group .timestamp-display {
    color: #666;
    font-style: italic;
    font-size: 0.9rem;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #c5a572;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Tags Container */
.tags-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 40px;
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fafafa;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background-color: #c5a572;
    color: #ffffff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.tag-remove {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.tag-remove:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

.add-tag-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.tag-select {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.9rem;
    max-width: 300px;
}

.btn-add-tag {
    padding: 0.6rem 1.5rem;
    background-color: #1a1a1a;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease;
}

.btn-add-tag:hover {
    background-color: #333;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.form-actions .btn {
    margin: 0;
}

/* ContactsInfo Table */
.contactsinfo-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    font-size: 0.9rem;
    table-layout: fixed;
}

.contactsinfo-table thead {
    background-color: #f5f5f5;
}

.contactsinfo-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e0e0;
}

.contactsinfo-table th:first-child {
    width: 60%;
}

.contactsinfo-table th:last-child {
    width: 40%;
}

.contactsinfo-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.3s ease;
}

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

.contactsinfo-table tbody tr.inactive-row {
    background-color: #f5f5f5;
}

.contactsinfo-table td {
    padding: 0.75rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contactsinfo-table td:last-child {
    white-space: normal;
}

.status-toggle-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
    min-width: 100px;
}

.status-btn-active {
    background-color: #28a745;
    color: #ffffff;
}

.status-btn-active:hover {
    background-color: #218838;
}

.status-btn-inactive {
    background-color: #dc3545;
    color: #ffffff;
}

.status-btn-inactive:hover {
    background-color: #c82333;
}

.status-toggle-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    background-color: #1a1a1a;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-small:hover {
    background-color: #333;
}

.no-records {
    color: #999;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.loading {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Transactions Table */
.transactions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    font-size: 0.9rem;
}

.transactions-table thead {
    background-color: #f5f5f5;
}

.transactions-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e0e0;
}

.transactions-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

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

.transactions-table td {
    padding: 0.75rem;
    color: #333;
}

.transactions-table td:nth-child(3),
.transactions-table td:nth-child(4) {
    white-space: nowrap;
}

/* Transactions Page Styles */
.year-section {
    margin-bottom: 2rem;
}

.year-header {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 1rem 1.5rem;
    margin: 0;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 1px;
    transition: background-color 0.3s ease;
    user-select: none;
}

.year-header:hover {
    background-color: #333;
}

.year-toggle {
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.year-content {
    border: 1px solid #e0e0e0;
    border-top: none;
    padding: 1rem;
    background-color: #ffffff;
}

.transactions-page-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.transactions-page-table thead {
    background-color: #f5f5f5;
}

.transactions-page-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e0e0e0;
}

.transactions-page-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

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

.transactions-page-table tbody tr:hover {
    background-color: #f8f8f8;
}

.transactions-page-table td {
    padding: 0.75rem;
    color: #333;
}

.transactions-page-table td:nth-child(2),
.transactions-page-table td:nth-child(3) {
    white-space: nowrap;
}

.txn-row-clickable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.txn-row-clickable:hover {
    background-color: #f8f8f8 !important;
}

.txn-edit-form {
    padding: 2rem;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    margin: 0.5rem;
}

.txn-edit-form .form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.txn-edit-form .form-group {
    flex: 1;
    min-width: 0;
}

.txn-edit-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.txn-edit-form input[type="text"],
.txn-edit-form input[type="number"],
.txn-edit-form input[type="date"],
.txn-edit-form select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.txn-edit-form input[type="text"]:focus,
.txn-edit-form input[type="number"]:focus,
.txn-edit-form input[type="date"]:focus,
.txn-edit-form select:focus {
    outline: none;
    border-color: #c5a572;
}
