/* Reset i podstawowe style */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #fafafa;
    color: #2d3748;
    line-height: 1.6;
    font-size: 12.6px;
}

.container {
    width: 100%;
    min-height: 100vh;
    background-color: #fafafa;
}

/* Header */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

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

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ew-logo {
    font-size: 1.62rem;
    font-weight: 900;
    color: #333;
    background: linear-gradient(45deg, #333, #555);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    margin-right: 0.5rem;
    letter-spacing: -1px;
}

.ew-logo-img {
    height: 2.5rem;
    width: auto;
    margin-right: 0.75rem;
    vertical-align: middle;
    filter: brightness(0.8);
}

.header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffc107;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.header-subtitle {
    font-size: 0.81rem;
    color: #555;
    font-weight: 500;
    margin: 0;
    opacity: 0.8;
}

.nav {
    display: flex;
    gap: 0;
    background-color: #f7fafc;
    border-radius: 8px;
    padding: 4px;
}

.nav-link {
    color: #4a5568;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.788rem;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: #f57c00;
    background-color: #fff8e1;
}

.nav-link.active {
    background-color: #fffbea;
    color: #f57c00;
    box-shadow: 0 1px 3px rgba(255, 193, 7, 0.3);
    border-bottom: 2px solid #ffc107;
}

/* Main */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-title i {
    color: #4a5568;
    font-size: 0.696rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background-color: #4a5568;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.788rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
}

.btn:hover {
    background-color: #2d3748;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: #ffc107;
    color: #333;
}

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

.btn-danger {
    background-color: #e53e3e;
}

.btn-danger:hover {
    background-color: #c53030;
}

.btn-success {
    background-color: #38a169;
}

.btn-success:hover {
    background-color: #2f855a;
}

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

.btn-warning:hover {
    background-color: #ffb300;
}

.btn-secondary {
    background-color: #edf2f7;
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: #2d3748;
}

.btn-small {
    padding: 0.5rem 0.75rem;
    font-size: 0.763rem;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.788rem;
}

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

.table th {
    background-color: #f7fafc;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.763rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

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

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.788rem;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.form-input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

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

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 2rem;
    border-radius: 12px;
    text-align: left;
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-gray-600 { color: #718096; }
.text-gray-700 { color: #4a5568; }
.text-gray-800 { color: #2d3748; }
.text-gray-900 { color: #1a202c; }

.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f7fafc; }
.bg-gray-100 { background-color: #edf2f7; }

.border { border: 1px solid #e2e8f0; }
.border-gray-200 { border-color: #e2e8f0; }

.rounded { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.stat-value {
    font-size: 1.582rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1a202c;
}

.stat-label {
    font-size: 0.788rem;
    color: #718096;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label i {
    color: #4a5568;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    font-size: 0.788rem;
}

.alert-success {
    background-color: #f0fff4;
    border-color: #38a169;
    color: #2f855a;
}

.alert-danger {
    background-color: #fed7d7;
    border-color: #e53e3e;
    color: #c53030;
}

.alert-info {
    background-color: #ebf8ff;
    border-color: #3182ce;
    color: #2c5282;
}

/* Footer */
.footer {
    background-color: #f7fafc;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: auto;
    font-size: 0.788rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
    }
    
    .main {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Invoice specific styles */
.invoice-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.invoice-details {
    border: 1px solid #e0e0e0;
    padding: 1rem;
    border-radius: 5px;
}

.invoice-items {
    margin: 2rem 0;
}

.invoice-total {
    text-align: right;
    font-size: 0.759rem;
    font-weight: bold;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
}

/* Collapsible Sections */
.collapsible-section {
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.collapsible-header {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.collapsible-header:hover {
    background: #edf2f7;
}

.collapsible-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collapsible-icon {
    transition: transform 0.3s ease;
    color: #718096;
}

.collapsible-icon.collapsed {
    transform: rotate(-90deg);
}

.collapsible-content {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    transition: all 0.3s ease-in-out;
}

.collapsible-content.collapsed {
    display: none;
}

.section-primary .collapsible-header {
    background: #ebf8ff;
    border-bottom: 1px solid #bee3f8;
}

.section-primary .collapsible-header h3 {
    color: #2b6cb0;
}

.section-secondary .collapsible-header {
    background: #f0fff4;
    border-bottom: 1px solid #c6f6d5;
}

.section-secondary .collapsible-header h3 {
    color: #2f855a;
}

.section-info .collapsible-header {
    background: #fffaf0;
    border-bottom: 1px solid #feebc8;
}

.section-info .collapsible-header h3 {
    color: #c05621;
}