/**
 * GIPIX CRM — Material-компоненты: карточки, кнопки, stats-card, таблицы, формы, алерты, модалки, табы, бейджи.
 * Этап 5. Подключать после layout-topbar.css, до enhanced-ui.css.
 */

/* Material Design Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--md-elevation-1);
    border: none;
    margin-bottom: 24px;
    transition: box-shadow var(--md-transition-fast);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--md-elevation-2);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--md-gray-200);
    padding: 20px 24px;
}

.card-body {
    padding: 24px;
}

.card-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--md-gray-800);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Material Design Buttons */
.btn {
    border: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 14px;
    padding: 5px 12px;
    transition: all var(--md-transition-fast);
    text-transform: none;
    letter-spacing: 0.25px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--md-elevation-1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: width 0.3s, height 0.3s, top 0.3s, left 0.3s;
    transform: translate(-50%, -50%);
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--md-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--md-primary-dark);
    color: white;
    box-shadow: var(--md-elevation-2);
}

.btn-success {
    background: var(--md-success);
    color: white;
}

.btn-success:hover {
    background: #45a049;
    color: white;
    box-shadow: var(--md-elevation-2);
}

.btn-info {
    background: var(--md-info);
    color: white;
}

.btn-info:hover {
    background: #1976d2;
    color: white;
    box-shadow: var(--md-elevation-2);
}

.btn-warning {
    background: var(--md-warning);
    color: white;
}

.btn-warning:hover {
    background: #f57c00;
    color: white;
    box-shadow: var(--md-elevation-2);
}

.btn-danger {
    background: var(--md-error);
    color: white;
}

.btn-danger:hover {
    background: #d32f2f;
    color: white;
    box-shadow: var(--md-elevation-2);
}

.btn-outline-primary {
    background: transparent;
    color: var(--md-primary);
    border: 1px solid var(--md-primary);
    box-shadow: none;
}

.btn-outline-primary:hover {
    background: var(--md-primary);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--md-gray-600);
    border: 1px solid var(--md-gray-300);
    box-shadow: none;
}

.btn-outline-secondary:hover {
    background: var(--md-gray-100);
    color: var(--md-gray-700);
}

/* Stats Cards */
.stats-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--md-elevation-1);
    border-left: 4px solid var(--md-primary);
    transition: all var(--md-transition-fast);
}

.stats-card:hover {
    box-shadow: var(--md-elevation-2);
    transform: translateY(-2px);
}

.stats-card.success {
    border-left-color: var(--md-success);
}

.stats-card.info {
    border-left-color: var(--md-info);
}

.stats-card.warning {
    border-left-color: var(--md-warning);
}

.stats-number {
    font-size: 32px;
    font-weight: 500;
    color: var(--md-gray-800);
    margin-bottom: 8px;
    line-height: 1;
}

.stats-label {
    color: var(--md-gray-600);
    font-size: 14px;
    font-weight: 400;
    margin: 0;
}

/* Material Tables */
.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--md-elevation-1);
    margin-bottom: 0;
}

.table thead th {
    background: var(--md-gray-50);
    color: var(--md-gray-700);
    border: none;
    font-weight: 500;
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--md-gray-200);
}

.table tbody td {
    padding: 16px;
    border-bottom: 1px solid var(--md-gray-100);
    vertical-align: middle;
    font-size: 14px;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--md-gray-50);
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid var(--md-gray-300);
    padding: 12px 16px;
    font-size: 14px;
    transition: border-color var(--md-transition-fast);
    background: white;
}

.form-control:focus {
    border-color: var(--md-primary);
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
    background: white;
}

.form-label {
    font-weight: 500;
    color: var(--md-gray-700);
    margin-bottom: 8px;
    font-size: 14px;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: var(--md-elevation-1);
    font-weight: 400;
    padding: 16px;
}

/* Modal */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: var(--md-elevation-8);
}

.modal-header {
    border-bottom: 1px solid var(--md-gray-200);
    padding: 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--md-gray-200);
    padding: 16px 24px;
}

/* Navigation Tabs */
.nav-tabs {
    border-bottom: 1px solid var(--md-gray-200);
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 12px 24px;
    font-weight: 500;
    color: var(--md-gray-600);
    transition: all var(--md-transition-fast);
}

.nav-tabs .nav-link.active {
    background: white;
    color: var(--md-primary);
    box-shadow: var(--md-elevation-1);
}

.nav-tabs .nav-link:hover {
    background: var(--md-gray-50);
    color: var(--md-primary);
}

/* Badges */
.badge {
    font-size: 12px;
    border-radius: 16px;
    padding: 4px 12px;
    font-weight: 500;
}
