/*
Theme Name: Rufus CRM
Theme URI: https://crm.rufus.ro
Author: Rufus Suprastructuri
Description: CRM intern pentru gestiunea comenzilor de carosare
Version: 1.0
*/

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

:root {
    --orange: #E8651A;
    --navy: #0a1628;
    --bg: #f4f5f7;
    --white: #ffffff;
    --border: #e2e4e9;
    --text: #1a1a2e;
    --muted: #6b7280;
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

/* LOGIN */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
}
.login-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
}
.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}
.login-logo img { height: 50px; }
.login-logo h1 { font-size: 20px; font-weight: 600; color: var(--navy); margin-top: 8px; }
.login-logo p { font-size: 13px; color: var(--muted); }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: #fafafa;
    color: var(--text);
    transition: border-color 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--orange); background: var(--white); }
.btn { width: 100%; padding: 11px; background: var(--orange); color: white; border: none; border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.btn:hover { background: #c9551a; }
.login-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; border-radius: var(--radius); padding: 10px 12px; font-size: 13px; margin-bottom: 1rem; }

/* LAYOUT */
.crm-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px;
    background: var(--navy);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 10;
}
.sidebar-logo {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo img { height: 36px; }
.sidebar-logo span { display: block; font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 4px; }
.sidebar-nav { flex: 1; padding: 1rem 0; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 1.25rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,0.1); color: white; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-user { font-size: 12px; color: rgba(255,255,255,0.6); margin-bottom: 8px; }
.sidebar-user strong { color: white; display: block; }
.logout-btn {
    display: flex; align-items: center; gap: 6px;
    color: rgba(255,255,255,0.6); font-size: 12px;
    text-decoration: none; transition: color 0.2s;
}
.logout-btn:hover { color: white; }

.main-content { margin-left: 220px; flex: 1; padding: 1.5rem; }

/* TOPBAR */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.topbar h1 { font-size: 20px; font-weight: 600; color: var(--navy); }
.topbar-actions { display: flex; gap: 8px; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 1.5rem; }
.stat-card { background: var(--white); border-radius: var(--radius-lg); padding: 1rem 1.25rem; border: 1px solid var(--border); }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: 600; color: var(--navy); }
.stat-card.orange .stat-value { color: var(--orange); }

/* BUTTONS */
.btn-primary { background: var(--orange); color: white; border: none; border-radius: var(--radius); padding: 9px 16px; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary:hover { background: #c9551a; }
.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 14px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-secondary:hover { background: var(--bg); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; border-radius: var(--radius); padding: 4px 10px; font-size: 12px; cursor: pointer; }
.btn-danger:hover { background: #fee2e2; }

/* FILTERS */
.filters-bar { display: flex; gap: 8px; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.filter-select { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: white; color: var(--text); }
.search-input { padding: 7px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: white; min-width: 200px; }

/* MONTH SECTIONS */
.month-section { margin-bottom: 1.5rem; }
.month-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; cursor: pointer; }
.month-title { font-size: 14px; font-weight: 600; color: var(--navy); }
.month-badge { background: var(--bg); color: var(--muted); font-size: 11px; padding: 2px 8px; border-radius: 99px; }
.month-toggle { color: var(--muted); font-size: 12px; }

/* TABLE */
.table-card { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
.crm-table { width: 100%; border-collapse: collapse; }
.crm-table th { background: #fafafa; padding: 9px 12px; text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.crm-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); vertical-align: middle; }
.crm-table tr:last-child td { border-bottom: none; }
.crm-table tr:hover td { background: #fafbfc; }
.no-orders { text-align: center; padding: 2rem; color: var(--muted); font-size: 13px; }

/* BADGES */
.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge-rar { background: #dbeafe; color: #1d4ed8; }
.badge-car { background: #fef3c7; color: #92400e; }
.badge-fin { background: #d1fae5; color: #065f46; }
.badge-liv { background: #dcfce7; color: #166534; }
.badge-anu { background: #fee2e2; color: #991b1b; }

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal-box { background: white; border-radius: var(--radius-lg); padding: 1.5rem; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.modal-title { font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 1.25rem; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-group { margin-bottom: 12px; }
.modal-group label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.modal-group input, .modal-group select, .modal-group textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 13px; color: var(--text); background: #fafafa;
}
.modal-group input:focus, .modal-group select:focus, .modal-group textarea:focus { outline: none; border-color: var(--orange); background: white; }
.modal-group textarea { height: 70px; resize: vertical; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.25rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.file-upload-label { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: var(--radius); cursor: pointer; color: var(--muted); font-size: 13px; }
.file-upload-label:hover { border-color: var(--orange); color: var(--orange); }
.file-upload-label input { display: none; }

/* ALERTS */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 1rem; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* PDF LINK */
.pdf-link { color: var(--orange); text-decoration: none; font-size: 12px; display: inline-flex; align-items: center; gap: 3px; }
.pdf-link:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; padding: 1rem; }
    .modal-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
