* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f9fafb; }

/* Top Navigation */
.topnav { background: #1e293b; padding: 0 16px; display: flex; align-items: center; height: 56px; position: sticky; top: 0; z-index: 100; flex-wrap: wrap; }
.topnav .logo { color: white; font-size: 16px; font-weight: 700; text-decoration: none; margin-right: 24px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.topnav .menu { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav .menu a { color: #94a3b8; padding: 8px 12px; border-radius: 6px; text-decoration: none; font-size: 13px; font-weight: 500; transition: all 0.15s; white-space: nowrap; }
.topnav .menu a:hover { color: white; background: #334155; }
.topnav .menu a.active { color: white; background: #3b82f6; }
.topnav .spacer { flex: 1; }
.topnav .user { color: #94a3b8; font-size: 12px; display: none; }

/* Common styles */
.container { padding: 16px; max-width: 1800px; margin: 0 auto; }
.toolbar { background: white; padding: 12px; border-radius: 8px; margin-bottom: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border: 1px solid #e5e7eb; }
.btn { padding: 8px 14px; border: 1px solid #d1d5db; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; background: #fff; color: #374151; transition: all 0.15s; white-space: nowrap; }
.btn:hover { background: #f9fafb; }
.btn-primary { background: #2563eb; color: white; border-color: #2563eb; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #059669; color: white; border-color: #059669; }
.btn-danger { background: #dc2626; color: white; border-color: #dc2626; }
select, input[type="text"], input[type="number"] { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; min-width: 0; }
.grid-container { background: white; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.badge { padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; display: inline-block; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-orange { background: #ffedd5; color: #9a3412; }

/* Grid sections for stocuri */
.grid-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid-section { background: white; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.grid-header { padding: 10px 12px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.grid-header h3 { font-size: 13px; font-weight: 600; color: #374151; }

/* Status messages */
.status-msg { padding: 10px 12px; font-size: 13px; border-radius: 4px; margin: 8px 12px; }
.status-msg.success { background: #d1fae5; color: #065f46; }
.status-msg.error { background: #fee2e2; color: #991b1b; }
.status-msg.hidden { display: none; }

/* Cards for admin/dashboard */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.card { background: white; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px; }
.card h3 { font-size: 15px; font-weight: 600; color: #111827; margin-bottom: 10px; }
.card p { font-size: 13px; color: #6b7280; margin-bottom: 12px; }

/* RESPONSIVE - Tablet */
@media (max-width: 1024px) {
    .topnav { height: auto; padding: 8px 12px; }
    .topnav .logo { font-size: 14px; margin-right: 16px; }
    .topnav .menu a { padding: 6px 10px; font-size: 12px; }
    .grid-row { grid-template-columns: 1fr; }
    .ag-theme-quartz { height: 280px !important; }
}

/* RESPONSIVE - Mobile */
@media (max-width: 640px) {
    .topnav { flex-direction: column; height: auto; padding: 10px; gap: 8px; }
    .topnav .logo { margin-right: 0; }
    .topnav .menu { width: 100%; justify-content: center; }
    .topnav .menu a { padding: 6px 8px; font-size: 11px; }
    .topnav .spacer { display: none; }
    
    .container { padding: 10px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar select, .toolbar input { width: 100%; }
    .toolbar .btn { width: 100%; }
    
    .grid-row { grid-template-columns: 1fr; gap: 12px; }
    .grid-header { flex-direction: column; align-items: flex-start; }
    .grid-header > div { width: 100%; display: flex; flex-direction: column; gap: 8px; }
    .grid-header input { width: 100%; }
    
    .ag-theme-quartz { height: 250px !important; }
    .ag-theme-quartz.small { height: 180px !important; }
    
    .cards { grid-template-columns: 1fr; }
    
    /* Dashboard stats */
    .stats { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .stat-card { padding: 14px !important; }
    .stat-card .value { font-size: 22px !important; }
    .stat-card .icon { font-size: 24px !important; }
    
    /* Dashboard cards */
    .hero { padding: 24px 16px !important; }
    .hero h1 { font-size: 24px !important; }
    .card-icon { height: 100px !important; font-size: 40px !important; }
    .card-body { padding: 14px !important; }
    .card-body h3 { font-size: 16px !important; }
}

/* RESPONSIVE - Very small */
@media (max-width: 400px) {
    .topnav .menu a { padding: 5px 6px; font-size: 10px; }
    .stats { grid-template-columns: 1fr !important; }
}

/* Fix floating filter placeholder */
.ag-floating-filter-input input::placeholder {
    color: transparent !important;
}
.ag-floating-filter-input input:focus::placeholder {
    color: #999 !important;
}

