:root {
    --primary-color: #007CF0;
    --accent-color: #00DFD8;
    --primary-hover: #005bb5;
    --bg-color: #ffffff;
    --card-bg: #f8f8f8;
    --text-main: #1a1a1a;
    --text-muted: #666666;
    --border-color: #eeeeee;
    --success: #00DFD8;
    --danger: #ff4d4d;
    --gradient: linear-gradient(90deg, #007CF0 0%, #00DFD8 100%);
}

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    background: white;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

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

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@1,700&display=swap');

.logo {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.6rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.pi-logo {
    font-size: 2.3rem;
    margin-right: 0.2rem;
    position: relative;
    top: 0.15rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 0.7;
}

.card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: none;
}

h1, h2 {
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 2.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--gradient);
    color: white;
}

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

.stat-card {
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 24px;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: block;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-main);
}

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

th {
    text-align: left;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: #64748b;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    white-space: nowrap;
}

td {
    text-align: left;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    white-space: nowrap;
}

td.wrap { white-space: normal; }

.form-group { margin-bottom: 1rem; }
label { display: block; margin-bottom: 0.25rem; font-weight: 500; }
input, select { width: 100%; padding: 0.5rem; border: 1px solid var(--border-color); border-radius: 0.375rem; }

.modal { display: none; position: fixed; z-index: 100; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); }
.modal-content { background: white; margin: 5% auto; padding: 2rem; border-radius: 24px; width: 50%; max-width: 500px; }

.btn-edit { color: var(--primary-color); text-decoration: none; font-weight: 600; cursor: pointer; }

.status-badge { padding: 0.15rem 0.5rem; border-radius: 99px; font-size: 0.675rem; font-weight: 600; }
.status-open, .status-unpaid { background: #e0f2fe; color: #0369a1; }
.status-invoiced, .status-paid { background: #dcfce7; color: #15803d; }

.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-weight: 600;
}
.alert-success {
    background: #e1f5fe;
    color: #0288d1;
    border: 1px solid #b3e5fc;
}
