/* Core Styles for BiajaSystem */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary-color: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #1e293b;
    --border-color: #e2e8f0;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 4px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: #f1f5f9;
    color: var(--text-main);
    line-height: 1.5;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 100px;
}

.brand-logo {
    width: auto;
    max-width: 180px;
    height: auto;
    max-height: 45px;
    display: block;
    object-fit: contain;
    transition: all 0.3s ease;
}

.sidebar-nav {
    padding: 20px 0;
    flex-grow: 1;
}

.sidebar-nav ul {
    list-style: none;
}

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

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

/* Sidebar Accordion Styles */
.menu-group {
    margin-bottom: 4px;
}

.menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}

.menu-header:hover {
    color: var(--sidebar-text);
}

.menu-header span {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-header .chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.menu-group.open .chevron {
    transform: rotate(180deg);
}

.menu-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.2);
}

.menu-group.open .menu-items {
    max-height: 500px; /* Large enough for items */
}

.menu-items li a {
    padding-left: 52px; /* Indent sub-items */
    font-size: 0.9rem;
    border-left: none;
}

.menu-items li a:hover, .menu-items li a.active {
    border-left: none;
    background-color: var(--sidebar-active);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-header {
    height: 64px;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 24px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.content-wrapper {
    padding: 32px;
    flex: 1;
}

/* Dashboard Specific Styles */
.dashboard-header {
    margin-bottom: 24px;
}

.dashboard-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
}

.dashboard-header p {
    color: var(--text-muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ventas-icon { background: #dcfce7; color: #16a34a; }
.expedientes-icon { background: #e0e7ff; color: #4f46e5; }
.clientes-icon { background: #fef3c7; color: #d97706; }
.pendientes-icon { background: #fee2e2; color: #dc2626; }

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 500;
}

.stat-trend.positive { color: var(--success); }
.stat-trend.negative { color: var(--danger); }
.stat-trend.neutral { color: var(--text-muted); }

.dashboard-widgets {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.widget {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.widget-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    outline: none;
    font-size: 0.9rem;
    width: 280px;
    transition: all 0.2s;
    background: var(--secondary-color);
}

.search-box input:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    width: 320px;
}

.search-box::before {
    content: '';
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.7;
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.widget-content {
    padding: 24px;
}

/* Premium Buttons */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.925rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    font-family: inherit;
    line-height: 1;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    border-color: #cbd5e1;
}

.btn-success {
    background-color: var(--success);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-light);
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary-color);
    font-weight: 600;
    border-radius: 0;
}

.btn-link:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* Forms Modernization */
.form-input, .form-control, select, textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
}

.form-input:focus, select:focus, textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

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

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

/* Basic Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--secondary-color);
}

/* Birthday List */
.birthday-list {
    list-style: none;
}

.birthday-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.birthday-list li:last-child {
    border-bottom: none;
}

.cake-icon {
    color: var(--info);
    vertical-align: middle;
}
