:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Auth Pages Styling */
.auth-page {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-container {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-brand h1 {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 800;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #0f172a;
    color: white;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    padding: 1rem;
    margin-bottom: 2rem;
}

.sidebar-brand h2 {
    font-weight: 800;
    font-size: 1.75rem;
    color: #fff;
    letter-spacing: -0.025em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-nav a {
    color: #94a3b8;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-nav a i {
    font-size: 1.125rem;
}

.sidebar-nav a:hover {
    background: #1e293b;
    color: white;
}

.sidebar-nav a.active {
    background: var(--primary);
    color: white;
}

.sidebar-footer {
    margin-top: auto;
}

.logout-link {
    color: #ef4444 !important;
}

/* Main Content Area */
.main-content {
    flex: 1;
    background-color: var(--bg-main);
    display: flex;
    flex-direction: column;
}

.top-bar {
    height: 64px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 2rem;
}

.content-body {
    padding: 2rem;
}

/* Professional Components */
.card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #334155;
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    border: 1px solid #cbd5e1;
    background-color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: white;
    border-color: #cbd5e1;
    color: #334155;
}

.btn-secondary:hover {
    background-color: #f8fafc;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
}

/* Table */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tr:hover td {
    background-color: #f8fafc;
}

/* Badges / Status */
.status-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.status-paid {
    background: #dcfce7;
    color: #166534;
}

.status-unpaid {
    background: #fef3c7;
    color: #92400e;
}

.status-overdue {
    background: #fee2e2;
    color: #991b1b;
}

.status-draft {
    background: #f1f5f9;
    color: #475569;
}

.status-sent {
    background: #dbeafe;
    color: #1e40af;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Indian Rupee Support */
.currency-in::before {
    content: "₹ ";
    font-family: Arial, sans-serif;
}

/* Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-info .label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-info .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

/* Tally & Print Styles */
@media print {

    .no-print,
    .sidebar,
    .top-bar {
        display: none !important;
    }

    .main-content {
        background: white !important;
        display: block !important;
    }

    .content-body {
        padding: 0 !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
}

.tally-container {
    background: white;
    padding: 0;
    color: black;
    font-family: "Times New Roman", Times, serif;
}

.tally-table {
    width: 100%;
    border: 1.5px solid black;
    border-collapse: collapse;
}

.tally-table th,
.tally-table td {
    border: 1.5px solid black;
    padding: 5px 8px;
    font-size: 11pt;
}

.text-right {
    text-align: right !important;
}

.text-center {
    text-align: center !important;
}

.actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--secondary);
    transition: all 0.2s;
    text-decoration: none;
}

.action-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.action-btn.delete:hover {
    background: #fee2e2;
    color: var(--danger);
}

.font-bold {
    font-weight: bold;
}