/* General style */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', Arial, sans-serif;
}

:root {
    --primary-color: #1a1a2e;
    --secondary-color: #0f4c75;
    --accent-color: #3282b8;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    --shadow-lg: 0 0.5rem 1rem rgba(0,0,0,0.15);
}

body {
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 16px;
}

/* UNIFIED NAVIGATION SYSTEM */
.navbar {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    margin-bottom: 2rem;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    list-style: none;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    display: block;
    white-space: nowrap;
    font-size: 0.9rem;
}

.nav-link:hover {
    background-color: var(--light-bg);
    color: var(--accent-color);
}

.nav-link.active {
    background-color: var(--accent-color);
    color: var(--white);
}

.nav-link.btn-logout {
    background-color: var(--danger-color);
    color: var(--white);
    margin-left: 0.5rem;
}

.nav-link.btn-logout:hover {
    background-color: #c82333;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.3s ease;
}

.nav-toggle:hover {
    background-color: var(--light-bg);
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Mobile Navigation */
@media (max-width: 1024px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 77px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: left;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.1);
        padding: 1rem 0;
        gap: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        padding: 1rem 2rem;
        border-radius: 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .hamburger-line:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .nav-toggle.active .hamburger-line:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

/* Logo Container */
.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.company-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Containers */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.login-container, .register-container {
    max-width: 450px;
    margin: 3rem auto;
    padding: 2.5rem;
    background-color: var(--white);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 480px) {
    .login-container, .register-container {
        margin: 1rem auto;
        padding: 1.5rem;
    }
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Styles */
.dashboard-header {
    background-color: var(--white);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
    }
    
    .header-left, .header-right {
        width: 100%;
        justify-content: center;
    }
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--white);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(50, 130, 184, 0.25);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.5;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: var(--light-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--white);
    border-color: var(--accent-color);
}

.btn-logout {
    background-color: var(--danger-color);
    color: var(--white);
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
}

.btn-logout:hover {
    background-color: #c82333;
}

.btn-action {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-action:hover {
    background-color: var(--primary-color);
}

/* Cards */
.card {
    background-color: var(--white);
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.card-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Balance Section */
.balance-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 3rem;
    border-radius: 0.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.balance-amount {
    font-size: 3rem;
    font-weight: 700;
    margin: 1rem 0;
}

.balance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.balance-detail {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 0.375rem;
}

@media (max-width: 768px) {
    .balance-section {
        padding: 2rem 1rem;
    }
    
    .balance-amount {
        font-size: 2rem;
    }
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.action-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.action-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.action-card .btn-action {
    width: 100%;
    margin-top: 1rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin: -1rem;
    padding: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--white);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: var(--light-bg);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.table tbody tr:hover {
    background-color: var(--light-bg);
}

/* Status indicators */
.status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-completed { 
    background-color: #d4edda; 
    color: #155724; 
}

.status-pending { 
    background-color: #fff3cd; 
    color: #856404; 
}

.status-failed { 
    background-color: #f8d7da; 
    color: #721c24; 
}

/* Messages */
.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer */
.footer {
    margin-top: auto;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 3rem 0 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-logo-section {
    text-align: center;
    margin-bottom: 2rem;
}

.footer-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.footer-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    align-items: start;
}

.footer-section h4 {
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
    text-decoration: none;
    display: block;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .footer-sections {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .footer-sections {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Responsive utilities */
@media (max-width: 1024px) {
    .dashboard-container {
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    .hide-mobile {
        display: none;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .card {
        padding: 1.5rem;
    }
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }