@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #6366f1;
    /* Indigo 500 */
    --primary-hover: #4f46e5;
    /* Indigo 600 */
    --secondary-color: #ec4899;
    /* Pink 500 */
    --background-color: #f3f4f6;
    /* Gray 100 */
    --sidebar-bg: #1e293b;
    /* Slate 800 */
    --card-bg: #ffffff;
    --text-color: #1f2937;
    /* Gray 800 */
    --text-muted: #6b7280;
    /* Gray 500 */
    --border-color: #e5e7eb;
    /* Gray 200 */
    --sidebar-width: 260px;
    --header-height: 70px;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 25px;
    font-size: 1.25rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.5px;
}

.sidebar-header i {
    margin-right: 10px;
    color: var(--primary-color);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 10px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 5px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-nav a i {
    width: 24px;
    margin-right: 10px;
    text-align: center;
}

.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    transform: translateX(5px);
}

.sidebar-nav a.active {
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
}

header {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 40px;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.user-info span {
    font-weight: 600;
    color: var(--primary-color);
    background: #e0e7ff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.content {
    padding: 40px;
    overflow-y: auto;
    flex: 1;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--card-shadow);
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-color);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Inter', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background-color: #fff;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px rgba(99, 102, 241, 0.3);
}

.btn-danger {
    background-color: #ef4444;
    color: #fff;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-success {
    background-color: #10b981;
    color: #fff;
}

.btn-success:hover {
    background-color: #059669;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 10px;
}

table th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    vertical-align: middle;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover td {
    background-color: #f8fafc;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
    transform: skewX(-20deg);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 5px;
    font-weight: 700;
    letter-spacing: -1px;
}

.stat-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* POS Specific */
.pos-container {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 30px;
    height: calc(100vh - var(--header-height) - 80px);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    overflow-y: auto;
    padding-right: 10px;
    padding-bottom: 20px;
}

.product-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.product-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.product-card h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--text-color);
}

.cart-section {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border-color);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
}

.cart-footer {
    padding: 25px;
    border-top: 1px solid var(--border-color);
    background-color: #fff;
    border-radius: 0 0 var(--radius) var(--radius);
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-color);
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}