:root {
    --primary-color: #7E57C2;
    --primary-light: #B085F5;
    --primary-dark: #4D2C91;
    --text-dark: #333;
    --text-light: #666;
    --bg-color: #F8F9FA;
    --white: #FFFFFF;
    --border-color: #E0E0E0;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
}

/* Typography & Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 30px;
}

/* Screen specific tools (hidden in print) */
.controls-panel {
    width: 350px;
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    height: fit-content;
}

.controls-panel h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9em;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    font-family: inherit;
    font-size: 1em;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #e0e0e0;
    color: var(--text-dark);
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.w-100 { width: 100%; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* Login Page specific */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-container {
    width: 100%;
    max-width: 400px;
}
.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
}
.login-box h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
}
.error-msg {
    color: #d32f2f;
    background: #ffebee;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 0.9em;
}

/* Invoice Preview styling */
.invoice-preview {
    flex: 1;
    background: var(--white);
    padding: 50px 50px 80px 50px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* Simulated Watermark */
.invoice-preview::before {
    content: '';
    position: absolute;
    top: 30%;
    left: 20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(126,87,194,0.1) 0%, rgba(255,255,255,0) 70%);
    z-index: 0;
    pointer-events: none;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 50px;
    position: relative;
    z-index: 1;
}

.logo-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.logo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
}

.header-right {
    text-align: right;
}
.header-title {
    font-size: 3em;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.invoice-meta {
    font-size: 0.9em;
    color: var(--text-light);
}

.invoice-to {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.invoice-to-left strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 5px;
    margin-top: 10px;
}
.invoice-to-right {
    text-align: right;
    font-size: 0.9em;
    color: var(--text-light);
    line-height: 1.5;
}

table.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}
table.invoice-table th {
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 15px;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.9em;
}
table.invoice-table th:last-child,
table.invoice-table td:last-child {
    text-align: right;
}
table.invoice-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}
table.invoice-table tr:nth-child(even) td {
    background-color: #fcfcfc;
}

.invoice-summary {
    display: flex;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
}
.summary-box {
    width: 300px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 0.95em;
    color: var(--text-light);
}
.summary-row.total {
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 15px;
    font-weight: bold;
    font-size: 1.1em;
    margin-top: 10px;
    border-radius: 4px;
}
.summary-row strong {
    color: var(--text-dark);
}

.invoice-footer {
    margin-top: 80px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    z-index: 1;
}

.payment-method {
    font-size: 0.9em;
}
.payment-method strong {
    display: block;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-size: 1.1em;
}

.stamp {
    display: inline-block;
    padding: 5px 15px;
    border: 3px solid;
    border-radius: 5px;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    transform: rotate(-15deg);
    opacity: 0.8;
}
.stamp.unpaid {
    color: #D32F2F;
    border-color: #D32F2F;
}
.stamp.paid {
    color: #388E3C;
    border-color: #388E3C;
}

.footer-thanks {
    font-style: italic;
    font-size: 1.2em;
    color: var(--text-light);
    margin-top: 20px;
}

.footer-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.footer-seal {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px dashed var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 12px;
    text-align: center;
    margin-bottom: 10px;
}

.top-bar {
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
}
.top-bar a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

/* Form Actions */
.row-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Service Builder Row */
.service-builder-row {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* Editable specific overrides */
.editable-field {
    border-bottom: 1px dashed var(--primary-light);
    min-width: 50px;
    display: inline-block;
}

/* PRINT STYLES */
@media print {
    body {
        background: var(--white);
        margin: 0;
        padding: 0;
    }
    .top-bar, .controls-panel {
        display: none !important;
    }
    .container {
        padding: 0;
        margin: 0;
        max-width: 100%;
        display: block;
    }
    .invoice-preview {
        box-shadow: none;
        padding: 20px;
        margin: 0;
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    @page {
        size: A4;
        margin: 0;
    }
}
