:root {
    --primary: #0A5F7A;
    --primary-dark: #084C62;
    --accent: #00A86B;
    --accent-light: #E8F5F0;
    --danger: #E31E24;
    --text: #1a1a1a;
    --text-light: #666;
    --bg: #f4f7f9;
    --white: #ffffff;
    --border: #e0e6ed;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0A5F7A 0%, #084C62 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.logo-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #00D68F;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.login-header p {
    font-size: 14px;
    opacity: 0.9;
}

.login-form {
    padding: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover {
    background: #008F5A;
}

.error-message {
    background: #ffe6e6;
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

.demo-info {
    background: var(--accent-light);
    padding: 15px 30px 25px;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}

.demo-info code {
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    color: var(--primary);
}

/* App Layout */
.app-header {
    background: var(--primary);
    color: white;
    padding: 0 30px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 700;
}

.header-left .subtitle {
    font-size: 12px;
    opacity: 0.8;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    text-align: right;
    font-size: 14px;
}

.user-info .name {
    font-weight: 600;
}

.btn-logout {
    background: rgba(255,255,255,0.15);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.25);
}

/* Sidebar */
.app-container {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--border);
    padding: 20px 0;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 25px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
    background: var(--accent-light);
    color: var(--primary);
    border-left: 4px solid var(--accent);
}

.sidebar-menu li a i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h2 {
    font-size: 24px;
    color: var(--primary);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #008F5A;
}

.btn-secondary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent);
}

.stat-card h3 {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-card p {
    color: var(--text-light);
    font-size: 14px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

th {
    background: #f8fafb;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

tr:hover {
    background: #fafcfd;
}

.search-bar {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.search-bar input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Forms */
.form-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row.full {
    grid-template-columns: 1fr;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

input, select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

.item-block {
    background: #f8fafb;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.item-block h4 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 16px;
}

.remove-item {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--danger);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.totals-section {
    background: #f0f9f6;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
}

.totals-row.grand {
    font-weight: 700;
    font-size: 18px;
    color: var(--primary);
    border-top: 2px solid var(--accent);
    margin-top: 10px;
    padding-top: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .main-content {
        padding: 20px;
    }
}