* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --dark-color: #0f172a;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --card-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #3b82f6;
    background-attachment: fixed;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    margin: 0 auto 20px;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-header h1 {
    color: #3b82f6;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header h2 {
    color: #475569;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 5px;
}

.login-header p {
    color: #64748b;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-info {
    text-align: center;
    margin-top: 20px;
    color: var(--secondary-color);
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
}

.sidebar-header {
    padding: 28px 24px;
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
    margin: 0 auto 15px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-header h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    background: #f8fafc;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header p {
    font-size: 14px;
    color: #cbd5e1;
    font-weight: 500;
}

.sidebar-header small {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li {
    margin: 2px 0;
}

.sidebar-menu li.menu-section {
    padding: 15px 20px 5px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    margin: 4px 12px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
}

.sidebar-menu a:hover {
    background: rgba(59, 130, 246, 0.15);
    color: white;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.sidebar-menu a i {
    margin-right: 12px;
    width: 20px;
    font-size: 16px;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    background: #f8fafc;
    min-height: 100vh;
}

.topbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 20px 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.breadcrumb {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.5px;
}

.user-info {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.content-area {
    padding: 32px;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--card-shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    padding: 24px;
    border-bottom: 1px solid #f1f5f9;
    background: rgba(59, 130, 246, 0.05);
}

.card-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-info:hover {
    background: #0891b2;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

/* Action Buttons - Compact & Beautiful */
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: white !important;
    flex-shrink: 0;
}

.btn-action i {
    margin: 0;
    color: white !important;
}

.btn-view {
    background: #3b82f6;
    color: white !important;
    text-decoration: none !important;
}

.btn-view:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    color: white !important;
    text-decoration: none !important;
}

.btn-edit {
    background: #10b981;
    color: white !important;
    text-decoration: none !important;
}

.btn-edit:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
    color: white !important;
    text-decoration: none !important;
}

.btn-delete {
    background: #ef4444;
    color: white !important;
    text-decoration: none !important;
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
    color: white !important;
    text-decoration: none !important;
}

.btn-print {
    background: #8b5cf6;
    color: white !important;
    text-decoration: none !important;
}

.btn-print:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
    color: white !important;
    text-decoration: none !important;
}

.btn-award {
    background: #f59e0b;
    color: white !important;
    text-decoration: none !important;
}

.btn-award:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
    color: white !important;
    text-decoration: none !important;
}

.btn-block {
    width: 100%;
}

.btn i {
    margin-right: 5px;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
}

.required {
    color: #ef4444;
    font-weight: 600;
    margin-left: 2px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.item-form {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 1fr 50px;
    gap: 10px;
    margin-bottom: 10px;
}

.item-row {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.item-row:last-child {
    border-bottom: none;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-card:hover {
    box-shadow: var(--card-shadow-lg);
    transform: translateY(-4px);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
    z-index: 1;
}

.stat-details {
    flex: 1;
}

.stat-details h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #0f172a;
    position: relative;
    z-index: 1;
}

.stat-details p {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead {
    background: #f8fafc;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle !important;
    line-height: 1.5;
}

.data-table th {
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    color: #475569;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.data-table td.action-buttons {
    white-space: nowrap;
    text-align: center;
}

.data-table a {
    color: var(--primary-color);
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
}

.dashboard-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 18px;
}

.panel-body {
    padding: 20px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.page-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.5px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.badge-active {
    background: #e8f5e9;
    color: #4CAF50;
}

.badge-inactive {
    background: #ffebee;
    color: #f44336;
}

.badge-pending {
    background: #fff3e0;
    color: #ff9800;
}

.badge-draft {
    background: #e0e0e0;
    color: #757575;
}

.badge-sent {
    background: #e3f2fd;
    color: #2196F3;
}

.badge-completed {
    background: #e8f5e9;
    color: #4CAF50;
}

.badge-partial {
    background: #fff3e0;
    color: #ff9800;
}

.badge-awarded {
    background: #e8f5e9;
    color: #4CAF50;
}

.badge-rejected {
    background: #ffebee;
    color: #f44336;
}

.badge-evaluated {
    background: #e3f2fd;
    color: #2196F3;
}

.badge-overdue {
    background: #ffebee;
    color: #f44336;
}

.badge-paid {
    background: #e8f5e9;
    color: #4CAF50;
}

.badge-in {
    background: #e8f5e9;
    color: #4CAF50;
}

.badge-out {
    background: #ffebee;
    color: #f44336;
}

.badge-adjustment {
    background: #fff3e0;
    color: #ff9800;
}

.badge-info {
    background: #e0f7fa;
    color: #00bcd4;
}

.badge-warning {
    background: #fff3e0;
    color: #ff9800;
}

.badge-partial_delivery {
    background: #fff3e0;
    color: #ff9800;
}

.badge-acknowledged {
    background: #e3f2fd;
    color: #2196F3;
}

.badge-cancelled {
    background: #e0e0e0;
    color: #757575;
}

.badge-partial_payment {
    background: #fff3e0;
    color: #ff9800;
}

.badge-new {
    background: #ffebee;
    color: #f44336;
}

.badge-rfq_created {
    background: #e3f2fd;
    color: #2196F3;
}

.badge-quoted {
    background: #e0f7fa;
    color: #00bcd4;
}

.badge-won {
    background: #e8f5e9;
    color: #4CAF50;
}

.badge-lost {
    background: #e0e0e0;
    color: #757575;
}

.badge-verified {
    background: #e8f5e9;
    color: #4CAF50;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.alert-success {
    background: #e8f5e9;
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.alert-error {
    background: #ffebee;
    color: #f44336;
    border: 1px solid #f44336;
}

.alert-warning {
    background: #fff3e0;
    color: #ff9800;
    border: 1px solid #ff9800;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    overflow: auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 32px;
    width: 90%;
    max-width: 800px;
    border-radius: 24px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 24px;
    top: 24px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s ease;
}

.close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* PO Items Table */
.po-items-table {
    margin-bottom: 20px;
}

.po-item-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: flex-end;
}

.po-item-form .form-group {
    margin-bottom: 0;
}

/* PO Totals */
.po-totals {
    margin-top: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 5px;
}

.total-row {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 16px;
}

.total-row label {
    font-weight: 600;
    min-width: 150px;
    text-align: right;
}

.total-final {
    border-top: 2px solid var(--dark-color);
    padding-top: 10px;
    font-size: 18px;
    font-weight: 700;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.4s ease;
    border-radius: 20px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-danger {
    color: var(--danger-color);
}

.low-stock {
    background: #fff3e0 !important;
}

.overdue-row {
    background: #ffebee !important;
}
